diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-01-19 08:37:53 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-02-07 17:05:10 +0100 |
commit | 1bb5ce7a3327335690a9f5c8a0b64a0b491a4bf5 (patch) | |
tree | 5942ec45f5807ef7fb599bbbe18da42755424dde | |
parent | 35da6af1f82e3d02338aabe28cab744a63728fd8 (diff) |
Additional testcase for missing return check of BIO_set_md() calls
This tests the handling of PKCS7 signedAndEnveloped type.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
-rw-r--r-- | test/recipes/80-test_cms.t | 12 | ||||
-rw-r--r-- | test/recipes/80-test_cms_data/pkcs7-md4-encrypted.pem | 39 |
2 files changed, 49 insertions, 2 deletions
diff --git a/test/recipes/80-test_cms.t b/test/recipes/80-test_cms.t index d414f552fe..c4cd53b8f3 100644 --- a/test/recipes/80-test_cms.t +++ b/test/recipes/80-test_cms.t @@ -50,7 +50,7 @@ my ($no_des, $no_dh, $no_dsa, $no_ec, $no_ec2m, $no_rc2, $no_zlib) $no_rc2 = 1 if disabled("legacy"); -plan tests => 19; +plan tests => 20; ok(run(test(["pkcs7_test"])), "test pkcs7"); @@ -1087,7 +1087,15 @@ with({ exit_checker => sub { return shift == 4; } }, '-inform', 'PEM', '-in', data_file("pkcs7-md4.pem"), ])), - "Check failure of EVP_DigestInit is handled correctly"); + "Check failure of EVP_DigestInit in PKCS7 signed is handled"); + + ok(run(app(['openssl', 'smime', '-decrypt', + '-inform', 'PEM', + '-in', data_file("pkcs7-md4-encrypted.pem"), + '-recip', srctop_file("test", "certs", "ee-cert.pem"), + '-inkey', srctop_file("test", "certs", "ee-key.pem") + ])), + "Check failure of EVP_DigestInit in PKCS7 signedAndEnveloped is handled"); }); sub check_availability { diff --git a/test/recipes/80-test_cms_data/pkcs7-md4-encrypted.pem b/test/recipes/80-test_cms_data/pkcs7-md4-encrypted.pem new file mode 100644 index 0000000000..18e316f21a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