Don't set ctx->cipher until after a successful fetch
authorMatt Caswell <matt@openssl.org>
Mon, 5 Aug 2019 12:37:05 +0000 (13:37 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 7 Aug 2019 10:40:32 +0000 (11:40 +0100)
commit7f612b1f04ee0cf72d6af292a76f43dd74e88af9
treeab313fbc6d9969295913c9f2c0dc1489eac04028
parente9c116ebcbaf6a0d089a2f8d615eee5be69ab66a
Don't set ctx->cipher until after a successful fetch

If an implict EVP_CIPHER_fetch fails then ctx->cipher should not be set
otherwise strange things will happen when trying to free the ctx.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9531)
crypto/evp/evp_enc.c