[Gpg4win-devel] New gpg-connect-agent

Werner Koch wk at gnupg.org
Fri Oct 19 18:33:46 CEST 2007


Hi,

I added a couple of features to gpg-connect-agent (available in current
SVN) to support testing of Assuan based servers.  There is also readline
support now.  The /slet command is still available but should be
replaced by the variable function feature.  Instead of

  /slet foo cwd
  /echo Current directory is ${foo}

You may now just write

  /echo Current directory is ${get cwd}

There are also escape functions to fit protocol requirements:

  /let desc ${unescape Directory is:\n->${get cwd}<-}
  GET_PASSPHRASE X X prompt ${percent+ $desc}

Instead of using "/subst" in the script, you may also use the command
line option --subst now.  What I still have in mind is to allow
processing of status lines.

Here is the list of all control commands:

7.8.2 Control commands.
-----------------------

While reading Assuan commands, gpg-agent also allows a few special
commands to control its operation.  These control commands all start
with a slash (`/').

`/echo ARGS'
     Just print ARGS.

`/let NAME VALUE'
     Set the variable NAME to VALUE.  Variables are only substituted on
     the input if the `/subst' has been used.  Variables are referenced
     by prefixing the name with a dollr sign and optionally include the
     name in curly braces.  The rules for a valid name are idnetically
     to those of the standard bourne shell.  This is not yet enforced
     but may be in the future.  When used with curly braces no leading
     or trailing white space is allowed.

     If a variable is not found, it is searched in the environment and
     if found copied to the table of variables.

     Variable functions are available: The name of the function must be
     followed by at least one space and the at least one argument.  The
     following functions are available:

    `get'
          Return a value described by the argument.  Available
          arguments are:

         `cwd'
               The current working directory.

         `homedir'
               The gnupg homedir.

         `sysconfdir'
               GnuPG's system configuration directory.

         `bindir'
               GnuPG's binary directory.

         `libdir'
               GnuPG's library directory.

         `libexecdir'
               GnuPG's library directory for executable files.

         `datadir'
               GnuPG's data directory.

         `serverpid'
               The PID of the current server. Command `/serverpid' must
               have been given to return a useful value.

    `unescape ARGS'
          Remove C-style escapes from ARGS.  Note that `\0' and `\x00'
          terminate the returned string implictly.  The string to be
          converted are the entire arguments right behind the
          delimiting space of the function name.

    `unpercent ARGS'
    `unpercent+ ARGS'
          Remove percent style ecaping from ARGS.  Note that `%00'
          terminates the string implicitly.  The string to be converted
          are the entire arguments right behind the delimiting space of
          the function name. `unpercent+' also maps plus signs to a
          spaces.

    `percent ARGS'
    `percent+ ARGS'
          Escape the ARGS using percent style ecaping.  Tabs, formfeeds,
          linefeeds, carriage returns and colons are escaped.
          `percent+' also maps spaces to plus signs.


`/definq NAME VAR'
     Use content of the variable VAR for inquiries with NAME.  NAME may
     be an asterisk (`*') to match any inquiry.

`/definqfile NAME FILE'
     Use content of FILE for inquiries with NAME.  NAME may be an
     asterisk (`*') to match any inquiry.

`/definqprog NAME PROG'
     Run PROG for inquiries matching NAME and pass the entire line to
     it as command line arguments.

`/showdef'
     Print all definitions

`/cleardef'
     Delete all definitions

`/sendfd FILE MODE'
     Open FILE in MODE (which needs to be a valid `fopen' mode string)
     and send the file descriptor to the server.  This is usually
     followed by a command like `INPUT FD' to set the input source for
     other commands.

`/recvfd'
     Not yet implemented.

`/open VAR FILE [MODE]'
     Open FILE and assign the file descriptor to VAR.  Warning: This
     command is experimental and might change in future versions.

`/close FD'
     Close the file descriptor FD.  Warning: This command is
     experimental and might change in future versions.

`/showopen'
     Show a listy of open files.

`/serverpid'
     Send the Assuan command `GETINFO pid' to the server and store the
     returned PID for internal purposes.

`/hex'
`/nohex'
     Same as the command line option `--hex'.

`/decode'
`/nodecode'
     Same as the command line option `--decode'.

`/subst'
`/nosubst'
     Enable and disable variable substitution.  It defaults to disabled
     unless the command line option `--subst' has been used.

`/run FILE'
     Run commands from FILE.

`/bye'
     Terminate the connection and the program

`/help'
     Print a list of available control commands.




Salam-Shalom,

   Werner



-- 
Die Gedanken sind frei.  Auschnahme regelt ein Bundeschgesetz.




More information about the Gpg4win-devel mailing list