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

Function ssl_cmd_SSLPassPhraseDialog

modules/ssl/ssl_engine_config.c:552–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550 */
551
552const char *ssl_cmd_SSLPassPhraseDialog(cmd_parms *cmd,
553 void *dcfg,
554 const char *arg)
555{
556 SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
557 const char *err;
558 int arglen = strlen(arg);
559
560 if ((err = ap_check_cmd_context(cmd, GLOBAL_ONLY))) {
561 return err;
562 }
563
564 if (strcEQ(arg, "builtin")) {
565 sc->server->pphrase_dialog_type = SSL_PPTYPE_BUILTIN;
566 sc->server->pphrase_dialog_path = NULL;
567 }
568 else if ((arglen > 5) && strEQn(arg, "exec:", 5)) {
569 sc->server->pphrase_dialog_type = SSL_PPTYPE_FILTER;
570 sc->server->pphrase_dialog_path =
571 ap_server_root_relative(cmd->pool, arg+5);
572 if (!sc->server->pphrase_dialog_path) {
573 return apr_pstrcat(cmd->pool,
574 "Invalid SSLPassPhraseDialog exec: path ",
575 arg+5, NULL);
576 }
577 if (!ssl_util_path_check(SSL_PCM_EXISTS,
578 sc->server->pphrase_dialog_path,
579 cmd->pool))
580 {
581 return apr_pstrcat(cmd->pool,
582 "SSLPassPhraseDialog: file '",
583 sc->server->pphrase_dialog_path,
584 "' does not exist", NULL);
585 }
586
587 }
588 else if ((arglen > 1) && (arg[0] == '|')) {
589 sc->server->pphrase_dialog_type = SSL_PPTYPE_PIPE;
590 sc->server->pphrase_dialog_path = arg + 1;
591 }
592 else {
593 return "SSLPassPhraseDialog: Invalid argument";
594 }
595
596 return NULL;
597}
598
599const char *ssl_cmd_SSLCryptoDevice(cmd_parms *cmd,
600 void *dcfg,

Callers

nothing calls this directly

Calls 3

ap_check_cmd_contextFunction · 0.85
ap_server_root_relativeFunction · 0.85
ssl_util_path_checkFunction · 0.85

Tested by

no test coverage detected