Commit c47513c2 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  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/modules/ssl@93606 13f79535-47bb-0310-9956-ffa450edef68
parent da9d307a
Loading
Loading
Loading
Loading
+1 −1
Changes for mod_ssl.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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')")
+2 −2
Changes for mod_ssl.h: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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);
+6 −1
Changes for ssl_engine_config.c: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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;