openssl/crypto/dsa
Dr. Stephen Henson 85cfc188c0 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:06 +00:00
..
.cvsignore
dsa.h Add FIPS 186-2 DSA parameter generation algorithm. 2013-10-01 14:01:17 +01:00
dsa_ameth.c RT2626: Change default_bits from 1K to 2K 2014-09-08 17:23:37 -04:00
dsa_asn1.c Fix various certificate fingerprint issues. 2015-01-05 14:36:06 +00:00
dsa_depr.c
dsa_err.c Add FIPS 186-2 DSA parameter generation algorithm. 2013-10-01 14:01:17 +01:00
dsa_gen.c Add FIPS 186-2 DSA parameter generation algorithm. 2013-10-01 14:01:17 +01: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 FIPS 186-2 DSA parameter generation algorithm. 2013-10-01 14:01:17 +01:00
dsa_ossl.c RT3192: spurious error in DSA verify 2014-09-09 17:10:57 -04:00
dsa_pmeth.c Add control to retrieve signature MD. 2013-10-01 14:01:17 +01: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
dsatest.c Remove the dual-callback scheme for numeric and pointer thread IDs, 2008-08-06 15:54:15 +00:00
fips186a.txt
Makefile make depend 2011-09-16 23:15:22 +00:00
README

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.