openssl/crypto/dsa
Dr. Stephen Henson a8565530e2 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>

(cherry picked from commit 684400ce19)
2015-01-05 14:36:20 +00:00
..
.cvsignore Add emacs cache files to .cvsignore. 2005-04-11 14:17:07 +00:00
dsa.h Backport PSS signature support from HEAD. 2011-10-09 23:13:50 +00:00
dsa_ameth.c RT3061: Don't SEGFAULT when trying to export a public DSA key as a private key. 2014-08-22 15:25:18 +02:00
dsa_asn1.c Fix various certificate fingerprint issues. 2015-01-05 14:36:20 +00:00
dsa_depr.c When OPENSSL_NO_DEPRECATED is defined, deprecated functions are (or should 2003-10-29 04:06:50 +00:00
dsa_err.c Backport PSS signature support from HEAD. 2011-10-09 23:13:50 +00:00
dsa_gen.c Redirect DH key and parameter generation. 2011-06-09 15:21:46 +00:00
dsa_key.c Redirect DH key and parameter generation. 2011-06-09 15:21:46 +00:00
dsa_lib.c DH keys have an (until now) unused 'q' parameter. When creating from DSA copy 2011-11-14 14:16:09 +00:00
dsa_locl.h Add additional parameter to dsa_builtin_paramgen to output the generated 2011-01-19 14:46:42 +00:00
dsa_ossl.c Since FIPS 186-3 specifies we use the leftmost bits of the digest 2011-02-01 12:53:47 +00:00
dsa_pmeth.c make EVP_dss() work for DSA signing 2011-06-20 20:05:13 +00:00
dsa_prn.c Update obsolete email address... 2008-11-05 18:39:08 +00:00
dsa_sign.c Redirect DSA operations to FIPS module in FIPS mode. 2011-06-09 13:54:09 +00:00
dsa_vrf.c Redirect DSA operations to FIPS module in FIPS mode. 2011-06-09 13:54:09 +00:00
dsagen.c Adjust the parameter lists in some not commonly used files. 2003-01-01 23:41:46 +00:00
dsatest.c Remove the dual-callback scheme for numeric and pointer thread IDs, 2008-08-06 15:54:15 +00:00
fips186a.txt Import of old SSLeay release: SSLeay 0.8.1b 1998-12-21 10:52:47 +00:00
Makefile make update 2014-01-06 13:33:27 +00:00
README Import of old SSLeay release: SSLeay 0.8.1b 1998-12-21 10:52:47 +00:00

The stuff in here is based on patches supplied to me by
Steven Schoch <schoch@sheba.arc.nasa.gov> to do DSS.
I have since modified a them a little but a debt of gratitude
is due for doing the initial work.