openssl/crypto/asn1
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
..
a_bitstr.c Return error when a bit string indicates an invalid amount of bits left 2014-12-18 15:03:52 +01:00
a_bool.c Revert the size_t modifications from HEAD that had led to more 2008-11-12 03:58:08 +00:00
a_bytes.c PR: 1835 2009-02-14 21:49:38 +00:00
a_d2i_fp.c Check for potentially exploitable overflows in asn1_d2i_read_bio 2012-04-19 16:19:56 +00:00
a_digest.c Audit libcrypto for unchecked return values: fix all cases enountered 2009-09-23 23:43:49 +00:00
a_dup.c PR: 1644 2009-09-06 15:49:46 +00:00
a_enum.c - use BN_set_negative and BN_is_negative instead of BN_set_sign 2005-04-22 20:02:44 +00:00
a_gentm.c Remove references to o_time.h 2014-02-19 20:06:13 +00:00
a_i2d_fp.c Update util/ck_errf.pl script, and have it run automatically 2005-05-09 00:27:37 +00:00
a_int.c RT783: Minor optimization to ASN1_INTEGER_set 2014-08-15 10:54:43 -04:00
a_mbstr.c Fix unitialized warnings 2009-10-04 16:52:51 +00:00
a_object.c Fix OID handling: 2014-08-06 20:36:41 +01:00
a_octet.c Revert the size_t modifications from HEAD that had led to more 2008-11-12 03:58:08 +00:00
a_print.c RT3023: Redundant logical expressions 2014-08-15 10:45:00 -04:00
a_set.c SetBlob: free rgSetBlob on error path 2014-08-15 22:35:11 +02:00
a_sign.c mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
a_strex.c RT2400: ASN1_STRING_to_UTF8 missing initializer 2014-08-27 22:59:05 -04:00
a_strnid.c Set default global mask to UTF8 only. 2014-06-01 15:03:00 +01:00
a_time.c mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
a_type.c Fix some warnings. 2008-03-16 20:59:10 +00:00
a_utctm.c Memory leak and NULL dereference fixes. 2014-06-27 14:35:07 +01:00
a_utf8.c mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
a_verify.c Fix various certificate fingerprint issues. 2015-01-05 14:35:19 +00:00
ameth_lib.c Memory leak and NULL dereference fixes. 2014-06-27 14:35:07 +01:00
asn1.h mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
asn1_err.c Return error when a bit string indicates an invalid amount of bits left 2014-12-18 15:03:52 +01:00
asn1_gen.c Fix d4a4370050 2014-08-11 17:32:57 -04:00
asn1_lib.c ASN1 sanity check. 2014-07-02 00:59:26 +01:00
asn1_locl.h Add functions returning security bits. 2014-03-28 14:49:04 +00:00
asn1_mac.h Revert the size_t modifications from HEAD that had led to more 2008-11-12 03:58:08 +00:00
asn1_par.c RT3543: Remove #ifdef LINT 2014-12-10 17:31:04 -05:00
asn1t.h mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
asn_mime.c multi_split: check for NULL when allocating parts and bpart, and for failure of sk_BIO_push() 2014-08-15 22:37:48 +02:00
asn_moid.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
asn_mstbl.c oops, add missing asn_mstbl.c 2012-10-24 13:27:46 +00:00
asn_pack.c Memory leak and NULL dereference fixes. 2014-06-27 14:35:07 +01:00
bio_asn1.c Memory leak and NULL dereference fixes. 2014-06-27 14:35:07 +01:00
bio_ndef.c no need to include memory.h 2011-04-30 23:37:42 +00:00
charmap.h Bunch of constifications. 2007-10-13 15:51:32 +00:00
charmap.pl RT1815: More const'ness improvements 2014-08-18 11:49:16 -04:00
d2i_pr.c Revert the size_t modifications from HEAD that had led to more 2008-11-12 03:58:08 +00:00
d2i_pu.c PR: 2088 2009-11-12 19:56:56 +00:00
evp_asn1.c Memory leak and NULL dereference fixes. 2014-06-27 14:35:07 +01:00
f_enum.c There have been a number of complaints from a number of sources that names 2000-06-01 22:19:21 +00:00
f_int.c Security fixes brought forward from 0.9.7. 2002-11-13 15:43:43 +00:00
f_string.c There have been a number of complaints from a number of sources that names 2000-06-01 22:19:21 +00:00
i2d_pr.c Submitted by: "Victor B. Wagner" <vitus@cryptocom.ru> 2007-11-20 13:37:51 +00:00
i2d_pu.c ecc api cleanup; summary: 2005-05-16 10:11:04 +00:00
Makefile Implement internally opaque bn access from asn1 2014-12-08 21:40:26 +00:00
n_pkey.c Fix warnings. 2010-06-12 14:13:23 +00:00
nsseq.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
p5_pbe.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
p5_pbev2.c Fix memory leak. 2011-02-07 13:34:00 +00:00
p8_pkey.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
t_bitst.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
t_crl.c Fix warnings. 2010-06-12 14:13:23 +00:00
t_pkey.c Implement internally opaque bn access from asn1 2014-12-08 21:40:26 +00:00
t_req.c RT3508: Remove unused variable introduced by b09eb24 2014-08-31 23:43:37 -04:00
t_spki.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
t_x509.c Memory leak and NULL dereference fixes. 2014-06-27 14:35:07 +01:00
t_x509a.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
tasn_dec.c Reject invalid constructed encodings. 2014-12-17 14:25:58 +00:00
tasn_enc.c Memory leak and NULL dereference fixes. 2014-06-27 14:35:07 +01:00
tasn_fre.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
tasn_new.c PR: 2013 2009-09-02 13:54:50 +00:00
tasn_prn.c RT1815: More const'ness improvements 2014-08-18 11:49:16 -04:00
tasn_scn.c Fix error codes. 2011-02-03 10:03:23 +00:00
tasn_typ.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
tasn_utl.c misspellings fixes by https://github.com/vlajos/misspell_fixer 2013-09-05 21:39:42 +01:00
x_algor.c New function X509_ALGOR_set_md() to set X509_ALGOR (DigestAlgorithmIdentifier) 2010-03-11 13:27:05 +00:00
x_attrib.c mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
x_bignum.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
x_crl.c Tolerate critical AKID in CRLs. 2014-06-27 18:49:32 +01:00
x_exten.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
x_info.c Merge from the ASN1 branch of new ASN1 code 2000-12-08 19:09:35 +00:00
x_long.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
x_name.c RT2914: NULL check missing in X509_name_canon 2015-01-04 14:51:04 -05:00
x_nx509.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
x_pkey.c Revert the size_t modifications from HEAD that had led to more 2008-11-12 03:58:08 +00:00
x_pubkey.c PR: 2813 2012-05-11 13:53:37 +00:00
x_req.c mark all block comments that need format preserving so that 2014-12-30 22:10:26 +00:00
x_sig.c Get rid of ASN1_ITEM_FUNCTIONS dummy function 2001-02-23 12:47:06 +00:00
x_spki.c Get rid of ASN1_ITEM_FUNCTIONS dummy function 2001-02-23 12:47:06 +00:00
x_val.c Get rid of ASN1_ITEM_FUNCTIONS dummy function 2001-02-23 12:47:06 +00:00
x_x509.c Add i2d_re_X509_tbs 2014-09-05 17:18:06 +02:00
x_x509a.c Support setting of "no purpose" for trust. 2013-11-11 22:39:23 +00:00