diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index f5870169a..15b550bcc 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -34,6 +34,8 @@ ASN Options: * ASN_DUMP_OID: Allows dump of OID information for debugging. * RSA_DECODE_EXTRA: Decodes extra information in RSA public key. * WOLFSSL_CERT_GEN: Cert generation. Saves extra certificate info in GetName. + * WOLFSSL_NO_ASN_STRICT: Disable strict RFC compliance checks to + restore 3.13.0 behavior. * WOLFSSL_NO_OCSP_OPTIONAL_CERTS: Skip optional OCSP certs (responder issuer must still be trusted) * WOLFSSL_NO_TRUSTED_CERTS_VERIFY: Workaround for situation where entire cert @@ -48,11 +50,6 @@ ASN Options: #ifndef NO_ASN -#ifdef HAVE_RTP_SYS - #include "os.h" /* dc_rtc_api needs */ - #include "dc_rtc_api.h" /* to get current time */ -#endif - #include #include #include @@ -6337,6 +6334,12 @@ static int DecodeCertExtensions(DecodedCert* cert) #ifndef IGNORE_NAME_CONSTRAINTS case NAME_CONS_OID: + #ifndef WOLFSSL_NO_ASN_STRICT + if (!cert->ca) { + WOLFSSL_MSG("Name constraints allowed only for CA certs"); + return ASN_NAME_INVALID_E; + } + #endif cert->extNameConstraintSet = 1; #ifdef OPENSSL_EXTRA cert->extNameConstraintCrit = critical; diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index c9bf6d87b..acbd675db 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -38,11 +38,11 @@ /* IPP header files for library initialization */ #ifdef HAVE_FAST_RSA -#include -#include + #include + #include #endif -#if defined(FREESCALE_LTC_TFM) +#ifdef FREESCALE_LTC_TFM #include #endif diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index 2445f91c3..4924517be 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -357,6 +357,9 @@ WOLFSSL_API int wolfCrypt_Cleanup(void); #define NEED_TMP_TIME #elif defined(HAVE_RTP_SYS) + #include "os.h" /* dc_rtc_api needs */ + #include "dc_rtc_api.h" /* to get current time */ + /* uses parital structures */ #define XTIME(tl) (0) #define XGMTIME(c, t) rtpsys_gmtime((c))