summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_enc.c
diff options
context:
space:
mode:
authorNils Larsch <nils@openssl.org>2005-07-20 22:03:36 +0000
committerNils Larsch <nils@openssl.org>2005-07-20 22:03:36 +0000
commitb554eef43b9ac5b92f590da6a120dbfd9ca0582e (patch)
tree5bd3a0bfcf44361104a71b5f4408ad5d0aafb0f3 /crypto/evp/evp_enc.c
parent0066590f98f0c4447079a325ad15cc9308925532 (diff)
the final byte of a pkcs7 padded plaintext can never be 0
Submitted by: K S Sreeram <sreeram@tachyontech.net>
Diffstat (limited to 'crypto/evp/evp_enc.c')
-rw-r--r--crypto/evp/evp_enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index e845632239..22cb6131be 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -449,7 +449,7 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
}
OPENSSL_assert(b <= sizeof ctx->final);
n=ctx->final[b-1];
- if (n > (int)b)
+ if (n == 0 || n > (int)b)
{
EVPerr(EVP_F_EVP_DECRYPTFINAL_EX,EVP_R_BAD_DECRYPT);
return(0);