mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-13 22:21:09 +02:00
Add help strings for all commands.
This commit is contained in:
parent
090c402430
commit
0781afbd9e
@ -1,7 +1,8 @@
|
|||||||
2009-11-04 Werner Koch <wk@g10code.com>
|
2009-11-04 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* command.c (register_commands): Add NULL arg to
|
* command.c (register_commands): Add help arg to
|
||||||
assuan_register_command.
|
assuan_register_command. Convert all command comments to help
|
||||||
|
strings.
|
||||||
|
|
||||||
2009-11-02 Marcus Brinkmann <marcus@g10code.de>
|
2009-11-02 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
501
agent/command.c
501
agent/command.c
@ -264,7 +264,7 @@ static int
|
|||||||
parse_keygrip (assuan_context_t ctx, const char *string, unsigned char *buf)
|
parse_keygrip (assuan_context_t ctx, const char *string, unsigned char *buf)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
size_t n;
|
size_t n = 0;
|
||||||
|
|
||||||
rc = parse_hexstring (ctx, string, &n);
|
rc = parse_hexstring (ctx, string, &n);
|
||||||
if (rc)
|
if (rc)
|
||||||
@ -343,19 +343,19 @@ agent_inq_pinentry_launched (ctrl_t ctrl, unsigned long pid)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* GETEVENTCOUNTER
|
static const char hlp_geteventcounter[] =
|
||||||
|
"GETEVENTCOUNTER\n"
|
||||||
Return a a status line named EVENTCOUNTER with the current values
|
"\n"
|
||||||
of all event counters. The values are decimal numbers in the range
|
"Return a a status line named EVENTCOUNTER with the current values\n"
|
||||||
0 to UINT_MAX and wrapping around to 0. The actual values should
|
"of all event counters. The values are decimal numbers in the range\n"
|
||||||
not be relied upon, they shall only be used to detect a change.
|
"0 to UINT_MAX and wrapping around to 0. The actual values should\n"
|
||||||
|
"not be relied upon, they shall only be used to detect a change.\n"
|
||||||
The currently defined counters are:
|
"\n"
|
||||||
|
"The currently defined counters are:\n"
|
||||||
ANY - Incremented with any change of any of the other counters.
|
"\n"
|
||||||
KEY - Incremented for added or removed private keys.
|
"ANY - Incremented with any change of any of the other counters.\n"
|
||||||
CARD - Incremented for changes of the card readers stati.
|
"KEY - Incremented for added or removed private keys.\n"
|
||||||
*/
|
"CARD - Incremented for changes of the card readers stati.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_geteventcounter (assuan_context_t ctx, char *line)
|
cmd_geteventcounter (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -401,10 +401,11 @@ bump_card_eventcounter (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ISTRUSTED <hexstring_with_fingerprint>
|
static const char hlp_istrusted[] =
|
||||||
|
"ISTRUSTED <hexstring_with_fingerprint>\n"
|
||||||
Return OK when we have an entry with this fingerprint in our
|
"\n"
|
||||||
trustlist */
|
"Return OK when we have an entry with this fingerprint in our\n"
|
||||||
|
"trustlist";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_istrusted (assuan_context_t ctx, char *line)
|
cmd_istrusted (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -439,9 +440,11 @@ cmd_istrusted (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LISTTRUSTED
|
|
||||||
|
|
||||||
List all entries from the trustlist */
|
static const char hlp_listtrusted[] =
|
||||||
|
"LISTTRUSTED\n"
|
||||||
|
"\n"
|
||||||
|
"List all entries from the trustlist.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_listtrusted (assuan_context_t ctx, char *line)
|
cmd_listtrusted (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -456,9 +459,10 @@ cmd_listtrusted (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* MARKTRUSTED <hexstring_with_fingerprint> <flag> <display_name>
|
static const char hlp_martrusted[] =
|
||||||
|
"MARKTRUSTED <hexstring_with_fingerprint> <flag> <display_name>\n"
|
||||||
Store a new key in into the trustlist*/
|
"\n"
|
||||||
|
"Store a new key in into the trustlist.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_marktrusted (assuan_context_t ctx, char *line)
|
cmd_marktrusted (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -500,9 +504,10 @@ cmd_marktrusted (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* HAVEKEY <hexstring_with_keygrip>
|
static const char hlp_havekey[] =
|
||||||
|
"HAVEKEY <hexstring_with_keygrip>\n"
|
||||||
Return success when the secret key is available */
|
"\n"
|
||||||
|
"Return success when the secret key is available.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_havekey (assuan_context_t ctx, char *line)
|
cmd_havekey (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -520,10 +525,11 @@ cmd_havekey (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* SIGKEY <hexstring_with_keygrip>
|
static const char hlp_sigkey[] =
|
||||||
SETKEY <hexstring_with_keygrip>
|
"SIGKEY <hexstring_with_keygrip>\n"
|
||||||
|
"SETKEY <hexstring_with_keygrip>\n"
|
||||||
Set the key used for a sign or decrypt operation */
|
"\n"
|
||||||
|
"Set the key used for a sign or decrypt operation.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_sigkey (assuan_context_t ctx, char *line)
|
cmd_sigkey (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -538,20 +544,20 @@ cmd_sigkey (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* SETKEYDESC plus_percent_escaped_string
|
static const char hlp_setkeydesc[] =
|
||||||
|
"SETKEYDESC plus_percent_escaped_string\n"
|
||||||
Set a description to be used for the next PKSIGN or PKDECRYPT
|
"\n"
|
||||||
operation if this operation requires the entry of a passphrase. If
|
"Set a description to be used for the next PKSIGN or PKDECRYPT\n"
|
||||||
this command is not used a default text will be used. Note, that
|
"operation if this operation requires the entry of a passphrase. If\n"
|
||||||
this description implictly selects the label used for the entry
|
"this command is not used a default text will be used. Note, that\n"
|
||||||
box; if the string contains the string PIN (which in general will
|
"this description implictly selects the label used for the entry\n"
|
||||||
not be translated), "PIN" is used, otherwise the translation of
|
"box; if the string contains the string PIN (which in general will\n"
|
||||||
"passphrase" is used. The description string should not contain
|
"not be translated), \"PIN\" is used, otherwise the translation of\n"
|
||||||
blanks unless they are percent or '+' escaped.
|
"\"passphrase\" is used. The description string should not contain\n"
|
||||||
|
"blanks unless they are percent or '+' escaped.\n"
|
||||||
The description is only valid for the next PKSIGN or PKDECRYPT
|
"\n"
|
||||||
operation.
|
"The description is only valid for the next PKSIGN or PKDECRYPT\n"
|
||||||
*/
|
"operation.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_setkeydesc (assuan_context_t ctx, char *line)
|
cmd_setkeydesc (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -582,10 +588,11 @@ cmd_setkeydesc (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* SETHASH --hash=<name>|<algonumber> <hexstring>
|
static const char hlp_sethash[] =
|
||||||
|
"SETHASH --hash=<name>|<algonumber> <hexstring>\n"
|
||||||
The client can use this command to tell the server about the data
|
"\n"
|
||||||
(which usually is a hash) to be signed. */
|
"The client can use this command to tell the server about the data\n"
|
||||||
|
"(which usually is a hash) to be signed.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_sethash (assuan_context_t ctx, char *line)
|
cmd_sethash (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -637,6 +644,7 @@ cmd_sethash (assuan_context_t ctx, char *line)
|
|||||||
ctrl->digest.algo = algo;
|
ctrl->digest.algo = algo;
|
||||||
|
|
||||||
/* Parse the hash value. */
|
/* Parse the hash value. */
|
||||||
|
n = 0;
|
||||||
rc = parse_hexstring (ctx, line, &n);
|
rc = parse_hexstring (ctx, line, &n);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
@ -660,10 +668,11 @@ cmd_sethash (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* PKSIGN <options>
|
static const char hlp_pksign[] =
|
||||||
|
"PKSIGN [options]\n"
|
||||||
Perform the actual sign operation. Neither input nor output are
|
"\n"
|
||||||
sensitive to eavesdropping. */
|
"Perform the actual sign operation. Neither input nor output are\n"
|
||||||
|
"sensitive to eavesdropping.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_pksign (assuan_context_t ctx, char *line)
|
cmd_pksign (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -694,10 +703,12 @@ cmd_pksign (assuan_context_t ctx, char *line)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PKDECRYPT <options>
|
|
||||||
|
|
||||||
Perform the actual decrypt operation. Input is not
|
static const char hlp_pkdecrypt[] =
|
||||||
sensitive to eavesdropping */
|
"PKDECRYPT <options>\n"
|
||||||
|
"\n"
|
||||||
|
"Perform the actual decrypt operation. Input is not\n"
|
||||||
|
"sensitive to eavesdropping.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_pkdecrypt (assuan_context_t ctx, char *line)
|
cmd_pkdecrypt (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -732,20 +743,20 @@ cmd_pkdecrypt (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* GENKEY
|
static const char hlp_genkey[] =
|
||||||
|
"GENKEY\n"
|
||||||
Generate a new key, store the secret part and return the public
|
"\n"
|
||||||
part. Here is an example transaction:
|
"Generate a new key, store the secret part and return the public\n"
|
||||||
|
"part. Here is an example transaction:\n"
|
||||||
C: GENKEY
|
"\n"
|
||||||
S: INQUIRE KEYPARAM
|
" C: GENKEY\n"
|
||||||
C: D (genkey (rsa (nbits 1024)))
|
" S: INQUIRE KEYPARAM\n"
|
||||||
C: END
|
" C: D (genkey (rsa (nbits 1024)))\n"
|
||||||
S: D (public-key
|
" C: END\n"
|
||||||
S: D (rsa (n 326487324683264) (e 10001)))
|
" S: D (public-key\n"
|
||||||
S OK key created
|
" S: D (rsa (n 326487324683264) (e 10001)))\n"
|
||||||
*/
|
" S: OK key created\n"
|
||||||
|
"\n";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_genkey (assuan_context_t ctx, char *line)
|
cmd_genkey (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -778,9 +789,10 @@ cmd_genkey (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* READKEY <hexstring_with_keygrip>
|
static const char hlp_readkey[] =
|
||||||
|
"READKEY <hexstring_with_keygrip>\n"
|
||||||
Return the public key for the given keygrip. */
|
"\n"
|
||||||
|
"Return the public key for the given keygrip.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_readkey (assuan_context_t ctx, char *line)
|
cmd_readkey (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -821,32 +833,32 @@ cmd_readkey (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* KEYINFO [--list] <keygrip>
|
static const char hlp_keyinfo[] =
|
||||||
|
"KEYINFO [--list] <keygrip>\n"
|
||||||
Return information about the key specified by the KEYGRIP. If the
|
"\n"
|
||||||
key is not available GPG_ERR_NOT_FOUND is returned. If the option
|
"Return information about the key specified by the KEYGRIP. If the\n"
|
||||||
--list is given the keygrip is ignored and information about all
|
"key is not available GPG_ERR_NOT_FOUND is returned. If the option\n"
|
||||||
available keys are returned. The information is returned as a
|
"--list is given the keygrip is ignored and information about all\n"
|
||||||
status line with this format:
|
"available keys are returned. The information is returned as a\n"
|
||||||
|
"status line with this format:\n"
|
||||||
KEYINFO <keygrip> <type> <serialno> <idstr>
|
"\n"
|
||||||
|
" KEYINFO <keygrip> <type> <serialno> <idstr>\n"
|
||||||
KEYGRIP is the keygrip.
|
"\n"
|
||||||
|
"KEYGRIP is the keygrip.\n"
|
||||||
TYPE is describes the type of the key:
|
"\n"
|
||||||
'D' - Regular key stored on disk,
|
"TYPE is describes the type of the key:\n"
|
||||||
'T' - Key is stored on a smartcard (token).
|
" 'D' - Regular key stored on disk,\n"
|
||||||
'-' - Unknown type.
|
" 'T' - Key is stored on a smartcard (token).\n"
|
||||||
|
" '-' - Unknown type.\n"
|
||||||
SERIALNO is an ASCII string with the serial number of the
|
"\n"
|
||||||
smartcard. If the serial number is not known a single
|
"SERIALNO is an ASCII string with the serial number of the\n"
|
||||||
dash '-' is used instead.
|
" smartcard. If the serial number is not known a single\n"
|
||||||
|
" dash '-' is used instead.\n"
|
||||||
IDSTR is the IDSTR used to distinguish keys on a smartcard. If it
|
"\n"
|
||||||
is not known a dash is used instead.
|
"IDSTR is the IDSTR used to distinguish keys on a smartcard. If it\n"
|
||||||
|
" is not known a dash is used instead.\n"
|
||||||
More information may be added in the future.
|
"\n"
|
||||||
*/
|
"More information may be added in the future.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip)
|
do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip)
|
||||||
{
|
{
|
||||||
@ -988,34 +1000,33 @@ send_back_passphrase (assuan_context_t ctx, int via_data, const char *pw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* GET_PASSPHRASE [--data] [--check] [--no-ask] [--repeat[=N]]
|
static const char hlp_get_passphrase[] =
|
||||||
[--qualitybar] <cache_id>
|
"GET_PASSPHRASE [--data] [--check] [--no-ask] [--repeat[=N]]\n"
|
||||||
[<error_message> <prompt> <description>]
|
" [--qualitybar] <cache_id>\n"
|
||||||
|
" [<error_message> <prompt> <description>]\n"
|
||||||
This function is usually used to ask for a passphrase to be used
|
"\n"
|
||||||
for conventional encryption, but may also be used by programs which
|
"This function is usually used to ask for a passphrase to be used\n"
|
||||||
need specal handling of passphrases. This command uses a syntax
|
"for conventional encryption, but may also be used by programs which\n"
|
||||||
which helps clients to use the agent with minimum effort. The
|
"need specal handling of passphrases. This command uses a syntax\n"
|
||||||
agent either returns with an error or with a OK followed by the hex
|
"which helps clients to use the agent with minimum effort. The\n"
|
||||||
encoded passphrase. Note that the length of the strings is
|
"agent either returns with an error or with a OK followed by the hex\n"
|
||||||
implicitly limited by the maximum length of a command.
|
"encoded passphrase. Note that the length of the strings is\n"
|
||||||
|
"implicitly limited by the maximum length of a command.\n"
|
||||||
If the option "--data" is used the passphrase is returned by usual
|
"\n"
|
||||||
data lines and not on the okay line.
|
"If the option \"--data\" is used the passphrase is returned by usual\n"
|
||||||
|
"data lines and not on the okay line.\n"
|
||||||
If the option "--check" is used the passphrase constraints checks as
|
"\n"
|
||||||
implemented by gpg-agent are applied. A check is not done if the
|
"If the option \"--check\" is used the passphrase constraints checks as\n"
|
||||||
passphrase has been found in the cache.
|
"implemented by gpg-agent are applied. A check is not done if the\n"
|
||||||
|
"passphrase has been found in the cache.\n"
|
||||||
If the option "--no-ask" is used and the passphrase is not in the
|
"\n"
|
||||||
cache the user will not be asked to enter a passphrase but the error
|
"If the option \"--no-ask\" is used and the passphrase is not in the\n"
|
||||||
code GPG_ERR_NO_DATA is returned.
|
"cache the user will not be asked to enter a passphrase but the error\n"
|
||||||
|
"code GPG_ERR_NO_DATA is returned. \n"
|
||||||
If the option "--qualitybar" is used a visual indication of the
|
"\n"
|
||||||
entered passphrase quality is shown. (Unless no minimum passphrase
|
"If the option \"--qualitybar\" is used a visual indication of the\n"
|
||||||
length has been configured.)
|
"entered passphrase quality is shown. (Unless no minimum passphrase\n"
|
||||||
*/
|
"length has been configured.)";
|
||||||
|
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_get_passphrase (assuan_context_t ctx, char *line)
|
cmd_get_passphrase (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1163,12 +1174,11 @@ cmd_get_passphrase (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* CLEAR_PASSPHRASE <cache_id>
|
static const char hlp_clear_passphrase[] =
|
||||||
|
"CLEAR_PASSPHRASE <cache_id>\n"
|
||||||
may be used to invalidate the cache entry for a passphrase. The
|
"\n"
|
||||||
function returns with OK even when there is no cached passphrase.
|
"may be used to invalidate the cache entry for a passphrase. The\n"
|
||||||
*/
|
"function returns with OK even when there is no cached passphrase.";
|
||||||
|
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_clear_passphrase (assuan_context_t ctx, char *line)
|
cmd_clear_passphrase (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1190,18 +1200,17 @@ cmd_clear_passphrase (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* GET_CONFIRMATION <description>
|
static const char hlp_get_confirmation[] =
|
||||||
|
"GET_CONFIRMATION <description>\n"
|
||||||
This command may be used to ask for a simple confirmation.
|
"\n"
|
||||||
DESCRIPTION is displayed along with a Okay and Cancel button. This
|
"This command may be used to ask for a simple confirmation.\n"
|
||||||
command uses a syntax which helps clients to use the agent with
|
"DESCRIPTION is displayed along with a Okay and Cancel button. This\n"
|
||||||
minimum effort. The agent either returns with an error or with a
|
"command uses a syntax which helps clients to use the agent with\n"
|
||||||
OK. Note, that the length of DESCRIPTION is implicitly limited by
|
"minimum effort. The agent either returns with an error or with a\n"
|
||||||
the maximum length of a command. DESCRIPTION should not contain
|
"OK. Note, that the length of DESCRIPTION is implicitly limited by\n"
|
||||||
any spaces, those must be encoded either percent escaped or simply
|
"the maximum length of a command. DESCRIPTION should not contain\n"
|
||||||
as '+'.
|
"any spaces, those must be encoded either percent escaped or simply\n"
|
||||||
*/
|
"as '+'.";
|
||||||
|
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_get_confirmation (assuan_context_t ctx, char *line)
|
cmd_get_confirmation (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1239,10 +1248,11 @@ cmd_get_confirmation (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* LEARN [--send]
|
static const char hlp_learn[] =
|
||||||
|
"LEARN [--send]\n"
|
||||||
Learn something about the currently inserted smartcard. With
|
"\n"
|
||||||
--send the new certificates are send back. */
|
"Learn something about the currently inserted smartcard. With\n"
|
||||||
|
"--send the new certificates are send back.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_learn (assuan_context_t ctx, char *line)
|
cmd_learn (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1257,9 +1267,10 @@ cmd_learn (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* PASSWD <hexstring_with_keygrip>
|
static const char hlp_passwd[] =
|
||||||
|
"PASSWD <hexstring_with_keygrip>\n"
|
||||||
Change the passphrase/PIN for the key identified by keygrip in LINE. */
|
"\n"
|
||||||
|
"Change the passphrase/PIN for the key identified by keygrip in LINE.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_passwd (assuan_context_t ctx, char *line)
|
cmd_passwd (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1299,13 +1310,15 @@ cmd_passwd (assuan_context_t ctx, char *line)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PRESET_PASSPHRASE <string_or_keygrip> <timeout> <hexstring>
|
|
||||||
|
static const char hlp_preset_passphrase[] =
|
||||||
Set the cached passphrase/PIN for the key identified by the keygrip
|
"PRESET_PASSPHRASE <string_or_keygrip> <timeout> <hexstring>\n"
|
||||||
to passwd for the given time, where -1 means infinite and 0 means
|
"\n"
|
||||||
the default (currently only a timeout of -1 is allowed, which means
|
"Set the cached passphrase/PIN for the key identified by the keygrip\n"
|
||||||
to never expire it). If passwd is not provided, ask for it via the
|
"to passwd for the given time, where -1 means infinite and 0 means\n"
|
||||||
pinentry module. */
|
"the default (currently only a timeout of -1 is allowed, which means\n"
|
||||||
|
"to never expire it). If passwd is not provided, ask for it via the\n"
|
||||||
|
"pinentry module.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_preset_passphrase (assuan_context_t ctx, char *line)
|
cmd_preset_passphrase (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1338,6 +1351,7 @@ cmd_preset_passphrase (assuan_context_t ctx, char *line)
|
|||||||
line++;
|
line++;
|
||||||
|
|
||||||
/* Syntax check the hexstring. */
|
/* Syntax check the hexstring. */
|
||||||
|
len = 0;
|
||||||
rc = parse_hexstring (ctx, line, &len);
|
rc = parse_hexstring (ctx, line, &len);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
@ -1364,11 +1378,13 @@ cmd_preset_passphrase (assuan_context_t ctx, char *line)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* SCD <commands to pass to the scdaemon>
|
static const char hlp_scd[] =
|
||||||
|
"SCD <commands to pass to the scdaemon>\n"
|
||||||
This is a general quote command to redirect everything to the
|
" \n"
|
||||||
SCDAEMON. */
|
"This is a general quote command to redirect everything to the\n"
|
||||||
|
"SCdaemon.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_scd (assuan_context_t ctx, char *line)
|
cmd_scd (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1382,11 +1398,11 @@ cmd_scd (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* GETVAL <key>
|
static const char hlp_getval[] =
|
||||||
|
"GETVAL <key>\n"
|
||||||
Return the value for KEY from the special environment as created by
|
"\n"
|
||||||
PUTVAL.
|
"Return the value for KEY from the special environment as created by\n"
|
||||||
*/
|
"PUTVAL.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_getval (assuan_context_t ctx, char *line)
|
cmd_getval (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1426,24 +1442,24 @@ cmd_getval (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* PUTVAL <key> [<percent_escaped_value>]
|
static const char hlp_putval[] =
|
||||||
|
"PUTVAL <key> [<percent_escaped_value>]\n"
|
||||||
The gpg-agent maintains a kind of environment which may be used to
|
"\n"
|
||||||
store key/value pairs in it, so that they can be retrieved later.
|
"The gpg-agent maintains a kind of environment which may be used to\n"
|
||||||
This may be used by helper daemons to daemonize themself on
|
"store key/value pairs in it, so that they can be retrieved later.\n"
|
||||||
invocation and register them with gpg-agent. Callers of the
|
"This may be used by helper daemons to daemonize themself on\n"
|
||||||
daemon's service may now first try connect to get the information
|
"invocation and register them with gpg-agent. Callers of the\n"
|
||||||
for that service from gpg-agent through the GETVAL command and then
|
"daemon's service may now first try connect to get the information\n"
|
||||||
try to connect to that daemon. Only if that fails they may start
|
"for that service from gpg-agent through the GETVAL command and then\n"
|
||||||
an own instance of the service daemon.
|
"try to connect to that daemon. Only if that fails they may start\n"
|
||||||
|
"an own instance of the service daemon. \n"
|
||||||
KEY is an an arbitrary symbol with the same syntax rules as keys
|
"\n"
|
||||||
for shell environment variables. PERCENT_ESCAPED_VALUE is the
|
"KEY is an an arbitrary symbol with the same syntax rules as keys\n"
|
||||||
corresponsing value; they should be similar to the values of
|
"for shell environment variables. PERCENT_ESCAPED_VALUE is the\n"
|
||||||
envronment variables but gpg-agent does not enforce any
|
"corresponsing value; they should be similar to the values of\n"
|
||||||
restrictions. If that value is not given any value under that KEY
|
"envronment variables but gpg-agent does not enforce any\n"
|
||||||
is removed from this special environment.
|
"restrictions. If that value is not given any value under that KEY\n"
|
||||||
*/
|
"is removed from this special environment.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_putval (assuan_context_t ctx, char *line)
|
cmd_putval (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1513,12 +1529,13 @@ cmd_putval (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* UPDATESTARTUPTTY
|
static const char hlp_updatestartuptty[] =
|
||||||
|
"UPDATESTARTUPTTY\n"
|
||||||
Set startup TTY and X DISPLAY variables to the values of this
|
"\n"
|
||||||
session. This command is useful to pull future pinentries to
|
"Set startup TTY and X11 DISPLAY variables to the values of this\n"
|
||||||
another screen. It is only required because there is no way in the
|
"session. This command is useful to pull future pinentries to\n"
|
||||||
ssh-agent protocol to convey this information. */
|
"another screen. It is only required because there is no way in the\n"
|
||||||
|
"ssh-agent protocol to convey this information.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_updatestartuptty (assuan_context_t ctx, char *line)
|
cmd_updatestartuptty (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1574,10 +1591,11 @@ cmd_updatestartuptty (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
/* KILLAGENT
|
static const char hlp_killagent[] =
|
||||||
|
"KILLAGENT\n"
|
||||||
Under Windows we start the agent on the fly. Thus it also make
|
"\n"
|
||||||
sense to allow a client to stop the agent. */
|
"Under Windows we start the agent on the fly. Thus it also make\n"
|
||||||
|
"sense to allow a client to stop the agent.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_killagent (assuan_context_t ctx, char *line)
|
cmd_killagent (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1589,10 +1607,12 @@ cmd_killagent (assuan_context_t ctx, char *line)
|
|||||||
return gpg_error (GPG_ERR_EOF);
|
return gpg_error (GPG_ERR_EOF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RELOADAGENT
|
|
||||||
|
|
||||||
As signals are inconvenient under Windows, we provide this command
|
static const char hlp_reloadagent[] =
|
||||||
to allow reloading of the configuration. */
|
"RELOADAGENT\n"
|
||||||
|
"\n"
|
||||||
|
"As signals are inconvenient under Windows, we provide this command\n"
|
||||||
|
"to allow reloading of the configuration.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_reloadagent (assuan_context_t ctx, char *line)
|
cmd_reloadagent (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1606,20 +1626,19 @@ cmd_reloadagent (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* GETINFO <what>
|
static const char hlp_getinfo[] =
|
||||||
|
"GETINFO <what>\n"
|
||||||
Multipurpose function to return a variety of information.
|
"\n"
|
||||||
Supported values for WHAT are:
|
"Multipurpose function to return a variety of information.\n"
|
||||||
|
"Supported values for WHAT are:\n"
|
||||||
version - Return the version of the program.
|
"\n"
|
||||||
pid - Return the process id of the server.
|
" version - Return the version of the program.\n"
|
||||||
socket_name - Return the name of the socket.
|
" pid - Return the process id of the server.\n"
|
||||||
ssh_socket_name - Return the name of the ssh socket.
|
" socket_name - Return the name of the socket.\n"
|
||||||
scd_running - Return OK if the SCdaemon is already running.
|
" ssh_socket_name - Return the name of the ssh socket.\n"
|
||||||
|
" scd_running - Return OK if the SCdaemon is already running.\n"
|
||||||
gpg_error_t
|
" cmd_has_option\n"
|
||||||
- Returns OK if the command CMD implements the option OPT.
|
" - Returns OK if the command CMD implements the option OPT.";
|
||||||
*/
|
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_getinfo (assuan_context_t ctx, char *line)
|
cmd_getinfo (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1827,45 +1846,47 @@ register_commands (assuan_context_t ctx)
|
|||||||
static struct {
|
static struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
assuan_handler_t handler;
|
assuan_handler_t handler;
|
||||||
|
const char * const help;
|
||||||
} table[] = {
|
} table[] = {
|
||||||
{ "GETEVENTCOUNTER",cmd_geteventcounter },
|
{ "GETEVENTCOUNTER",cmd_geteventcounter, hlp_geteventcounter },
|
||||||
{ "ISTRUSTED", cmd_istrusted },
|
{ "ISTRUSTED", cmd_istrusted, hlp_istrusted },
|
||||||
{ "HAVEKEY", cmd_havekey },
|
{ "HAVEKEY", cmd_havekey, hlp_havekey },
|
||||||
{ "KEYINFO", cmd_keyinfo },
|
{ "KEYINFO", cmd_keyinfo, hlp_keyinfo },
|
||||||
{ "SIGKEY", cmd_sigkey },
|
{ "SIGKEY", cmd_sigkey, hlp_sigkey },
|
||||||
{ "SETKEY", cmd_sigkey },
|
{ "SETKEY", cmd_sigkey, hlp_sigkey },
|
||||||
{ "SETKEYDESC", cmd_setkeydesc },
|
{ "SETKEYDESC", cmd_setkeydesc,hlp_setkeydesc },
|
||||||
{ "SETHASH", cmd_sethash },
|
{ "SETHASH", cmd_sethash, hlp_sethash },
|
||||||
{ "PKSIGN", cmd_pksign },
|
{ "PKSIGN", cmd_pksign, hlp_pksign },
|
||||||
{ "PKDECRYPT", cmd_pkdecrypt },
|
{ "PKDECRYPT", cmd_pkdecrypt, hlp_pkdecrypt },
|
||||||
{ "GENKEY", cmd_genkey },
|
{ "GENKEY", cmd_genkey, hlp_genkey },
|
||||||
{ "READKEY", cmd_readkey },
|
{ "READKEY", cmd_readkey, hlp_readkey },
|
||||||
{ "GET_PASSPHRASE", cmd_get_passphrase },
|
{ "GET_PASSPHRASE", cmd_get_passphrase, hlp_get_passphrase },
|
||||||
{ "PRESET_PASSPHRASE", cmd_preset_passphrase },
|
{ "PRESET_PASSPHRASE", cmd_preset_passphrase, hlp_preset_passphrase },
|
||||||
{ "CLEAR_PASSPHRASE", cmd_clear_passphrase },
|
{ "CLEAR_PASSPHRASE", cmd_clear_passphrase, hlp_clear_passphrase },
|
||||||
{ "GET_CONFIRMATION", cmd_get_confirmation },
|
{ "GET_CONFIRMATION", cmd_get_confirmation, hlp_get_confirmation },
|
||||||
{ "LISTTRUSTED", cmd_listtrusted },
|
{ "LISTTRUSTED", cmd_listtrusted, hlp_listtrusted },
|
||||||
{ "MARKTRUSTED", cmd_marktrusted },
|
{ "MARKTRUSTED", cmd_marktrusted, hlp_martrusted },
|
||||||
{ "LEARN", cmd_learn },
|
{ "LEARN", cmd_learn, hlp_learn },
|
||||||
{ "PASSWD", cmd_passwd },
|
{ "PASSWD", cmd_passwd, hlp_passwd },
|
||||||
{ "INPUT", NULL },
|
{ "INPUT", NULL },
|
||||||
{ "OUTPUT", NULL },
|
{ "OUTPUT", NULL },
|
||||||
{ "SCD", cmd_scd },
|
{ "SCD", cmd_scd, hlp_scd },
|
||||||
{ "GETVAL", cmd_getval },
|
{ "GETVAL", cmd_getval, hlp_getval },
|
||||||
{ "PUTVAL", cmd_putval },
|
{ "PUTVAL", cmd_putval, hlp_putval },
|
||||||
{ "UPDATESTARTUPTTY", cmd_updatestartuptty },
|
{ "UPDATESTARTUPTTY", cmd_updatestartuptty, hlp_updatestartuptty },
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
{ "KILLAGENT", cmd_killagent },
|
{ "KILLAGENT", cmd_killagent, hlp_killagent },
|
||||||
{ "RELOADAGENT", cmd_reloadagent },
|
{ "RELOADAGENT", cmd_reloadagent,hlp_reloadagent },
|
||||||
#endif
|
#endif
|
||||||
{ "GETINFO", cmd_getinfo },
|
{ "GETINFO", cmd_getinfo, hlp_getinfo },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
int i, rc;
|
int i, rc;
|
||||||
|
|
||||||
for (i=0; table[i].name; i++)
|
for (i=0; table[i].name; i++)
|
||||||
{
|
{
|
||||||
rc = assuan_register_command (ctx, table[i].name, table[i].handler, NULL);
|
rc = assuan_register_command (ctx, table[i].name, table[i].handler,
|
||||||
|
table[i].help);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user