]> granicus.if.org Git - apache/commitdiff
Introduce the PassPhraseDialog 'pipe' mechanism.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 27 Feb 2002 19:51:33 +0000 (19:51 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 27 Feb 2002 19:51:33 +0000 (19:51 +0000)
  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

modules/ssl/mod_ssl.c
modules/ssl/mod_ssl.h
modules/ssl/ssl_engine_config.c

index 0f777a6083b95285bed72063ac79575f23f2603d..41da04098980fd06c0fa72b6ad85b1f6d4ab678f 100644 (file)
@@ -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')")
index dcade58072817e2b1ec0253e4b5dd2754de85eed..462693d8f4011b38e01331ef2c8cb6ef9975ae20 100644 (file)
@@ -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);
index ff062b35bfd830e3bb66c89ea285ff0a854caeb1..c5613da86f9b5b395178cdd0349c7cf65e1b8260 100644 (file)
@@ -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;