Skip to content

Commit 342c37d

Browse files
authored
Merge pull request #9159 from kareem-wolfssl/zd20378
Allow the keyCertSign bit to be asserted specifically for self-signed CAs.
2 parents bdc1f89 + f772aad commit 342c37d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.wolfssl_known_macro_extras

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ AES_GCM_GMULT_NCT
22
AFX_RESOURCE_DLL
33
AFX_TARG_ENU
44
ALLOW_BINARY_MISMATCH_INTROSPECTION
5+
ALLOW_SELFSIGNED_INVALID_CERTSIGN
56
ALLOW_V1_EXTENSIONS
67
ANDROID
78
APP_ESP_HTTP_CLIENT

wolfcrypt/src/asn.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25810,7 +25810,11 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm,
2581025810
* If the cA boolean is not asserted, then the keyCertSign bit in the
2581125811
* key usage extension MUST NOT be asserted. */
2581225812
if (!cert->isCA && cert->extKeyUsageSet &&
25813-
(cert->extKeyUsage & KEYUSE_KEY_CERT_SIGN) != 0) {
25813+
(cert->extKeyUsage & KEYUSE_KEY_CERT_SIGN) != 0
25814+
#ifdef ALLOW_SELFSIGNED_INVALID_CERTSIGN
25815+
&& !cert->selfSigned
25816+
#endif
25817+
) {
2581425818
WOLFSSL_ERROR_VERBOSE(KEYUSAGE_E);
2581525819
return KEYUSAGE_E;
2581625820
}

0 commit comments

Comments
 (0)