summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_enc.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2019-11-18 10:32:36 +1000
committerPatrick Steuer <patrick.steuer@de.ibm.com>2019-11-25 13:35:43 +0100
commit3c957bcd54d097167e53660fa100aa1ba85d63b5 (patch)
tree2d2f2d3e2fc1106348c8037f5f7e06dd8c10655f /crypto/evp/evp_enc.c
parenta7bdd0433c0360fccb4dd9f5c43c6fabc4e8c659 (diff)
Cache constants for fetched EVP_cipher
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> (Merged from https://github.com/openssl/openssl/pull/10461)
Diffstat (limited to 'crypto/evp/evp_enc.c')
-rw-r--r--crypto/evp/evp_enc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index da6dde0c4d..96eb350623 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -1524,6 +1524,10 @@ EVP_CIPHER *EVP_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
evp_cipher_from_dispatch, evp_cipher_up_ref,
evp_cipher_free);
+ if (cipher != NULL && !evp_cipher_cache_constants(cipher)) {
+ EVP_CIPHER_free(cipher);
+ cipher = NULL;
+ }
return cipher;
}