aboutsummaryrefslogtreecommitdiff
path: root/crypto/evp/evp_enc.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2021-12-14 18:30:54 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2021-12-14 18:30:54 +0000
commit56eae1b760adf10835560a9ee595549a1f10410f (patch)
tree3669bea49de5b47517bb53f6d62d7359df20d3a6 /crypto/evp/evp_enc.c
parentc1d1798abd60f12527b70443cb7d0b9cd78ef7b1 (diff)
downloadsrc-56eae1b760adf10835560a9ee595549a1f10410f.tar.gz
src-56eae1b760adf10835560a9ee595549a1f10410f.zip
Import OpenSSL 1.1.1m.vendor/openssl/1.1.1m
Diffstat (limited to 'crypto/evp/evp_enc.c')
-rw-r--r--crypto/evp/evp_enc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index e3c165d48e08..d835968f253c 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -85,7 +85,11 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
* previous check attempted to avoid this if the same ENGINE and
* EVP_CIPHER could be used).
*/
- if (ctx->cipher) {
+ if (ctx->cipher
+#ifndef OPENSSL_NO_ENGINE
+ || ctx->engine
+#endif
+ || ctx->cipher_data) {
unsigned long flags = ctx->flags;
EVP_CIPHER_CTX_reset(ctx);
/* Restore encrypt and flags */
@@ -105,11 +109,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
/* There's an ENGINE for this job ... (apparently) */
const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid);
if (!c) {
- /*
- * One positive side-effect of US's export control history,
- * is that we should at least be able to avoid using US
- * misspellings of "initialisation"?
- */
+ ENGINE_finish(impl);
EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
return 0;
}