[git] GnuPG - branch, STABLE-BRANCH-2-2, updated. gnupg-2.2.5-21-g165bc38

by Werner Koch cvs at cvs.gnupg.org
Thu Mar 22 10:31:00 CET 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, STABLE-BRANCH-2-2 has been updated
       via  165bc38cefbc03515403b60b704cabf4dc0b71f4 (commit)
      from  0152ba7c987443d641ce1091c79f90ef2cc46498 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 165bc38cefbc03515403b60b704cabf4dc0b71f4
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Mar 22 10:23:00 2018 +0100

    gpg: Implement --dry-run for --passwd.
    
    * g10/keyedit.c (change_passphrase): Take care of --dry-run.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/gpg.texi b/doc/gpg.texi
index e3c3662..ad044ff 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
- at code{passwd} of the edit key menu.
+ at 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 17cf7d6..4ade5cd 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);
 

-----------------------------------------------------------------------

Summary of changes:
 doc/gpg.texi  | 4 +++-
 g10/keyedit.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list