mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* keylist.c (list_internal_keys): Return error codes.
(list_external_keys, gpgsm_list_keys): Ditto. * server.c (do_listkeys): Ditto. * gpgsm.c (main): Display a key description for --passwd. * call-agent.c (gpgsm_agent_passwd): New arg DESC.
This commit is contained in:
parent
a425334f48
commit
0c224cadf3
6 changed files with 56 additions and 16 deletions
|
@ -710,9 +710,11 @@ gpgsm_agent_learn ()
|
|||
}
|
||||
|
||||
|
||||
/* Ask the agent to change the passphrase of the key identified by HEXKEYGRIP. */
|
||||
/* Ask the agent to change the passphrase of the key identified by
|
||||
HEXKEYGRIP. If DESC is not NULL, display instead of the default
|
||||
description message. */
|
||||
int
|
||||
gpgsm_agent_passwd (const char *hexkeygrip)
|
||||
gpgsm_agent_passwd (const char *hexkeygrip, const char *desc)
|
||||
{
|
||||
int rc;
|
||||
char line[ASSUAN_LINELENGTH];
|
||||
|
@ -724,6 +726,16 @@ gpgsm_agent_passwd (const char *hexkeygrip)
|
|||
if (!hexkeygrip || strlen (hexkeygrip) != 40)
|
||||
return gpg_error (GPG_ERR_INV_VALUE);
|
||||
|
||||
if (desc)
|
||||
{
|
||||
snprintf (line, DIM(line)-1, "SETKEYDESC %s", desc);
|
||||
line[DIM(line)-1] = 0;
|
||||
rc = assuan_transact (agent_ctx, line,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
if (rc)
|
||||
return map_assuan_err (rc);
|
||||
}
|
||||
|
||||
snprintf (line, DIM(line)-1, "PASSWD %s", hexkeygrip);
|
||||
line[DIM(line)-1] = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue