Add a comment noting the padding oracle.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 03af843039af758fc9bbb4ae6c09ec2bc715f2c5)
This commit is contained in:
Emilia Kasper 2014-12-17 12:25:28 +01:00
parent 0cf552230e
commit 9ca2cc78a9

View File

@ -549,6 +549,11 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
return(0);
}
OPENSSL_assert(b <= sizeof ctx->final);
/*
* The following assumes that the ciphertext has been authenticated.
* Otherwise it provides a padding oracle.
*/
n=ctx->final[b-1];
if (n == 0 || n > (int)b)
{