Skip to content

Commit fcaf73d

Browse files
committed
* modules/ssl/ssl_engine_pphrase.c (modssl_load_engine_keypair):
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
1 parent 0e7a32b commit fcaf73d

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

docs/log-message-tags/next-number

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10496
1+
10497

modules/ssl/ssl_engine_pphrase.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -979,22 +979,23 @@ apr_status_t modssl_load_engine_keypair(server_rec *s, apr_pool_t *p,
979979
const char *certid, const char *keyid,
980980
X509 **pubkey, EVP_PKEY **privkey)
981981
{
982-
#if MODSSL_HAVE_OPENSSL_STORE
982+
#if MODSSL_HAVE_ENGINE_API
983983
SSLModConfigRec *mc = myModConfig(s);
984984

985985
/* For OpenSSL 3.x, use the STORE-based API if either ENGINE
986986
* support was not present compile-time, or if it's built but
987987
* SSLCryptoDevice is not configured. */
988-
#if MODSSL_HAVE_ENGINE_API
989-
if (!mc->szCryptoDevice)
988+
if (mc->szCryptoDevice)
989+
return modssl_load_keypair_engine(s, p, vhostid, certid, keyid,
990+
pubkey, privkey);
990991
#endif
991-
return modssl_load_keypair_store(s, p, vhostid, certid, keyid,
992-
pubkey, privkey);
993-
#endif
994-
#if MODSSL_HAVE_ENGINE_API
995-
return modssl_load_keypair_engine(s, p, vhostid, certid, keyid,
996-
pubkey, privkey);
992+
#if MODSSL_HAVE_OPENSSL_STORE
993+
return modssl_load_keypair_store(s, p, vhostid, certid, keyid,
994+
pubkey, privkey);
997995
#else
996+
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10496)
997+
"Init: no method for loading keypair for %s (%s | %s)",
998+
vhostid, certid ? certid : "no cert", keyid);
998999
return APR_ENOTIMPL;
9991000
#endif
10001001
}

0 commit comments

Comments
 (0)