X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fevp_enc.c;h=2b62bf64d22b62786212dc0991898e44e8ac9cef;hp=4314b43719f4954ddba0322932f211d771da2cbc;hb=03af843039af758fc9bbb4ae6c09ec2bc715f2c5;hpb=4ad2d3ac0ef338a064c6df3b5437d974def538ba diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 4314b43719..2b62bf64d2 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -524,6 +524,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) {