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

Function modssl_load_store_uri

modules/ssl/ssl_engine_pphrase.c:935–974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933
934#if MODSSL_HAVE_OPENSSL_STORE
935static OSSL_STORE_INFO *modssl_load_store_uri(server_rec *s, apr_pool_t *p,
936 const char *vhostid,
937 const char *uri, int info_type)
938{
939 OSSL_STORE_CTX *sctx;
940 UI_METHOD *ui_method = get_passphrase_ui(p);
941 pphrase_cb_arg_t ppcb;
942 OSSL_STORE_INFO *info = NULL;
943
944 memset(&ppcb, 0, sizeof ppcb);
945 ppcb.s = s;
946 ppcb.p = p;
947 ppcb.bPassPhraseDialogOnce = TRUE;
948 ppcb.key_id = vhostid;
949 ppcb.pkey_file = uri;
950
951 sctx = OSSL_STORE_open(uri, ui_method, &ppcb, NULL, NULL);
952 if (!sctx) {
953 ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(10491)
954 "Init: OSSL_STORE_open failed for PKCS#11 URI `%s'",
955 uri);
956 return NULL;
957 }
958
959 while (!OSSL_STORE_eof(sctx)) {
960 info = OSSL_STORE_load(sctx);
961 if (!info)
962 break;
963
964 if (OSSL_STORE_INFO_get_type(info) == info_type)
965 break;
966
967 OSSL_STORE_INFO_free(info);
968 info = NULL;
969 }
970
971 OSSL_STORE_close(sctx);
972
973 return info;
974}
975
976static apr_status_t modssl_load_keypair_store(server_rec *s, apr_pool_t *p,
977 const char *vhostid,

Callers 1

Calls 2

get_passphrase_uiFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected