Skip to content

Commit fb7e321

Browse files
Merge pull request #359 from dgarske/csr_ver
CSR version
2 parents 16ba07a + a883ee9 commit fb7e321

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/tpm2_wrap.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ WOLFTPM2_CSR* wolfTPM2_NewCSR(void)
277277
XFREE(csr, NULL, DYNAMIC_TYPE_TMP_BUFFER);
278278
csr = NULL;
279279
}
280+
if (csr) {
281+
csr->req.version = 0; /* per RFC2986 : CSR version should be 0 */
282+
}
280283
}
281284
return csr;
282285
}
@@ -6842,6 +6845,8 @@ int wolfTPM2_CSR_Generate_ex(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* key,
68426845
XMEMSET(&csrKey, 0, sizeof(csrKey));
68436846
rc = wc_InitCert(&csr.req);
68446847
if (rc == 0) {
6848+
csr.req.version = 0; /* per RFC2986 : CSR version should be 0 */
6849+
68456850
rc = CSR_KeySetup(dev, &csr, key, &csrKey, sigType, devId);
68466851
}
68476852
if (rc == 0) {

0 commit comments

Comments
 (0)