Skip to content

Commit c1af336

Browse files
JuergenReppSITAndreasFuchsTPM
authored andcommitted
tpm2_nvcertify: Set size if the --size parameter is not specified.
The man page states: If not specified, the size of the data as reported by the public portion of the index will be used. But 0 was used if --size was not specified. Also an error in the man page is fixed. Fixes: #3538 Signed-off-by: Juergen Repp <juergen_repp@web.de>
1 parent b25c922 commit c1af336

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

man/tpm2_nvcertify.1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ These options control the certification:
6868

6969
* **--attestation**=_FILE_:
7070

71-
The attestation data of the type TPM2_CREATION_INFO signed with signing key.
71+
The attestation data of the type TPMS_ATTEST signed with signing key.
7272

7373
* **\--cphash**=_FILE_
7474

tools/tpm2_nvcertify.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ static tool_rc check_options(ESYS_CONTEXT *ectx, tpm2_option_flags flags) {
387387
goto is_input_options_args_valid_out;
388388
}
389389

390+
if (ctx.size == 0) {
391+
ctx.size = nv_public->nvPublic.dataSize;
392+
}
393+
390394
if (ctx.offset + ctx.size > nv_public->nvPublic.dataSize) {
391395
LOG_ERR("Size to read at offset is bigger than nv index size");
392396
rc = tool_rc_option_error;

0 commit comments

Comments
 (0)