Skip to content

Commit bf994c0

Browse files
committed
os_stub/cryptlib_mbedtls: x509: Don't copy some NIDs
Avoid copying the basic_constraints NID as we already set it ourselves and also avoid copying the authority_key_identifier as it won't be correct on the CSR. Signed-off-by: Alistair Francis <[email protected]>
1 parent fa9cffa commit bf994c0

File tree

1 file changed

+10
-0
lines changed
  • os_stub/cryptlib_mbedtls/pk

1 file changed

+10
-0
lines changed

os_stub/cryptlib_mbedtls/pk/x509.c

+10
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,16 @@ bool libspdm_gen_x509_csr(size_t hash_nid, size_t asym_nid,
21102110
goto free_all;
21112111
}
21122112

2113+
if (MBEDTLS_OID_CMP_RAW(MBEDTLS_OID_BASIC_CONSTRAINTS, next_oid->buf.p, oid_tag_len) == 0) {
2114+
next_oid = next_oid->next;
2115+
continue;
2116+
}
2117+
2118+
if (MBEDTLS_OID_CMP_RAW(MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER, next_oid->buf.p, oid_tag_len) == 0) {
2119+
next_oid = next_oid->next;
2120+
continue;
2121+
}
2122+
21132123
if (mbedtls_x509write_csr_set_extension(&req, next_oid->buf.p,
21142124
oid_tag_len,
21152125
next_oid->buf.p + oid_tag_len,

0 commit comments

Comments
 (0)