ca9a538aa0
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 (Imported from upstream's 85cfc188c06bd046420ae70dd6e302f9efe022a9 and 4c52816d35681c0533c25fdd3abb4b7c6962302d) Change-Id: Ic901aea8ea6457df27dc542a11c30464561e322b Reviewed-on: https://boringssl-review.googlesource.com/2783 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com> |
||
---|---|---|
.. | ||
a_digest.c | ||
a_sign.c | ||
a_strex.c | ||
a_verify.c | ||
asn1_gen.c | ||
by_dir.c | ||
by_file.c | ||
charmap.h | ||
CMakeLists.txt | ||
i2d_pr.c | ||
pkcs7_test.c | ||
pkcs7.c | ||
t_crl.c | ||
t_x509.c | ||
t_x509a.c | ||
vpm_int.h | ||
x509_att.c | ||
x509_cmp.c | ||
x509_d2.c | ||
x509_def.c | ||
x509_error.c | ||
x509_ext.c | ||
x509_lu.c | ||
x509_obj.c | ||
x509_r2x.c | ||
x509_req.c | ||
x509_set.c | ||
x509_trs.c | ||
x509_txt.c | ||
x509_v3.c | ||
x509_vfy.c | ||
x509_vpm.c | ||
x509.c | ||
x509cset.c | ||
x509name.c | ||
x509rset.c | ||
x509spki.c | ||
x509type.c | ||
x_algor.c | ||
x_all.c | ||
x_attrib.c | ||
x_crl.c | ||
x_exten.c | ||
x_info.c | ||
x_name.c | ||
x_pkey.c | ||
x_pubkey.c | ||
x_req.c | ||
x_sig.c | ||
x_spki.c | ||
x_val.c | ||
x_x509.c | ||
x_x509a.c |