mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-28 18:07:34 +08:00
Merge e125fbde0217f369007e92aa3f773d2069c5591a into 03e1438089654fb884ac48e0f3cd0049cfe2c102
This commit is contained in:
commit
f67218f162
9
ChangeLog.d/fix-x509-crl-entry-length-mismatch.txt
Normal file
9
ChangeLog.d/fix-x509-crl-entry-length-mismatch.txt
Normal file
@ -0,0 +1,9 @@
|
||||
Bugfix
|
||||
* Fix x509_get_entries() (used by mbedtls_x509_crl_parse()) not
|
||||
checking that a revoked-certificate entry's serial number,
|
||||
revocation date and optional crlEntryExtensions fully consume
|
||||
the entry's own declared SEQUENCE length. A CRL entry with a
|
||||
declared length longer than the sum of its actual fields could
|
||||
have the extra trailing bytes silently reinterpreted as one or
|
||||
more additional, attacker-influenced CRL entries, instead of
|
||||
being rejected as malformed.
|
||||
@ -262,6 +262,11 @@ static int x509_get_entries(unsigned char **p,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (*p != end2) {
|
||||
return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT,
|
||||
MBEDTLS_ERR_ASN1_LENGTH_MISMATCH);
|
||||
}
|
||||
|
||||
if (*p < end) {
|
||||
cur_entry->next = mbedtls_calloc(1, sizeof(mbedtls_x509_crl_entry));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user