Skip to content

Commit 236b376

Browse files
committed
Adding test cases for BundleEID Other Name
1 parent 998df5b commit 236b376

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

tests/suites/test_suite_x509parse.data

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ X509 SAN parsing otherName
202202
depends_on:PSA_HAVE_ALG_SOME_ECDSA:PSA_WANT_ECC_SECP_R1_256:PSA_WANT_ALG_SHA_256
203203
x509_parse_san:"../framework/data_files/parse_input/server5-othername.crt.der":"type \: 0\notherName \: hardware module name \: hardware type \: 1.3.6.1.4.1.17.3, hardware serial number \: 313233343536\n":0
204204

205+
X509 SAN parsing BP EID otherName
206+
depends_on:PSA_HAVE_ALG_SOME_ECDSA:PSA_WANT_ECC_SECP_R1_256:PSA_WANT_ALG_SHA_256
207+
x509_parse_san:"../framework/data_files/parse_input/server5-bp_eid.crt.der":"type \: 0\notherName \: BundleEID \: ipn\:977000.100.0\n":0
208+
205209
X509 SAN parsing binary otherName
206210
depends_on:PSA_HAVE_ALG_SOME_ECDSA:PSA_WANT_ECC_SECP_R1_256:PSA_WANT_ALG_SHA_256
207211
x509_parse_san:"../framework/data_files/parse_input/server5-nonprintable_othername.crt.der":"type \: 0\notherName \: hardware module name \: hardware type \: 1.3.6.1.4.1.17.3, hardware serial number \: 3132338081008180333231\n":0

tests/suites/test_suite_x509parse.function

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,19 @@ static int verify_parse_san(mbedtls_x509_subject_alternative_name *san,
270270
san->san.other_name.value.hardware_module_name.val.p[i]);
271271
MBEDTLS_X509_SAFE_SNPRINTF;
272272
}
273-
}
273+
}/* MBEDTLS_OID_ON_HW_MODULE_NAME */
274+
else if (MBEDTLS_OID_CMP(MBEDTLS_OID_ON_BUNDLE_EID,
275+
&san->san.other_name.type_id) == 0) {
276+
int len = 0;
277+
const char *str = NULL;
278+
if (san->san.other_name.value.raw.tag == MBEDTLS_ASN1_IA5_STRING) {
279+
len = san->san.other_name.value.raw.len;
280+
str = (char*)san->san.other_name.value.raw.p;
281+
}
282+
283+
ret = mbedtls_snprintf(p, n, " BundleEID : %.*s", len, str);
284+
MBEDTLS_X509_SAFE_SNPRINTF;
285+
}/* MBEDTLS_OID_ON_BUNDLE_EID */
274286
else {
275287
ret = mbedtls_snprintf(p, n, " raw :");
276288
MBEDTLS_X509_SAFE_SNPRINTF;

0 commit comments

Comments
 (0)