chacha20: Properly reinitialize the cipher context with NULL key
authorTomas Mraz <tmraz@fedoraproject.org>
Tue, 12 Jan 2021 15:53:33 +0000 (16:53 +0100)
committerTomas Mraz <tmraz@fedoraproject.org>
Wed, 13 Jan 2021 17:04:28 +0000 (18:04 +0100)
commit8bc5b0a570c8a2c9886a3cae9dea2016d510578d
treeb6bc6585b820c310478687eb38357948960cfa2f
parent2ed63033e46953d0d95ff100c1334da7cc32c49b
chacha20: Properly reinitialize the cipher context with NULL key

Same for chacha20-poly1305.

The test_cipher_reinit and test_cipher_reinit_partialupdate is modified
to test this case of cipher context reinitialization.

Fixes #13064

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13850)
providers/implementations/ciphers/cipher_chacha20_hw.c
providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c
test/evp_libctx_test.c