diff options
author | David Horstmann <david.horstmann@arm.com> | 2023-02-21 17:19:45 +0000 |
---|---|---|
committer | David Horstmann <david.horstmann@arm.com> | 2023-02-22 18:27:59 +0000 |
commit | e91cbcfb2cbc66705e0b7bc9058ca332b89d8d28 (patch) | |
tree | b79861ae9fc985a45b1276ed1df32583fb5c7a78 /tests/suites/test_suite_oid.data | |
parent | 376e8df9d6098539c7ece0bbbce99214f1d5b412 (diff) | |
download | mbedtls-e91cbcfb2cbc66705e0b7bc9058ca332b89d8d28.zip mbedtls-e91cbcfb2cbc66705e0b7bc9058ca332b89d8d28.tar.gz mbedtls-e91cbcfb2cbc66705e0b7bc9058ca332b89d8d28.tar.bz2 |
Add negative test cases for OID parsing
Signed-off-by: David Horstmann <david.horstmann@arm.com>
Diffstat (limited to 'tests/suites/test_suite_oid.data')
-rw-r--r-- | tests/suites/test_suite_oid.data | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/suites/test_suite_oid.data b/tests/suites/test_suite_oid.data index 9e47ef4..d4a7dea 100644 --- a/tests/suites/test_suite_oid.data +++ b/tests/suites/test_suite_oid.data @@ -131,3 +131,30 @@ oid_from_numeric_string:"2.49.0.0.826.0":0:"81010000863A00" OID from numeric string - multi-byte first subidentifier oid_from_numeric_string:"2.999":0:"8837" + +OID from numeric string - empty string input +oid_from_numeric_string:"":MBEDTLS_ERR_ASN1_INVALID_DATA:"" + +OID from numeric string - first component not a number +oid_from_numeric_string:"abc.1.2":MBEDTLS_ERR_ASN1_INVALID_DATA:"" + +OID from numeric string - second component not a number +oid_from_numeric_string:"1.abc.2":MBEDTLS_ERR_ASN1_INVALID_DATA:"" + +OID from numeric string - first component too large +oid_from_numeric_string:"3.1":MBEDTLS_ERR_ASN1_INVALID_DATA:"" + +OID from numeric string - first component < 2, second > 39 +oid_from_numeric_string:"1.40":MBEDTLS_ERR_ASN1_INVALID_DATA:"" + +OID from numeric string - third component not a number +oid_from_numeric_string:"1.2.abc":MBEDTLS_ERR_ASN1_INVALID_DATA:"" + +OID from numeric string - non-'.' separator between first and second +oid_from_numeric_string:"1/2.3.4":MBEDTLS_ERR_ASN1_INVALID_DATA:"" + +OID from numeric string - non-'.' separator between second and third +oid_from_numeric_string:"1.2/3.4":MBEDTLS_ERR_ASN1_INVALID_DATA:"" + +OID from numeric string - non-'.' separator between third and fourth +oid_from_numeric_string:"1.2.3/4":MBEDTLS_ERR_ASN1_INVALID_DATA:"" |