MCPcopy Create free account
hub / github.com/apache/httpd / modssl_load_keypair_store

Function modssl_load_keypair_store

modules/ssl/ssl_engine_pphrase.c:976–1025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

974}
975
976static apr_status_t modssl_load_keypair_store(server_rec *s, apr_pool_t *p,
977 const char *vhostid,
978 const char *certid,
979 const char *keyid,
980 X509 **pubkey,
981 EVP_PKEY **privkey)
982{
983 OSSL_STORE_INFO *info = NULL;
984
985 *privkey = NULL;
986 *pubkey = NULL;
987
988 info = modssl_load_store_uri(s, p, vhostid, keyid, OSSL_STORE_INFO_PKEY);
989 if (!info) {
990 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10492)
991 "Init: OSSL_STORE_INFO_PKEY lookup failed for private key identifier `%s'",
992 keyid);
993 return ssl_die(s);
994 }
995
996 *privkey = OSSL_STORE_INFO_get1_PKEY(info);
997 OSSL_STORE_INFO_free(info);
998 if (!*privkey) {
999 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10493)
1000 "Init: OSSL_STORE_INFO_PKEY lookup failed for private key identifier `%s'",
1001 keyid);
1002 return ssl_die(s);
1003 }
1004
1005 if (certid) {
1006 info = modssl_load_store_uri(s, p, vhostid, certid, OSSL_STORE_INFO_CERT);
1007 if (!info) {
1008 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10494)
1009 "Init: OSSL_STORE_INFO_CERT lookup failed for certificate identifier `%s'",
1010 keyid);
1011 return ssl_die(s);
1012 }
1013
1014 *pubkey = OSSL_STORE_INFO_get1_CERT(info);
1015 OSSL_STORE_INFO_free(info);
1016 if (!*pubkey) {
1017 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10495)
1018 "Init: OSSL_STORE_INFO_CERT lookup failed for certificate identifier `%s'",
1019 certid);
1020 return ssl_die(s);
1021 }
1022 }
1023
1024 return APR_SUCCESS;
1025}
1026#endif
1027
1028apr_status_t modssl_load_engine_keypair(server_rec *s,

Callers 1

Calls 3

modssl_load_store_uriFunction · 0.85
ssl_dieFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected