openssl/crypto/x509
Dr. Stephen Henson 684400ce19 Fix various certificate fingerprint issues.
By using non-DER or invalid encodings outside the signed portion of a
certificate the fingerprint can be changed without breaking the signature.
Although no details of the signed portion of the certificate can be changed
this can cause problems with some applications: e.g. those using the
certificate fingerprint for blacklists.

1. Reject signatures with non zero unused bits.

If the BIT STRING containing the signature has non zero unused bits reject
the signature. All current signature algorithms require zero unused bits.

2. Check certificate algorithm consistency.

Check the AlgorithmIdentifier inside TBS matches the one in the
certificate signature. NB: this will result in signature failure
errors for some broken certificates.

3. Check DSA/ECDSA signatures use DER.

Reencode DSA/ECDSA signatures and compare with the original received
signature. Return an error if there is a mismatch.

This will reject various cases including garbage after signature
(thanks to Antti Karjalainen and Tuomo Untinen from the Codenomicon CROSS
program for discovering this case) and use of BER or invalid ASN.1 INTEGERs
(negative or with leading zeroes).

CVE-2014-8275
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-01-05 14:35:19 +00:00
..
by_dir.c get_cert_by_subject: check for NULL when allocating hent 2014-08-17 18:55:01 +02:00
by_file.c Keep disclaiming 16-bit platform support. For now remove WIN16 references 2005-12-18 19:11:37 +00:00
Makefile Remove fipscanister build functionality from makefiles. 2014-12-08 13:23:45 +00:00
x509.h mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
x509_att.c Update from stable branch. 2008-06-26 23:27:31 +00:00
x509_cmp.c Compare encodings in X509_cmp as well as hash. 2014-01-26 16:29:50 +00:00
x509_d2.c Make all configuration macros available for application by making 2001-02-19 16:06:34 +00:00
x509_def.c
x509_err.c initial support for delta CRL generations by diffing two full CRLs 2012-12-04 18:35:36 +00:00
x509_ext.c X509V3_add_i2d() needs to be able to allocate a 2000-12-27 13:42:43 +00:00
x509_lcl.h Update API to use (char *) for email addresses and hostnames 2014-07-07 19:11:38 +10:00
x509_lu.c mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
x509_obj.c Bunch of constifications. 2007-10-13 15:51:32 +00:00
x509_r2x.c add additional checks + cleanup 2006-01-29 23:12:22 +00:00
x509_req.c Support for certificate status TLS extension. 2007-09-26 21:56:59 +00:00
x509_set.c RT1909: Omit version for v1 certificates 2014-09-09 15:15:45 -04:00
x509_trs.c Experimental support for partial chain verification: if an intermediate 2010-02-25 00:17:22 +00:00
x509_txt.c Integrate host, email and IP address checks into X509_verify. 2012-12-05 18:35:20 +00:00
x509_v3.c improved error checking and some fixes 2005-07-26 21:10:34 +00:00
x509_vfy.c RT2841: Extra return in check_issued 2014-09-08 18:50:07 -04:00
x509_vfy.h mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
x509_vpm.c mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
x509cset.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
x509name.c mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
x509rset.c
x509spki.c NETSCAPE_SPKI_b64_encode: free der_spki and b64_str on error path 2014-08-17 18:55:12 +02:00
x509type.c ? crypto/aes/aes-armv4.S 2011-10-06 20:44:02 +00:00
x_all.c Fix various certificate fingerprint issues. 2015-01-05 14:35:19 +00:00