diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index 1b122ee8d6..80bdd25737 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -1384,6 +1384,38 @@ pkcs7_signerInfo_2_invalid_tag.der: pkcs7_data_3_signed.der echo 'a1' | xxd -r -p | dd of=$@ bs=1 seek=810 conv=notrunc all_final += pkcs7_signerInfo_2_invalid_tag.der +# pkcs7 signature file with corrupted signer info[1] +pkcs7_data_signed_badsigner1_badsize.der: pkcs7_data_3_signed.der + cp pkcs7_data_3_signed.der $@ + echo '72' | xxd -p -r | dd of=$@ bs=1 seek=438 conv=notrunc +all_final += pkcs7_data_signed_badsigner1_badsize.der + +pkcs7_data_signed_badsigner1_badtag.der: pkcs7_data_3_signed.der + cp pkcs7_data_3_signed.der $@ + echo 'a1' | xxd -p -r | dd of=$@ bs=1 seek=442 conv=notrunc +all_final += pkcs7_data_signed_badsigner1_badtag.der + +pkcs7_data_signed_badsigner1_fuzzbad.der: pkcs7_data_3_signed.der + cp pkcs7_data_3_signed.der $@ + echo 'a1' | xxd -p -r | dd of=$@ bs=1 seek=550 conv=notrunc +all_final += pkcs7_data_signed_badsigner1_fuzzbad.der + +# pkcs7 signature file with corrupted signer info[2] +pkcs7_data_signed_badsigner2_badsize.der: pkcs7_data_3_signed.der + cp pkcs7_data_3_signed.der $@ + echo '72'| xxd -p -r | dd of=$@ bs=1 seek=813 conv=notrunc +all_final += pkcs7_data_signed_badsigner2_badsize + +pkcs7_data_signed_badsigner2_badtag.der: pkcs7_data_3_signed.der + cp pkcs7_data_3_signed.der $@ + echo 'a1'| xxd -p -r | dd of=$@ bs=1 seek=817 conv=notrunc +all_final += pkcs7_data_signed_badsigner2_badtag + +pkcs7_data_signed_badsigner2_fuzzbad.der: pkcs7_data_3_signed.der + cp pkcs7_data_3_signed.der $@ + echo 'a1'| xxd -p -r | dd of=$@ bs=1 seek=925 conv=notrunc +all_final += pkcs7_data_signed_badsigner2_fuzzbad + # pkcs7 file with version 2 pkcs7_data_cert_signed_v2.der: pkcs7_data_cert_signed_sha256.der cp pkcs7_data_cert_signed_sha256.der $@ diff --git a/tests/data_files/pkcs7_data_signed_badsigner1_badsize.der b/tests/data_files/pkcs7_data_signed_badsigner1_badsize.der new file mode 100644 index 0000000000..da7f3a9910 Binary files /dev/null and b/tests/data_files/pkcs7_data_signed_badsigner1_badsize.der differ diff --git a/tests/data_files/pkcs7_data_signed_badsigner1_badtag.der b/tests/data_files/pkcs7_data_signed_badsigner1_badtag.der new file mode 100644 index 0000000000..402b91050f Binary files /dev/null and b/tests/data_files/pkcs7_data_signed_badsigner1_badtag.der differ diff --git a/tests/data_files/pkcs7_data_signed_badsigner1_fuzzbad.der b/tests/data_files/pkcs7_data_signed_badsigner1_fuzzbad.der new file mode 100644 index 0000000000..e19c54a05f Binary files /dev/null and b/tests/data_files/pkcs7_data_signed_badsigner1_fuzzbad.der differ diff --git a/tests/data_files/pkcs7_data_signed_badsigner2_badsize.der b/tests/data_files/pkcs7_data_signed_badsigner2_badsize.der new file mode 100644 index 0000000000..6b12b80ae6 Binary files /dev/null and b/tests/data_files/pkcs7_data_signed_badsigner2_badsize.der differ diff --git a/tests/data_files/pkcs7_data_signed_badsigner2_badtag.der b/tests/data_files/pkcs7_data_signed_badsigner2_badtag.der new file mode 100644 index 0000000000..7929444662 Binary files /dev/null and b/tests/data_files/pkcs7_data_signed_badsigner2_badtag.der differ diff --git a/tests/data_files/pkcs7_data_signed_badsigner2_fuzzbad.der b/tests/data_files/pkcs7_data_signed_badsigner2_fuzzbad.der new file mode 100644 index 0000000000..b52bb78198 Binary files /dev/null and b/tests/data_files/pkcs7_data_signed_badsigner2_fuzzbad.der differ diff --git a/tests/suites/test_suite_pkcs7.data b/tests/suites/test_suite_pkcs7.data index da8146bc15..ffeec498ce 100644 --- a/tests/suites/test_suite_pkcs7.data +++ b/tests/suites/test_suite_pkcs7.data @@ -30,6 +30,30 @@ PKCS7 Signed Data Parse Fail with corrupted signer info #6 depends_on:MBEDTLS_SHA256_C:MBEDTLS_RSA_C pkcs7_parse:"data_files/pkcs7_data_signed_badsigner.der":MBEDTLS_ERROR_ADD(MBEDTLS_ERR_PKCS7_INVALID_SIGNER_INFO,MBEDTLS_ERR_ASN1_UNEXPECTED_TAG) +PKCS7 Signed Data Parse Fail with corrupted signer info[1] invalid size #6.1 +depends_on:MBEDTLS_SHA256_C:MBEDTLS_RSA_C +pkcs7_parse:"data_files/pkcs7_data_signed_badsigner1_badsize.der":MBEDTLS_ERR_PKCS7_INVALID_SIGNER_INFO + +PKCS7 Signed Data Parse Fail with corrupted signer info[2] invalid size #6.2 +depends_on:MBEDTLS_SHA256_C:MBEDTLS_RSA_C +pkcs7_parse:"data_files/pkcs7_data_signed_badsigner2_badsize.der":MBEDTLS_ERR_PKCS7_INVALID_SIGNER_INFO + +PKCS7 Signed Data Parse Fail with corrupted signer info[1] unexpected tag #6.3 +depends_on:MBEDTLS_SHA256_C:MBEDTLS_RSA_C +pkcs7_parse:"data_files/pkcs7_data_signed_badsigner1_badtag.der":MBEDTLS_ERROR_ADD(MBEDTLS_ERR_PKCS7_INVALID_SIGNER_INFO,MBEDTLS_ERR_ASN1_UNEXPECTED_TAG) + +PKCS7 Signed Data Parse Fail with corrupted signer info[2] unexpected tag #6.4 +depends_on:MBEDTLS_SHA256_C:MBEDTLS_RSA_C +pkcs7_parse:"data_files/pkcs7_data_signed_badsigner2_badtag.der":MBEDTLS_ERROR_ADD(MBEDTLS_ERR_PKCS7_INVALID_SIGNER_INFO,MBEDTLS_ERR_ASN1_UNEXPECTED_TAG) + +PKCS7 Signed Data Parse Fail with corrupted signer info[1] fuzz bad #6.5 +depends_on:MBEDTLS_SHA256_C:MBEDTLS_RSA_C +pkcs7_parse:"data_files/pkcs7_data_signed_badsigner1_fuzzbad.der":MBEDTLS_ERR_PKCS7_INVALID_SIGNER_INFO + +PKCS7 Signed Data Parse Fail with corrupted signer info[2] fuzz bad #6.6 +depends_on:MBEDTLS_SHA256_C:MBEDTLS_RSA_C +pkcs7_parse:"data_files/pkcs7_data_signed_badsigner2_fuzzbad.der":MBEDTLS_ERR_PKCS7_INVALID_SIGNER_INFO + PKCS7 Signed Data Parse Fail Version other than 1 #7 depends_on:MBEDTLS_SHA256_C pkcs7_parse:"data_files/pkcs7_data_cert_signed_v2.der":MBEDTLS_ERR_PKCS7_INVALID_VERSION