EVP_CipherInit_ex() merge two code paths
authortb <tb@openbsd.org>
Tue, 26 Dec 2023 08:39:28 +0000 (08:39 +0000)
committertb <tb@openbsd.org>
Tue, 26 Dec 2023 08:39:28 +0000 (08:39 +0000)
commit522874ac1bcf47333cf371da2055e3bdbd8dbd14
tree504bab81599e86c70688d90fe3962b487ea179f4
parent936a262e7549d44f8f559e1367e75d94866ce958
EVP_CipherInit_ex() merge two code paths

Clean up the cipher context unconditionally if the cipher is being set.
This allows doing the dance to retain the key wrap flag only once and
makes it more obvious that allocating the cipher data doesn't leak.

suggested by/ok jsing
lib/libcrypto/evp/evp_enc.c