From: William A. Rowe Jr Date: Wed, 27 Feb 2002 19:51:33 +0000 (+0000) Subject: Introduce the PassPhraseDialog 'pipe' mechanism. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a647d7c01a00a0344033cf4972381206a86cfb7;p=apache Introduce the PassPhraseDialog 'pipe' mechanism. This is the directive handling commit only, the mechanics patch will follow. PassPhraseDialog "|/path/to/pipe" will use the bidirectional pipe to have a 'conversation', along the lines of the tty dialog with PassPhraseDialog 'builtin'. This is entirely different than the 'exec' method, which simply runs once for each passphrase, and doesn't allow for failure/retries, and certainly doesn't offer any sensible 'dialog'. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93606 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/mod_ssl.c b/modules/ssl/mod_ssl.c index 0f777a6083..41da040989 100644 --- a/modules/ssl/mod_ssl.c +++ b/modules/ssl/mod_ssl.c @@ -83,7 +83,7 @@ static const command_rec ssl_config_cmds[] = { "(`none', `file:/path/to/file')") SSL_CMD_SRV(PassPhraseDialog, TAKE1, "SSL dialog mechanism for the pass phrase query " - "(`builtin', `exec:/path/to/program')") + "(`builtin', `|/path/to/pipe_program`, or `exec:/path/to/cgi_program')") SSL_CMD_SRV(SessionCache, TAKE1, "SSL Session Cache storage " "(`none', `dbm:/path/to/file')") diff --git a/modules/ssl/mod_ssl.h b/modules/ssl/mod_ssl.h index dcade58072..462693d8f4 100644 --- a/modules/ssl/mod_ssl.h +++ b/modules/ssl/mod_ssl.h @@ -395,7 +395,8 @@ typedef enum { typedef enum { SSL_PPTYPE_UNSET = UNSET, SSL_PPTYPE_BUILTIN = 0, - SSL_PPTYPE_FILTER = 1 + SSL_PPTYPE_FILTER = 1, + SSL_PPTYPE_PIPE = 2 } ssl_pphrase_t; /* @@ -721,7 +722,6 @@ void ssl_scache_shmcb_status(server_rec *, pool *, void (*)(char *, void /* Pass Phrase Support */ void ssl_pphrase_Handle(server_rec *, apr_pool_t *); -int ssl_pphrase_Handle_CB(char *, int, int, void *); /* Diffie-Hellman Parameter Support */ DH *ssl_dh_GetTmpParam(int); diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c index ff062b35bf..c5613da86f 100644 --- a/modules/ssl/ssl_engine_config.c +++ b/modules/ssl/ssl_engine_config.c @@ -334,8 +334,9 @@ const char *ssl_cmd_SSLPassPhraseDialog( SSLSrvConfigRec *sc = mySrvConfig(cmd->server); const char *err; - if ((err = ap_check_cmd_context(cmd, GLOBAL_ONLY)) != NULL) + if ((err = ap_check_cmd_context(cmd, GLOBAL_ONLY)) != NULL) { return err; + } if (strcEQ(arg, "builtin")) { sc->nPassPhraseDialogType = SSL_PPTYPE_BUILTIN; sc->szPassPhraseDialogPath = NULL; @@ -348,6 +349,10 @@ const char *ssl_cmd_SSLPassPhraseDialog( return ((const char *)apr_pstrcat(cmd->pool, "SSLPassPhraseDialog: file '", sc->szPassPhraseDialogPath, "' does not exist",NULL)); } + else if (strlen(arg) > 1 && (arg[0] == '|')) { + sc->nPassPhraseDialogType = SSL_PPTYPE_PIPE; + sc->szPassPhraseDialogPath = arg + 1; + } else return "SSLPassPhraseDialog: Invalid argument"; return NULL;