mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
agent: Fix use of imported but unprotected openpgp keys.
* agent/agent.h (PRIVATE_KEY_OPENPGP_NONE): New. * agent/command.c (do_one_keyinfo): Implement it. * agent/findkey.c (agent_key_from_file): Ditto. (agent_key_info_from_file): Ditto. (agent_delete_key): Ditto. * agent/protect.c (agent_private_key_type): Add detection for openpgp "none" method. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
6c368533f5
commit
6ab0fac575
5 changed files with 118 additions and 14 deletions
|
@ -1163,7 +1163,9 @@ do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip, assuan_context_t ctx,
|
|||
{
|
||||
switch (keytype)
|
||||
{
|
||||
case PRIVATE_KEY_CLEAR: protectionstr = "C"; keytypestr = "D";
|
||||
case PRIVATE_KEY_CLEAR:
|
||||
case PRIVATE_KEY_OPENPGP_NONE:
|
||||
protectionstr = "C"; keytypestr = "D";
|
||||
break;
|
||||
case PRIVATE_KEY_PROTECTED: protectionstr = "P"; keytypestr = "D";
|
||||
break;
|
||||
|
@ -1801,12 +1803,12 @@ cmd_passwd (assuan_context_t ctx, char *line)
|
|||
}
|
||||
}
|
||||
if (!err && opt_preset)
|
||||
{
|
||||
{
|
||||
char hexgrip[40+1];
|
||||
bin2hex(grip, 20, hexgrip);
|
||||
err = agent_put_cache (hexgrip, CACHE_MODE_ANY, newpass,
|
||||
ctrl->cache_ttl_opt_preset);
|
||||
}
|
||||
}
|
||||
xfree (newpass);
|
||||
}
|
||||
ctrl->in_passwd--;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue