PKCS#7: avoid NULL pointer dereferences with missing content
authorEmilia Kasper <emilia@openssl.org>
Fri, 27 Feb 2015 15:52:23 +0000 (16:52 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 19 Mar 2015 13:01:13 +0000 (13:01 +0000)
commitc225c3cf9bd67297fb0c297768d69cbc03fbdab7
tree6a0d84b0927954eb98ddd639548af2f198296074
parente677e8d13595f7b3287f8feef7676feb301b0e8a
PKCS#7: avoid NULL pointer dereferences with missing content

In PKCS#7, the ASN.1 content component is optional.
This typically applies to inner content (detached signatures),
however we must also handle unexpected missing outer content
correctly.

This patch only addresses functions reachable from parsing,
decryption and verification, and functions otherwise associated
with reading potentially untrusted data.

Correcting all low-level API calls requires further work.

CVE-2015-0289

Thanks to Michal Zalewski (Google) for reporting this issue.

Reviewed-by: Steve Henson <steve@openssl.org>
crypto/pkcs7/pk7_doit.c
crypto/pkcs7/pk7_lib.c