diff options
author | Werner Koch <wk@gnupg.org> | 2008-10-28 12:41:52 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2008-10-28 12:41:52 +0100 |
commit | 3f8e827f635dc3da61ccb51645e291bcb4d09c91 (patch) | |
tree | f91f60ec930c081b1839d7f84983633d36fbd5d8 /g10 | |
parent | auto po updates. (diff) | |
download | gnupg2-3f8e827f635dc3da61ccb51645e291bcb4d09c91.tar.xz gnupg2-3f8e827f635dc3da61ccb51645e291bcb4d09c91.zip |
fixed a bug in the prompt formatter.
Diffstat (limited to 'g10')
-rw-r--r-- | g10/ChangeLog | 4 | ||||
-rw-r--r-- | g10/keyedit.c | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index b9a984913..130ebd511 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,7 @@ +2008-10-24 Werner Koch <wk@g10code.com> + + * keyedit.c (change_passphrase): Clear passphrase cache. + 2008-10-20 Werner Koch <wk@g10code.com> * gpgv.c: Mark all args of the stub fucntions as unused. diff --git a/g10/keyedit.c b/g10/keyedit.c index cbb9d79bc..fd9f23b20 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -1151,7 +1151,15 @@ change_passphrase( KBNODE keyblock ) no_primary_secrets = 1; } else { + u32 keyid[2]; + tty_printf(_("Key is protected.\n")); + + /* Clear the passphrase cache so that the user is required + to enter the old passphrase. */ + keyid_from_sk (sk, keyid); + passphrase_clear_cache (keyid, NULL, 0); + rc = check_secret_key( sk, 0 ); if( !rc ) passphrase = get_last_passphrase(); @@ -1233,7 +1241,17 @@ change_passphrase( KBNODE keyblock ) log_error("protect_secret_key failed: %s\n", g10_errstr(rc) ); else + { + u32 keyid[2]; + + /* Clear the cahce again so that the user is + required to enter the new passphrase at the + next operation. */ + keyid_from_sk (sk, keyid); + passphrase_clear_cache (keyid, NULL, 0); + changed++; + } break; } } |