openssl/crypto/ecdsa
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 ECDSA support 2002-02-13 18:21:51 +00:00
ecdsa.h Check fips method flags for ECDH, ECDSA. 2011-06-08 14:01:00 +00:00
ecdsatest.c Fix warning. 2011-12-09 20:15:48 +00:00
ecs_asn1.c hide the definition of ECDSA_METHOD and ECDSA_DATA (and mutatis mutandis 2005-04-29 15:56:06 +00:00
ecs_err.c Check fips method flags for ECDH, ECDSA. 2011-06-08 14:01:00 +00:00
ecs_lib.c Fix EC_KEY initialization race. 2012-10-05 20:51:12 +00:00
ecs_locl.h Check fips method flags for ECDH, ECDSA. 2011-06-08 14:01:00 +00:00
ecs_ossl.c make timing attack protection unconditional 2011-09-01 14:23:22 +00:00
ecs_sign.c Seed PRNG with DSA and ECDSA digests for additional protection against 2009-09-09 12:14:36 +00:00
ecs_vrf.c Fix various certificate fingerprint issues. 2015-01-05 14:36:20 +00:00
Makefile make update 2014-01-06 13:33:27 +00:00