Make sure we handle input NULL with length 0
authorMatt Caswell <matt@openssl.org>
Wed, 27 Nov 2019 16:06:34 +0000 (16:06 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 29 Nov 2019 10:41:06 +0000 (10:41 +0000)
commit4b9c750be83644aca15a98e75b566e7f6c3644d7
tree82b339cdaa72f764d4000f91acd07fab1a39fa6c
parentcff64af5532d3a1b0e2e9adf88454887efba01b2
Make sure we handle input NULL with length 0

If we call EVP_EncryptUpdate/EVP_DecryptUpdate with length 0 we should
be able to handle it. Most importantly we shouldn't get different
results if we do this compared to if we don't!

An exception is made for CCM mode which has special handling for this in
the low level cipher function.

Fixes #8675

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10530)
providers/common/ciphers/cipher_common.c
providers/common/ciphers/cipher_gcm.c
providers/implementations/ciphers/cipher_aes_ocb.c
providers/implementations/ciphers/cipher_aes_siv.c
providers/implementations/ciphers/cipher_aes_wrp.c
providers/implementations/ciphers/cipher_chacha20_poly1305.c
providers/implementations/ciphers/cipher_tdes_wrap.c