Fix no-engine
authorMatt Caswell <matt@openssl.org>
Thu, 6 Feb 2020 15:54:09 +0000 (15:54 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 7 Feb 2020 23:27:58 +0000 (23:27 +0000)
We don't need to check if an engine has a cipher/digest in a no-engine
build.

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/11031)

ssl/ssl_lib.c

index 977b599055c701a5b91e3a75aa3b6b1c867d6265..08fcd83ea7d125cdd5baba0902f76f9570910a09 100644 (file)
@@ -5848,12 +5848,14 @@ const EVP_CIPHER *ssl_evp_cipher_fetch(OPENSSL_CTX *libctx,
                                        int nid,
                                        const char *properties)
 {
+#ifndef OPENSSL_NO_ENGINE
     /*
      * If there is an Engine available for this cipher we use the "implicit"
      * form to ensure we use that engine later.
      */
     if (ENGINE_get_cipher_engine(nid) != NULL)
         return EVP_get_cipherbynid(nid);
+#endif
 
     /* Otherwise we do an explicit fetch */
     return EVP_CIPHER_fetch(libctx, OBJ_nid2sn(nid), properties);
@@ -5891,12 +5893,14 @@ const EVP_MD *ssl_evp_md_fetch(OPENSSL_CTX *libctx,
                                int nid,
                                const char *properties)
 {
+#ifndef OPENSSL_NO_ENGINE
     /*
      * If there is an Engine available for this digest we use the "implicit"
      * form to ensure we use that engine later.
      */
     if (ENGINE_get_digest_engine(nid) != NULL)
         return EVP_get_digestbynid(nid);
+#endif
 
     /* Otherwise we do an explicit fetch */
     return EVP_MD_fetch(libctx, OBJ_nid2sn(nid), properties);