[git] GnuPG - branch, master, updated. gnupg-2.1.21-141-g872137b

by Marcus Brinkmann cvs at cvs.gnupg.org
Mon Jul 24 17:18:52 CEST 2017


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, master has been updated
       via  872137b5921dd297e7d2c1def6e3868b7595feb5 (commit)
      from  78ebc62604d77600b9865950610717d28c6027a2 (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 872137b5921dd297e7d2c1def6e3868b7595feb5
Author: Marcus Brinkmann <marcus.brinkmann at ruhr-uni-bochum.de>
Date:   Mon Jul 24 17:18:42 2017 +0200

    g10: Make sure to emit NEED_PASSPHRASE on --import of secret key.
    
    * call-agent.h (agent_import_key): Add keyid parameters.
    * call-agent.c (agent_import_key): Set keyid parameters.
    * import.c (transfer_secret_keys): Pass keyid parameters.
    
    Signed-off-by: Marcus Brinkmann <mb at g10code.com>
    GnuPG-bug-id: 2667

diff --git a/g10/call-agent.c b/g10/call-agent.c
index b17c2e6..1ce6641 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -2096,7 +2096,8 @@ inq_import_key_parms (void *opaque, const char *line)
 /* Call the agent to import a key into the agent.  */
 gpg_error_t
 agent_import_key (ctrl_t ctrl, const char *desc, char **cache_nonce_addr,
-                  const void *key, size_t keylen, int unattended, int force)
+                  const void *key, size_t keylen, int unattended, int force,
+		  u32 *keyid, u32 *mainkeyid, int pubkey_algo)
 {
   gpg_error_t err;
   struct import_key_parm_s parm;
@@ -2106,6 +2107,9 @@ agent_import_key (ctrl_t ctrl, const char *desc, char **cache_nonce_addr,
 
   memset (&dfltparm, 0, sizeof dfltparm);
   dfltparm.ctrl = ctrl;
+  dfltparm.keyinfo.keyid       = keyid;
+  dfltparm.keyinfo.mainkeyid   = mainkeyid;
+  dfltparm.keyinfo.pubkey_algo = pubkey_algo;
 
   err = start_agent (ctrl, 0);
   if (err)
diff --git a/g10/call-agent.h b/g10/call-agent.h
index dcabbe8..f45b64d 100644
--- a/g10/call-agent.h
+++ b/g10/call-agent.h
@@ -186,7 +186,8 @@ gpg_error_t agent_keywrap_key (ctrl_t ctrl, int forexport,
 /* Send a key to the agent.  */
 gpg_error_t agent_import_key (ctrl_t ctrl, const char *desc,
                               char **cache_nonce_addr, const void *key,
-                              size_t keylen, int unattended, int force);
+                              size_t keylen, int unattended, int force,
+			      u32 *keyid, u32 *mainkeyid, int pubkey_algo);
 
 /* Receive a key from the agent.  */
 gpg_error_t agent_export_key (ctrl_t ctrl, const char *keygrip,
diff --git a/g10/import.c b/g10/import.c
index 02440ff..c87f49b 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -2109,7 +2109,8 @@ transfer_secret_keys (ctrl_t ctrl, struct import_stats_s *stats,
       {
         char *desc = gpg_format_keydesc (ctrl, pk, FORMAT_KEYDESC_IMPORT, 1);
         err = agent_import_key (ctrl, desc, &cache_nonce,
-                                wrappedkey, wrappedkeylen, batch, force);
+                                wrappedkey, wrappedkeylen, batch, force,
+				pk->keyid, pk->main_keyid, pk->pubkey_algo);
         xfree (desc);
       }
       if (!err)

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

Summary of changes:
 g10/call-agent.c | 6 +++++-
 g10/call-agent.h | 3 ++-
 g10/import.c     | 3 ++-
 3 files changed, 9 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list