Skip to content

Commit

Permalink
Merge pull request #359 from dgarske/csr_ver
Browse files Browse the repository at this point in the history
CSR version
  • Loading branch information
JacobBarthelmeh authored Jun 20, 2024
2 parents 16ba07a + a883ee9 commit fb7e321
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tpm2_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ WOLFTPM2_CSR* wolfTPM2_NewCSR(void)
XFREE(csr, NULL, DYNAMIC_TYPE_TMP_BUFFER);
csr = NULL;
}
if (csr) {
csr->req.version = 0; /* per RFC2986 : CSR version should be 0 */
}
}
return csr;
}
Expand Down Expand Up @@ -6842,6 +6845,8 @@ int wolfTPM2_CSR_Generate_ex(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* key,
XMEMSET(&csrKey, 0, sizeof(csrKey));
rc = wc_InitCert(&csr.req);
if (rc == 0) {
csr.req.version = 0; /* per RFC2986 : CSR version should be 0 */

rc = CSR_KeySetup(dev, &csr, key, &csrKey, sigType, devId);
}
if (rc == 0) {
Expand Down

0 comments on commit fb7e321

Please sign in to comment.