openssl/crypto/ecdsa
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
ecdsa.h Accessor functions for app_data in ECDSA_METHOD 2014-07-02 00:59:43 +01:00
ecdsatest.c Fix warning. 2011-12-09 20:15:48 +00:00
ecs_asn1.c
ecs_err.c Add functions to set ECDSA_METHOD structure. 2013-09-18 01:23:40 +01:00
ecs_lib.c Accessor functions for app_data in ECDSA_METHOD 2014-07-02 00:59:43 +01:00
ecs_locl.h Accessor functions for app_data in ECDSA_METHOD 2014-07-02 00:59:43 +01:00
ecs_ossl.c Reserve option to use BN_mod_exp_mont_consttime in ECDSA. 2014-09-22 00:07:44 +02:00
ecs_sign.c
ecs_vrf.c Fix various certificate fingerprint issues. 2015-01-05 14:36:06 +00:00
Makefile