diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 72d9b5a4e..62ce48113 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -3895,7 +3895,17 @@ static int GetName(DecodedCert* cert, int nameType) dName->snLen = strLen; #endif /* OPENSSL_EXTRA */ } - + else if (id == ASN_DOMAIN_COMPONENT) { + if (!tooBig) { + XMEMCPY(&full[idx], "/domainComponent=", 17); + idx += 17; + copy = TRUE; + } + #ifdef OPENSSL_EXTRA + dName->snIdx = cert->srcIdx; + dName->snLen = strLen; + #endif /* OPENSSL_EXTRA */ + } if (copy && !tooBig) { XMEMCPY(&full[idx], &cert->source[cert->srcIdx], strLen); idx += strLen; diff --git a/wolfssl/openssl/ssl.h b/wolfssl/openssl/ssl.h index 328c1aa77..c7f4aa3a4 100644 --- a/wolfssl/openssl/ssl.h +++ b/wolfssl/openssl/ssl.h @@ -557,6 +557,8 @@ typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY; #define NID_commonName 0x03 /* matchs ASN_COMMON_NAME in asn.h */ +#define NID_domainComponent 0x10 + /* matchs ASN_DOMAIN_COMPONENT in asn.h */ /* matchs ASN_..._NAME in asn.h */ #define NID_commonName 0x03 /* CN */ diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index 1ff378156..19560de6b 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -103,7 +103,8 @@ enum DN_Tags { ASN_LOCALITY_NAME = 0x07, /* L */ ASN_STATE_NAME = 0x08, /* ST */ ASN_ORG_NAME = 0x0a, /* O */ - ASN_ORGUNIT_NAME = 0x0b, /* OU */ + ASN_ORGUNIT_NAME = 0x0b, /* OU */ + ASN_DOMAIN_COMPONENT = 0x10, /* DC */ ASN_EMAIL_NAME = 0x98 /* not oid number there is 97 in 2.5.4.0-97 */ };