summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-09-15 22:32:23 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-09-15 22:32:23 +0000
commitf947b818bf573c231c6b8a98a06902f8a0b78d08 (patch)
treed70f5129fddd2a1498dc2d63184948c51a8e4e09 /crypto/evp
parent3fa1a444ce3b6fbe70f501b7352153a785cdf97a (diff)
Oops, restore change that got reverted accidentally.
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/evp_enc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index 304ce7ea68..30e0ca4d9f 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -143,7 +143,12 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
{
int i,j,bl;
- OPENSSL_assert(inl > 0);
+ if (inl <= 0)
+ {
+ *outl = 0;
+ return inl == 0;
+ }
+
if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0)
{
if(M_do_cipher(ctx,out,in,inl))
@@ -245,10 +250,10 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
int fix_len;
unsigned int b;
- if (inl == 0)
+ if (inl <= 0)
{
- *outl=0;
- return 1;
+ *outl = 0;
+ return inl == 0;
}
if (ctx->flags & EVP_CIPH_NO_PADDING)