fix overwriting serialnum by favouriteDrink

This commit is contained in:
Hideki Miyazaki 2023-03-31 15:56:31 +09:00
parent 6bed0c5757
commit 27f5f3a3e8
No known key found for this signature in database
GPG Key ID: 4EE161CA873C6418
2 changed files with 9 additions and 1 deletions

View File

@ -45103,6 +45103,14 @@ static int test_wolfSSL_make_cert(void)
AssertIntEQ(ASN1_STRING_length(entryValue), 2);
AssertStrEQ((const char*)ASN1_STRING_data(entryValue), "US");
/* compare Serial Number */
AssertIntEQ((idx = X509_NAME_get_index_by_NID(x509name, NID_serialNumber,
-1)), 7);
AssertNotNull(entry = X509_NAME_get_entry(x509name, idx));
AssertNotNull(entryValue = X509_NAME_ENTRY_get_data(entry));
AssertIntEQ(ASN1_STRING_length(entryValue), XSTRLEN("wolfSSL12345"));
AssertStrEQ((const char*)ASN1_STRING_data(entryValue), "wolfSSL12345");
#ifdef WOLFSSL_MULTI_ATTRIB
/* get first and second DC and compare result */
AssertIntEQ((idx = X509_NAME_get_index_by_NID(x509name, NID_domainComponent,

View File

@ -686,7 +686,7 @@ enum DN_Tags {
/* pilot attribute types
* OID values of 0.9.2342.19200300.100.1.* */
ASN_FAVOURITE_DRINK = 0x05, /* favouriteDrink */
ASN_FAVOURITE_DRINK = 0x13, /* favouriteDrink */
ASN_DOMAIN_COMPONENT = 0x19 /* DC */
};