diff --git a/library/cipher.c b/library/cipher.c index f0a770aba..bfb229e2f 100644 --- a/library/cipher.c +++ b/library/cipher.c @@ -241,13 +241,13 @@ int cipher_update( cipher_context_t *ctx, const unsigned char *input, size_t ile { int ret; - *olen = 0; - if( NULL == ctx || NULL == ctx->cipher_info || NULL == olen ) { return POLARSSL_ERR_CIPHER_BAD_INPUT_DATA; } + *olen = 0; + if( ctx->cipher_info->mode == POLARSSL_MODE_ECB ) { if( ilen != cipher_get_block_size( ctx ) )