]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* modules/ssl/ssl_engine_pphrase.c (modssl_load_engine_keypair):
authorJoe Orton <jorton@apache.org>
Thu, 29 Feb 2024 15:28:36 +0000 (15:28 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 29 Feb 2024 15:28:36 +0000 (15:28 +0000)
  Update to avoid GCC warning for no-engine builds where the
  SSLModConfigRec is not used. Also log an error for the ENOTIMPL
  path.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916057 13f79535-47bb-0310-9956-ffa450edef68

docs/log-message-tags/next-number
modules/ssl/ssl_engine_pphrase.c

index 489281b2dd1f0a15d3436993fc85cced1a302eb1..ca9bf0cc1d0b8ee4f33166537d32821171e0dfc8 100644 (file)
@@ -1 +1 @@
-10496
+10497
index 689da3066dcda021af18339636b78d02f555ba4f..5dd6bdda8dd390e8adfe8cdf566e715bcc618bcc 100644 (file)
@@ -979,22 +979,23 @@ apr_status_t modssl_load_engine_keypair(server_rec *s, apr_pool_t *p,
                                         const char *certid, const char *keyid,
                                         X509 **pubkey, EVP_PKEY **privkey)
 {
-#if MODSSL_HAVE_OPENSSL_STORE
+#if MODSSL_HAVE_ENGINE_API 
     SSLModConfigRec *mc = myModConfig(s);
 
     /* For OpenSSL 3.x, use the STORE-based API if either ENGINE
      * support was not present compile-time, or if it's built but
      * SSLCryptoDevice is not configured. */
-#if MODSSL_HAVE_ENGINE_API 
-    if (!mc->szCryptoDevice) 
+    if (mc->szCryptoDevice)
+        return modssl_load_keypair_engine(s, p, vhostid, certid, keyid,
+                                          pubkey, privkey);
 #endif
-        return modssl_load_keypair_store(s, p, vhostid, certid, keyid,
-                                         pubkey, privkey);
-#endif
-#if MODSSL_HAVE_ENGINE_API
-    return modssl_load_keypair_engine(s, p, vhostid, certid, keyid,
-                                      pubkey, privkey);
+#if MODSSL_HAVE_OPENSSL_STORE
+    return modssl_load_keypair_store(s, p, vhostid, certid, keyid,
+                                     pubkey, privkey);
 #else
+    ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10496)
+                 "Init: no method for loading keypair for %s (%s | %s)",
+                 vhostid, certid ? certid : "no cert", keyid);
     return APR_ENOTIMPL;
 #endif
 }