Add some tests for various PKCS12 files with NULL ContentInfo
authorMatt Caswell <matt@openssl.org>
Fri, 19 Jan 2024 14:32:18 +0000 (14:32 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 25 Jan 2024 15:31:57 +0000 (15:31 +0000)
commitfebb086d0fc1ea12181f4d833aa9b8fdf2133b3b
treee83f74e96cead17ad62eb4a966aa9aecca943537
parentd135eeab8a5dbf72b3da5240bab9ddb7678dbd2c
Add some tests for various PKCS12 files with NULL ContentInfo

PKCS7 ContentInfo fields held within a PKCS12 file can be NULL, even if the
type has been set to a valid value. CVE-2024-0727 is a result of OpenSSL
attempting to dereference the NULL pointer as a result of this.

We add test for various instances of this problem.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23362)
test/recipes/80-test_pkcs12.t
test/recipes/80-test_pkcs12_data/bad1.p12 [new file with mode: 0644]
test/recipes/80-test_pkcs12_data/bad2.p12 [new file with mode: 0644]
test/recipes/80-test_pkcs12_data/bad3.p12 [new file with mode: 0644]