mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
Added PASSWD --preset.
This commit is contained in:
parent
944bf8f5b5
commit
a9edbfb3a3
@ -1,3 +1,7 @@
|
|||||||
|
2011-04-10 Ben Kibbey <bjk@luxsci.net>
|
||||||
|
|
||||||
|
* command.c: (cmd_passwd): Add option --preset.
|
||||||
|
|
||||||
2011-04-10 Ben Kibbey <bjk@luxsci.net>
|
2011-04-10 Ben Kibbey <bjk@luxsci.net>
|
||||||
|
|
||||||
* command.c: (cmd_genkey): Add option --preset.
|
* command.c: (cmd_genkey): Add option --preset.
|
||||||
|
@ -1411,9 +1411,10 @@ cmd_learn (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
static const char hlp_passwd[] =
|
static const char hlp_passwd[] =
|
||||||
"PASSWD [--cache-nonce=<c>] [--passwd-nonce=<s>] <hexstring_with_keygrip>\n"
|
"PASSWD [--cache-nonce=<c>] [--passwd-nonce=<s>] [--preset] <hexstring_with_keygrip>\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Change the passphrase/PIN for the key identified by keygrip in LINE.";
|
"Change the passphrase/PIN for the key identified by keygrip in LINE. When\n"
|
||||||
|
"--preset is used then the new passphrase will be added to the cache.\n";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_passwd (assuan_context_t ctx, char *line)
|
cmd_passwd (assuan_context_t ctx, char *line)
|
||||||
{
|
{
|
||||||
@ -1427,7 +1428,9 @@ cmd_passwd (assuan_context_t ctx, char *line)
|
|||||||
unsigned char *shadow_info = NULL;
|
unsigned char *shadow_info = NULL;
|
||||||
char *passphrase = NULL;
|
char *passphrase = NULL;
|
||||||
char *pend;
|
char *pend;
|
||||||
|
int opt_preset;
|
||||||
|
|
||||||
|
opt_preset = has_option (line, "--preset");
|
||||||
cache_nonce = option_value (line, "--cache-nonce");
|
cache_nonce = option_value (line, "--cache-nonce");
|
||||||
if (cache_nonce)
|
if (cache_nonce)
|
||||||
{
|
{
|
||||||
@ -1525,6 +1528,12 @@ cmd_passwd (assuan_context_t ctx, char *line)
|
|||||||
ctrl->server_local->last_passwd_nonce = passwd_nonce;
|
ctrl->server_local->last_passwd_nonce = passwd_nonce;
|
||||||
passwd_nonce = NULL;
|
passwd_nonce = NULL;
|
||||||
}
|
}
|
||||||
|
if (opt_preset)
|
||||||
|
{
|
||||||
|
char hexgrip[40+1];
|
||||||
|
bin2hex(grip, 20, hexgrip);
|
||||||
|
err = agent_put_cache (hexgrip, CACHE_MODE_ANY, newpass, 900);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xfree (newpass);
|
xfree (newpass);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user