From 4d7210c23c1f40f31482a6cf7cdb4c48182c1231 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 3 Jun 2019 14:25:18 +0100 Subject: [PATCH] Add test case exercising verification of valid MD2 CRT The X.509 parsing test suite test_suite_x509parse contains a test exercising X.509 verification for a valid MD4/MD5 certificate in a profile which doesn't allow MD4/MD5. This commit adds an analogous test for MD2. --- tests/suites/test_suite_x509parse.data | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/suites/test_suite_x509parse.data b/tests/suites/test_suite_x509parse.data index 105ca5759..0fc1ee4de 100644 --- a/tests/suites/test_suite_x509parse.data +++ b/tests/suites/test_suite_x509parse.data @@ -451,11 +451,15 @@ X509 Certificate verification #10 (Not trusted Cert, Expired CRL) depends_on:MBEDTLS_PEM_PARSE_C:MBEDTLS_RSA_C:MBEDTLS_PKCS1_V15:MBEDTLS_SHA1_C x509_verify:"data_files/server2.crt":"data_files/server1.crt":"data_files/crl_expired.pem":"NULL":MBEDTLS_ERR_X509_CERT_VERIFY_FAILED:MBEDTLS_X509_BADCERT_NOT_TRUSTED:"compat":"NULL" -X509 Certificate verification #12 (Valid Cert MD4 Digest) +X509 Certificate verification #12 (Valid Cert MD2 Digest, MD2 forbidden) +depends_on:MBEDTLS_MD2_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_SHA1_C:MBEDTLS_RSA_C:MBEDTLS_PKCS1_V15 +x509_verify:"data_files/cert_md2.crt":"data_files/test-ca.crt":"data_files/crl.pem":"NULL":MBEDTLS_ERR_X509_CERT_VERIFY_FAILED:MBEDTLS_X509_BADCERT_BAD_MD:"compat":"NULL" + +X509 Certificate verification #12 (Valid Cert MD4 Digest, MD4 forbidden) depends_on:MBEDTLS_MD4_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_SHA1_C:MBEDTLS_RSA_C:MBEDTLS_PKCS1_V15 x509_verify:"data_files/cert_md4.crt":"data_files/test-ca.crt":"data_files/crl.pem":"NULL":MBEDTLS_ERR_X509_CERT_VERIFY_FAILED:MBEDTLS_X509_BADCERT_BAD_MD:"compat":"NULL" -X509 Certificate verification #13 (Valid Cert MD5 Digest) +X509 Certificate verification #13 (Valid Cert MD5 Digest, MD5 forbidden) depends_on:MBEDTLS_MD5_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_SHA1_C:MBEDTLS_RSA_C:MBEDTLS_PKCS1_V15 x509_verify:"data_files/cert_md5.crt":"data_files/test-ca.crt":"data_files/crl.pem":"NULL":MBEDTLS_ERR_X509_CERT_VERIFY_FAILED:MBEDTLS_X509_BADCERT_BAD_MD:"compat":"NULL"