Fixed PASSWD --preset.

The previous patch required that the keygrip be cached before adding the
new passphrase to the cache. No more.
This commit is contained in:
Ben Kibbey 2011-04-12 20:02:05 -04:00 committed by Werner Koch
parent f8c5395fbd
commit b3c71eb26b
2 changed files with 11 additions and 7 deletions

View File

@ -1,3 +1,7 @@
2011-04-12 Ben Kibbey <bjk@luxsci.net>
* command.c (cmd_passwd): Fixed --preset when not previously cached.
2011-04-12 Werner Koch <wk@g10code.com>
* agent.h (CACHE_TTL_NONCE, CACHE_TTL_OPT_PRESET): New.

View File

@ -1528,15 +1528,15 @@ cmd_passwd (assuan_context_t ctx, char *line)
ctrl->server_local->last_passwd_nonce = passwd_nonce;
passwd_nonce = NULL;
}
if (opt_preset)
{
char hexgrip[40+1];
bin2hex(grip, 20, hexgrip);
err = agent_put_cache (hexgrip, CACHE_MODE_ANY, newpass,
CACHE_TTL_OPT_PRESET);
}
}
}
if (opt_preset)
{
char hexgrip[40+1];
bin2hex(grip, 20, hexgrip);
err = agent_put_cache (hexgrip, CACHE_MODE_ANY, newpass,
CACHE_TTL_OPT_PRESET);
}
xfree (newpass);
}
ctrl->in_passwd--;