Sanity check record length before skipping explicit IV in TLS 1.2, 1.1 and

DTLS to fix DoS attack.

Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
fuzzing as a service testing platform.
(CVE-2012-2333)
This commit is contained in:
Dr. Stephen Henson
2012-05-10 16:03:52 +00:00
parent 7388b43cae
commit c46ecc3a55
3 changed files with 11 additions and 1 deletions

View File

@@ -889,6 +889,8 @@ int tls1_enc(SSL *s, int send)
if (s->version >= TLS1_1_VERSION
&& EVP_CIPHER_CTX_mode(ds) == EVP_CIPH_CBC_MODE)
{
if (bs > (int)rec->length)
return -1;
rec->data += bs; /* skip the explicit IV */
rec->input += bs;
rec->length -= bs;