Skip to content

Commit f1ebd43

Browse files
committed
Fix wolfTPM2_NVReadCert on success case.
1 parent e87af04 commit f1ebd43

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/tpm2_wrap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4435,13 +4435,14 @@ int wolfTPM2_NVReadCert(WOLFTPM2_DEV* dev, TPM_HANDLE handle,
44354435
rc = wolfTPM2_NVReadPublic(dev, handle, &nvPublic);
44364436
if (rc == 0) {
44374437
if (buffer == NULL) {
4438-
/* just return size */
4438+
/* just set size and return success */
44394439
*len = nvPublic.dataSize;
44404440
return 0;
44414441
}
44424442
if (nvPublic.dataSize > *len) {
44434443
return BUFFER_E;
44444444
}
4445+
*len = nvPublic.dataSize;
44454446
}
44464447
else {
44474448
#ifdef DEBUG_WOLFTPM

0 commit comments

Comments
 (0)