summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/evp_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/evp_enc.c')
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c
index a1904993bf..6e582c458d 100644
--- a/src/lib/libcrypto/evp/evp_enc.c
+++ b/src/lib/libcrypto/evp/evp_enc.c
@@ -279,7 +279,12 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
279 { 279 {
280 int i,j,bl; 280 int i,j,bl;
281 281
282 OPENSSL_assert(inl > 0); 282 if (inl <= 0)
283 {
284 *outl = 0;
285 return inl == 0;
286 }
287
283 if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0) 288 if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0)
284 { 289 {
285 if(ctx->cipher->do_cipher(ctx,out,in,inl)) 290 if(ctx->cipher->do_cipher(ctx,out,in,inl))
@@ -381,10 +386,10 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
381 int fix_len; 386 int fix_len;
382 unsigned int b; 387 unsigned int b;
383 388
384 if (inl == 0) 389 if (inl <= 0)
385 { 390 {
386 *outl=0; 391 *outl = 0;
387 return 1; 392 return inl == 0;
388 } 393 }
389 394
390 if (ctx->flags & EVP_CIPH_NO_PADDING) 395 if (ctx->flags & EVP_CIPH_NO_PADDING)