Fix to resolve wolfCrypt test for `cert_test nameConstraints test. Fixed ASN check to properly determine if certificate is CA type.

This commit is contained in:
David Garske
2018-02-07 12:48:33 -08:00
parent 4a6bb20ba6
commit c2a0de93b8
6 changed files with 13 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@www.wolfsssl.com
emailAddress = support@wolfsssl.com
[ v3_ca ]
inhibitAnyPolicy = critical,1

Binary file not shown.

View File

@@ -10,9 +10,13 @@ L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@www.wolfsssl.com
emailAddress = support@wolfsssl.com
[ v3_ca ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
basicConstraints = critical, CA:true, pathlen:0
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
nameConstraints = critical,permitted;email:.wolfssl.com
nsComment = "Testing name constraints"

Binary file not shown.

8
certs/test/gen-ext-certs.sh Normal file → Executable file
View File

@@ -33,9 +33,13 @@ L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@www.wolfsssl.com
emailAddress = support@wolfsssl.com
[ v3_ca ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
basicConstraints = critical, CA:true, pathlen:0
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
nameConstraints = critical,permitted;email:.wolfssl.com
nsComment = "Testing name constraints"
@@ -58,7 +62,7 @@ L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@www.wolfsssl.com
emailAddress = support@wolfsssl.com
[ v3_ca ]
inhibitAnyPolicy = critical,1

View File

@@ -6363,7 +6363,7 @@ static int DecodeCertExtensions(DecodedCert* cert)
/* Verify RFC 5280 Sec 4.2.1.10 rule:
"The name constraints extension,
which MUST be used only in a CA certificate" */
if (!cert->ca) {
if (!cert->isCA) {
WOLFSSL_MSG("Name constraints allowed only for CA certs");
return ASN_NAME_INVALID_E;
}