diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-01-16 19:56:20 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-02-03 12:38:44 +0100 |
commit | 67813d8a4d110f4174bbd2fee8a2f15388e324b5 (patch) | |
tree | 08f8515ecb35cf2b12f49ae14c2d5d74139de2be /test | |
parent | 934a04f0e775309cadbef0aa6b9692e1b12a76c6 (diff) |
Add test for d2i_PKCS7 NULL dereference
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/recipes/25-test_pkcs7.t | 7 | ||||
-rw-r--r-- | test/recipes/25-test_pkcs7_data/malformed.pkcs7 | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/test/recipes/25-test_pkcs7.t b/test/recipes/25-test_pkcs7.t index 37cd43dc6b..d61cd6abad 100644 --- a/test/recipes/25-test_pkcs7.t +++ b/test/recipes/25-test_pkcs7.t @@ -11,11 +11,11 @@ use strict; use warnings; use File::Spec; -use OpenSSL::Test qw/:DEFAULT srctop_file/; +use OpenSSL::Test qw/:DEFAULT srctop_file data_file/; setup("test_pkcs7"); -plan tests => 3; +plan tests => 4; require_ok(srctop_file('test','recipes','tconversion.pl')); @@ -27,3 +27,6 @@ subtest 'pkcs7 conversions -- pkcs7d' => sub { tconversion( -type => 'p7d', -in => srctop_file("test", "pkcs7-1.pem"), -args => ["pkcs7"] ); }; + +my $malformed = data_file('malformed.pkcs7'); +ok(run(app(["openssl", "pkcs7", "-in", $malformed]))); diff --git a/test/recipes/25-test_pkcs7_data/malformed.pkcs7 b/test/recipes/25-test_pkcs7_data/malformed.pkcs7 new file mode 100644 index 0000000000..e30d1b582c --- /dev/null +++ b/test/recipes/25-test_pkcs7_data/malformed.pkcs7 @@ -0,0 +1,3 @@ +-----BEGIN PKCS7----- +MAsGCSqGSIb3DQEHAg== +-----END PKCS7----- |