| 1026 | #endif |
| 1027 | |
| 1028 | apr_status_t modssl_load_engine_keypair(server_rec *s, |
| 1029 | apr_pool_t *pconf, apr_pool_t *ptemp, |
| 1030 | const char *vhostid, |
| 1031 | const char *certid, const char *keyid, |
| 1032 | X509 **pubkey, EVP_PKEY **privkey) |
| 1033 | { |
| 1034 | #if MODSSL_HAVE_ENGINE_API |
| 1035 | apr_status_t rv; |
| 1036 | |
| 1037 | rv = modssl_load_keypair_engine(s, pconf, ptemp, |
| 1038 | vhostid, certid, keyid, |
| 1039 | pubkey, privkey); |
| 1040 | if (rv == APR_SUCCESS) { |
| 1041 | return rv; |
| 1042 | } |
| 1043 | /* If STORE support is not present, all errors are fatal here; if |
| 1044 | * STORE is present and the ENGINE could not be loaded, ignore the |
| 1045 | * error and fall through to try loading via the STORE API. */ |
| 1046 | else if (!MODSSL_HAVE_OPENSSL_STORE || rv != APR_ENOTIMPL) { |
| 1047 | return ssl_die(s); |
| 1048 | } |
| 1049 | |
| 1050 | #endif |
| 1051 | #if MODSSL_HAVE_OPENSSL_STORE |
| 1052 | return modssl_load_keypair_store(s, ptemp, vhostid, certid, keyid, |
| 1053 | pubkey, privkey); |
| 1054 | #else |
| 1055 | ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10496) |
| 1056 | "Init: no method for loading keypair for %s (%s | %s)", |
| 1057 | vhostid, certid ? certid : "no cert", keyid); |
| 1058 | return APR_ENOTIMPL; |
| 1059 | #endif |
| 1060 | } |
no test coverage detected