Skip to content

Commit 12f4f69

Browse files
ColtonWilleydouzzer
authored andcommitted
Allow intermediate CA certs without keycertsign when added through X509 STORE
1 parent 38c7de1 commit 12f4f69

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ssl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5535,13 +5535,15 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify)
55355535
}
55365536
}
55375537

5538-
if (ret == 0 && cert->isCA == 0 && type != WOLFSSL_USER_CA) {
5538+
if (ret == 0 && cert->isCA == 0 && type != WOLFSSL_USER_CA &&
5539+
type != WOLFSSL_INTER_CA) {
55395540
WOLFSSL_MSG("\tCan't add as CA if not actually one");
55405541
ret = NOT_CA_ERROR;
55415542
}
55425543
#ifndef ALLOW_INVALID_CERTSIGN
55435544
else if (ret == 0 && cert->isCA == 1 && type != WOLFSSL_USER_CA &&
5544-
!cert->selfSigned && (cert->extKeyUsage & KEYUSE_KEY_CERT_SIGN) == 0) {
5545+
type != WOLFSSL_INTER_CA && !cert->selfSigned &&
5546+
(cert->extKeyUsage & KEYUSE_KEY_CERT_SIGN) == 0) {
55455547
/* Intermediate CA certs are required to have the keyCertSign
55465548
* extension set. User loaded root certs are not. */
55475549
WOLFSSL_MSG("\tDoesn't have key usage certificate signing");

0 commit comments

Comments
 (0)