mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpg: Implement --dry-run for --passwd.
* g10/keyedit.c (change_passphrase): Take care of --dry-run. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
0152ba7c98
commit
165bc38cef
@ -1126,7 +1126,9 @@ all affected self-signatures is set one second ahead.
|
|||||||
@opindex passwd
|
@opindex passwd
|
||||||
Change the passphrase of the secret key belonging to the certificate
|
Change the passphrase of the secret key belonging to the certificate
|
||||||
specified as @var{user-id}. This is a shortcut for the sub-command
|
specified as @var{user-id}. This is a shortcut for the sub-command
|
||||||
@code{passwd} of the edit key menu.
|
@code{passwd} of the edit key menu. When using together with the
|
||||||
|
option @option{--dry-run} this will not actually change the passphrase
|
||||||
|
but check that the current passphrase is correct.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
@ -1134,8 +1134,10 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
|
|||||||
if (err)
|
if (err)
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
|
/* Note that when using --dry-run we don't change the
|
||||||
|
* passphrase but merely verify the current passphrase. */
|
||||||
desc = gpg_format_keydesc (ctrl, pk, FORMAT_KEYDESC_NORMAL, 1);
|
desc = gpg_format_keydesc (ctrl, pk, FORMAT_KEYDESC_NORMAL, 1);
|
||||||
err = agent_passwd (ctrl, hexgrip, desc, 0,
|
err = agent_passwd (ctrl, hexgrip, desc, !!opt.dry_run,
|
||||||
&cache_nonce, &passwd_nonce);
|
&cache_nonce, &passwd_nonce);
|
||||||
xfree (desc);
|
xfree (desc);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user