From 1a0d3740b9cf6c1eaa7d160ab5193e45b5b77ec8 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 4 Jun 2019 15:25:00 +0100 Subject: [PATCH] Extend negative testing for X.509 Serial number parsing --- tests/suites/test_suite_x509parse.data | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_x509parse.data b/tests/suites/test_suite_x509parse.data index bbb0592fc..4b28231b5 100644 --- a/tests/suites/test_suite_x509parse.data +++ b/tests/suites/test_suite_x509parse.data @@ -968,7 +968,7 @@ X509 Certificate ASN1 (TBSCertificate empty) x509parse_crt:"30153000300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_X509_INVALID_FORMAT + MBEDTLS_ERR_ASN1_OUT_OF_DATA X509 Certificate ASN1 (TBSCertificate, no version tag, serial missing) -x509parse_crt:"3003300100":"":MBEDTLS_ERR_X509_INVALID_SERIAL + MBEDTLS_ERR_ASN1_UNEXPECTED_TAG +x509parse_crt:"3016300100300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_X509_INVALID_SERIAL + MBEDTLS_ERR_ASN1_UNEXPECTED_TAG X509 Certificate ASN1 (TBSCertificate, valid outer version tag, no outer length) x509parse_crt:"30163001a0300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_X509_INVALID_FORMAT + MBEDTLS_ERR_ASN1_OUT_OF_DATA @@ -1003,12 +1003,18 @@ x509parse_crt:"308199308183a00602047FFFFFFF8204deadbeef300d06092a864886f70d01010 X509 Certificate ASN1 (TBSCertificate, serial missing) x509parse_crt:"301a3005a003020102300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_X509_INVALID_SERIAL + MBEDTLS_ERR_ASN1_OUT_OF_DATA -X509 Certificate ASN1 (TBSCertificate, incorrect serial tag) +X509 Certificate ASN1 (TBSCertificate, invalid serial, tag wrong) x509parse_crt:"301b3006a00302010200300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_X509_INVALID_SERIAL + MBEDTLS_ERR_ASN1_UNEXPECTED_TAG -X509 Certificate ASN1 (TBSCertificate, incorrect serial length) +X509 Certificate ASN1 (TBSCertificate, invalid serial, length missing) x509parse_crt:"301b3006a00302010282300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_X509_INVALID_SERIAL + MBEDTLS_ERR_ASN1_OUT_OF_DATA +X509 Certificate ASN1 (TBSCertificate, invalid serial, invalid length encoding) +x509parse_crt:"301c3007a0030201028285300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_X509_INVALID_SERIAL + MBEDTLS_ERR_ASN1_INVALID_LENGTH + +X509 Certificate ASN1 (TBSCertificate, invalid serial, length out of bounds) +x509parse_crt:"301c3007a0030201028201300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_X509_INVALID_SERIAL + MBEDTLS_ERR_ASN1_OUT_OF_DATA + X509 Certificate ASN1 (TBSCertificate, correct serial, no alg) x509parse_crt:"3020300ba0030201028204deadbeef300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_X509_INVALID_ALG + MBEDTLS_ERR_ASN1_OUT_OF_DATA