mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 11:44:38 +02:00
Set alt name type to V_ASN1_IA5STRING
This commit is contained in:
@@ -1969,11 +1969,12 @@ void* wolfSSL_X509_get_ext_d2i(const WOLFSSL_X509* x509, int nid, int* c,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (wolfSSL_ASN1_STRING_set(gn->d.ia5, dns->name,
|
if (wolfSSL_ASN1_STRING_set(gn->d.dNSName,
|
||||||
dns->len) != WOLFSSL_SUCCESS) {
|
dns->name, dns->len) != WOLFSSL_SUCCESS) {
|
||||||
WOLFSSL_MSG("ASN1_STRING_set failed");
|
WOLFSSL_MSG("ASN1_STRING_set failed");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
gn->d.dNSName->type = V_ASN1_IA5STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
dns = dns->next;
|
dns = dns->next;
|
||||||
|
@@ -32207,6 +32207,14 @@ static int test_wolfSSL_certs(void)
|
|||||||
|
|
||||||
sk = (STACK_OF(GENERAL_NAME)*)X509_get_ext_d2i(x509ext, NID_subject_alt_name,
|
sk = (STACK_OF(GENERAL_NAME)*)X509_get_ext_d2i(x509ext, NID_subject_alt_name,
|
||||||
&crit, NULL);
|
&crit, NULL);
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < sk_GENERAL_NAME_num(sk); i++) {
|
||||||
|
GENERAL_NAME* gen = sk_GENERAL_NAME_value(sk, i);
|
||||||
|
AssertIntEQ(gen->type, GEN_DNS);
|
||||||
|
AssertIntEQ(gen->d.dNSName->type, V_ASN1_IA5STRING);
|
||||||
|
}
|
||||||
|
}
|
||||||
/* AssertNotNull(sk); no alt names set */
|
/* AssertNotNull(sk); no alt names set */
|
||||||
sk_GENERAL_NAME_free(sk);
|
sk_GENERAL_NAME_free(sk);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user