aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/gpg.texi4
-rw-r--r--g10/keyedit.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/doc/gpg.texi b/doc/gpg.texi
index e3c3662a8..ad044ffc0 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -1126,7 +1126,9 @@ all affected self-signatures is set one second ahead.
@opindex passwd
Change the passphrase of the secret key belonging to the certificate
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
diff --git a/g10/keyedit.c b/g10/keyedit.c
index 17cf7d6ea..4ade5cdba 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -1134,8 +1134,10 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
if (err)
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);
- err = agent_passwd (ctrl, hexgrip, desc, 0,
+ err = agent_passwd (ctrl, hexgrip, desc, !!opt.dry_run,
&cache_nonce, &passwd_nonce);
xfree (desc);