[git] GnuPG - branch, master, updated. gnupg-2.1.3-26-g874ef16

by Werner Koch cvs at cvs.gnupg.org
Thu May 7 12:15:07 CEST 2015


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  874ef16e70ab750db7b153f17a7e859a0db6a2f1 (commit)
       via  173b26c8f83a3c623165a96c315bf9ed4b90edcc (commit)
       via  154abaf3c97dae43ba972e4482680a287f3e5c39 (commit)
      from  f77fd572db658959fa40aa8c181be919e688b707 (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 874ef16e70ab750db7b153f17a7e859a0db6a2f1
Author: Werner Koch <wk at gnupg.org>
Date:   Thu May 7 12:01:12 2015 +0200

    gpg: Improve 'General key info' line of --card-status.
    
    * g10/keylist.c (print_pubkey_info): Print either "pub" or "sub".
    
    * g10/getkey.c (get_pubkey_byfprint): Add optional arg R_KEYBLOCK.
    * g10/keyid.c (keyid_from_fingerprint): Adjust for change.
    * g10/revoke.c (gen_desig_revoke): Adjust for change.
    * g10/card-util.c (card_status): Simplify by using new arg.  Align
    card-no string.
    
    * g10/card-util.c (card_status): Remove not used GnuPG-1 code.
    --
    
    This now prints "sub" if the first used card key is actually a subkey.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/card-util.c b/g10/card-util.c
index a291a07..dbd530e 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -366,6 +366,7 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
 {
   struct agent_card_info_s info;
   PKT_public_key *pk = xcalloc (1, sizeof *pk);
+  kbnode_t keyblock = NULL;
   int rc;
   unsigned int uval;
   const unsigned char *thefpr;
@@ -587,41 +588,17 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
       /* If the fingerprint is all 0xff, the key has no asssociated
          OpenPGP certificate.  */
       if ( thefpr && !fpr_is_ff (thefpr)
-           && !get_pubkey_byfprint (pk, thefpr, 20))
+           && !get_pubkey_byfprint (pk, &keyblock, thefpr, 20))
         {
-          kbnode_t keyblock = NULL;
-
           print_pubkey_info (fp, pk);
-
-#if GNUPG_MAJOR_VERSION == 1
-          if ( !get_seckeyblock_byfprint (&keyblock, thefpr, 20) )
+          if (keyblock)
             print_card_key_info (fp, keyblock);
-          else if ( !get_keyblock_byfprint (&keyblock, thefpr, 20) )
-            {
-              release_kbnode (keyblock);
-              keyblock = NULL;
-
-              if (!auto_create_card_key_stub (info.serialno,
-                                              info.fpr1valid? info.fpr1:NULL,
-                                              info.fpr2valid? info.fpr2:NULL,
-                                              info.fpr3valid? info.fpr3:NULL))
-                {
-                  if ( !get_seckeyblock_byfprint (&keyblock, thefpr, 20) )
-                    print_card_key_info (fp, keyblock);
-                }
-            }
-
-#else /* GNUPG_MAJOR_VERSION != 1 */
-          if (!get_keyblock_byfprint (&keyblock, thefpr, 20))
-            print_card_key_info (fp, keyblock);
-#endif /* GNUPG_MAJOR_VERSION != 1 */
-
-          release_kbnode (keyblock);
         }
       else
         tty_fprintf (fp, "[none]\n");
     }
 
+  release_kbnode (keyblock);
   free_public_key (pk);
   agent_release_card_info (&info);
 }
diff --git a/g10/getkey.c b/g10/getkey.c
index 20b37d8..e450c56 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -968,17 +968,26 @@ get_pubkey_byfpr (PKT_public_key *pk, const byte *fpr)
 }
 
 
-/* Search for a key with the given fingerprint.
+/* Search for a key with the given fingerprint.  The caller need to
+ * prove an allocated public key object at PK.  If R_KEYBLOCK is not
+ * NULL the entire keyblock is stored there and the caller needs to
+ * call release_kbnode() on it.  Note that this function does an exact
+ * search and thus the public key stored at PK may be a copy of a
+ * subkey.
+ *
  * FIXME:
  * We should replace this with the _byname function.  This can be done
  * by creating a userID conforming to the unified fingerprint style.
  */
 int
-get_pubkey_byfprint (PKT_public_key * pk,
+get_pubkey_byfprint (PKT_public_key *pk, kbnode_t *r_keyblock,
 		     const byte * fprint, size_t fprint_len)
 {
   int rc;
 
+  if (r_keyblock)
+    *r_keyblock = NULL;
+
   if (fprint_len == 20 || fprint_len == 16)
     {
       struct getkey_ctx_s ctx;
@@ -994,7 +1003,14 @@ get_pubkey_byfprint (PKT_public_key * pk,
       memcpy (ctx.items[0].u.fpr, fprint, fprint_len);
       rc = lookup (&ctx, &kb, 0);
       if (!rc && pk)
-	pk_from_block (&ctx, pk, kb);
+        {
+          pk_from_block (&ctx, pk, kb);
+          if (r_keyblock)
+            {
+              *r_keyblock = kb;
+              kb = NULL;
+            }
+        }
       release_kbnode (kb);
       get_pubkey_end (&ctx);
     }
diff --git a/g10/keydb.h b/g10/keydb.h
index c61e0ae..11a10e9 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -223,8 +223,8 @@ int get_pubkey_next( GETKEY_CTX ctx, PKT_public_key *pk, KBNODE *ret_keyblock );
 void get_pubkey_end( GETKEY_CTX ctx );
 gpg_error_t get_seckey (PKT_public_key *pk, u32 *keyid);
 gpg_error_t get_pubkey_byfpr (PKT_public_key *pk, const byte *fpr);
-int get_pubkey_byfprint( PKT_public_key *pk, const byte *fprint,
-						 size_t fprint_len );
+int get_pubkey_byfprint (PKT_public_key *pk,  kbnode_t *r_keyblock,
+                         const byte *fprint, size_t fprint_len);
 int get_pubkey_byfprint_fast (PKT_public_key *pk,
                               const byte *fprint, size_t fprint_len);
 int get_keyblock_byfprint( KBNODE *ret_keyblock, const byte *fprint,
diff --git a/g10/keyid.c b/g10/keyid.c
index a0571b0..90d982e 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -463,7 +463,7 @@ keyid_from_fingerprint( const byte *fprint, size_t fprint_len, u32 *keyid )
       int rc;
 
       memset (&pk, 0, sizeof pk);
-      rc = get_pubkey_byfprint (&pk, fprint, fprint_len);
+      rc = get_pubkey_byfprint (&pk, NULL, fprint, fprint_len);
       if( rc )
         {
           log_error("Oops: keyid_from_fingerprint: no pubkey\n");
diff --git a/g10/keylist.c b/g10/keylist.c
index d62bc20..2cd988d 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -170,7 +170,7 @@ print_seckey_info (PKT_public_key *pk)
    the tty output interface is used, otherwise output is directted to
    the given stream.  */
 void
-print_pubkey_info (estream_t fp, PKT_public_key * pk)
+print_pubkey_info (estream_t fp, PKT_public_key *pk)
 {
   u32 keyid[2];
   char *p;
@@ -187,7 +187,8 @@ print_pubkey_info (estream_t fp, PKT_public_key * pk)
 
   if (fp)
     tty_printf ("\n");
-  tty_fprintf (fp, "pub  %s/%s %s %s\n",
+  tty_fprintf (fp, "%s  %s/%s %s %s\n",
+               pk->flags.primary? "pub":"sub",
                pubkey_string (pk, pkstrbuf, sizeof pkstrbuf),
                keystr (keyid), datestr_from_pk (pk), p);
   xfree (p);
@@ -205,6 +206,7 @@ print_card_key_info (estream_t fp, kbnode_t keyblock)
   char *serialno;
   int s2k_char;
   char pkstrbuf[PUBKEY_STRING_SIZE];
+  int indent;
 
   for (node = keyblock; node; node = node->next)
     {
@@ -226,18 +228,18 @@ print_card_key_info (estream_t fp, kbnode_t keyblock)
           else
             s2k_char = '#';  /* Key not found.  */
 
-          tty_fprintf (fp, "%s%c  %s/%s  ",
+          tty_fprintf (fp, "%s%c  %s/%s  %n",
                        node->pkt->pkttype == PKT_PUBLIC_KEY ? "sec" : "ssb",
                        s2k_char,
                        pubkey_string (pk, pkstrbuf, sizeof pkstrbuf),
-                       keystr_from_pk (pk));
+                       keystr_from_pk (pk),
+                       &indent);
           tty_fprintf (fp, _("created: %s"), datestr_from_pk (pk));
           tty_fprintf (fp, "  ");
           tty_fprintf (fp, _("expires: %s"), expirestr_from_pk (pk));
           if (serialno)
             {
-              tty_fprintf (fp, "\n                      ");
-              tty_fprintf (fp, _("card-no: "));
+              tty_fprintf (fp, "\n%*s%s", indent, "", _("card-no: "));
               if (strlen (serialno) == 32
                   && !strncmp (serialno, "D27600012401", 12))
                 {
diff --git a/g10/revoke.c b/g10/revoke.c
index 15d28b0..6680ac7 100644
--- a/g10/revoke.c
+++ b/g10/revoke.c
@@ -291,7 +291,7 @@ gen_desig_revoke( const char *uname, strlist_t locusr )
 	else
 	  {
 	    pk2 = xmalloc_clear (sizeof *pk2);
-	    rc = get_pubkey_byfprint (pk2,
+	    rc = get_pubkey_byfprint (pk2, NULL,
                                       pk->revkey[i].fpr, MAX_FINGERPRINT_LEN);
 	  }
 

commit 173b26c8f83a3c623165a96c315bf9ed4b90edcc
Author: Werner Koch <wk at gnupg.org>
Date:   Thu May 7 11:54:34 2015 +0200

    gpg: Fix regression not displaying the card serial number
    
    * g10/call-agent.c (keyinfo_status_cb): Detect KEYINFO.
    --
    
    This regression is due to
    commit 585d5c62eece23911a768d97d11f159be138b13d
    from February 2013!
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/call-agent.c b/g10/call-agent.c
index 017e916..edee66e 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -1626,7 +1626,7 @@ keyinfo_status_cb (void *opaque, const char *line)
   char **serialno = opaque;
   const char *s, *s2;
 
-  if ((s = has_leading_keyword (line, "KEYINFO ")) && !*serialno)
+  if ((s = has_leading_keyword (line, "KEYINFO")) && !*serialno)
     {
       s = strchr (s, ' ');
       if (s && s[1] == 'T' && s[2] == ' ' && s[3])

commit 154abaf3c97dae43ba972e4482680a287f3e5c39
Author: Werner Koch <wk at gnupg.org>
Date:   Wed May 6 11:06:26 2015 +0200

    speedo,w32: Install a native pinentry.
    
    * build-aux/speedo.mk: Always build pinentry for w32.
    (speedo_pkg_pinentry_configure): Adjust to modern pinentry.
    * build-aux/speedo/w32/inst.nsi: Install native pinentry under the
    name pinentry-basic.exe.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/build-aux/speedo.mk b/build-aux/speedo.mk
index a0e29a5..984c9e9 100644
--- a/build-aux/speedo.mk
+++ b/build-aux/speedo.mk
@@ -187,14 +187,19 @@ speedo_spkgs += \
 endif
 endif
 
+ifeq ($(TARGETOS),w32)
 
+speedo_spkgs += pinentry
 ifeq ($(WITH_GUI),1)
-speedo_spkgs += \
-	pinentry gpa
-ifeq ($(TARGETOS),w32)
-speedo_spkgs += \
-	gpgex
+speedo_spkgs += gpa gpgex
 endif
+
+else
+
+ifeq ($(WITH_GUI),1)
+speedo_spkgs += pinentry gpa
+endif
+
 endif
 
 
@@ -437,14 +442,19 @@ speedo_pkg_gpgme_configure = \
 	LDFLAGS=-L$(idir)/lib
 endif
 
-speedo_pkg_pinentry_configure = \
-	--disable-pinentry-qt --disable-pinentry-qt4 --disable-pinentry-gtk \
-	--enable-pinentry-gtk2 \
-	--with-glib-prefix=$(idir) --with-gtk-prefix=$(idir) \
+
+ifeq ($(TARGETOS),w32)
+speedo_pkg_pinentry_configure = --disable-pinentry-gtk2
+else
+speedo_pkg_pinentry_configure = --enable-pinentry-gtk2
+endif
+speedo_pkg_pinentry_configure += \
+        --disable-pinentry-qt4 \
 	CPPFLAGS=-I$(idir)/include   \
 	LDFLAGS=-L$(idir)/lib        \
 	CXXFLAGS=-static-libstdc++
 
+
 speedo_pkg_gpa_configure = \
         --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir) \
         --with-gpgme-prefix=$(idir) --with-zlib=$(idir) \
diff --git a/build-aux/speedo/w32/inst.nsi b/build-aux/speedo/w32/inst.nsi
index e88a91c..19babb9 100644
--- a/build-aux/speedo/w32/inst.nsi
+++ b/build-aux/speedo/w32/inst.nsi
@@ -816,12 +816,10 @@ Section "-gtk+" SEC_gtk_
 SectionEnd
 !endif
 
-!ifdef WITH_GUI
 Section "-pinentry" SEC_pinentry
   SetOutPath "$INSTDIR\bin"
-  File /oname=pinentry.exe "bin/pinentry-gtk-2.exe"
+  File /oname=pinentry-basic.exe "bin/pinentry-w32.exe"
 SectionEnd
-!endif
 
 !ifdef WITH_GUI
 Section "gpa" SEC_gpa
@@ -933,11 +931,9 @@ Section "-un.gpa"
 SectionEnd
 !endif
 
-!ifdef WITH_GUI
 Section "-un.pinentry"
-  Delete "$INSTDIR\bin\pinentry.exe"
+  Delete "$INSTDIR\bin\pinentry-basic.exe"
 SectionEnd
-!endif
 
 !ifdef WITH_GUI
 Section "-un.gtk+"

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

Summary of changes:
 build-aux/speedo.mk           | 28 +++++++++++++++++++---------
 build-aux/speedo/w32/inst.nsi |  8 ++------
 g10/call-agent.c              |  2 +-
 g10/card-util.c               | 31 ++++---------------------------
 g10/getkey.c                  | 22 +++++++++++++++++++---
 g10/keydb.h                   |  4 ++--
 g10/keyid.c                   |  2 +-
 g10/keylist.c                 | 14 ++++++++------
 g10/revoke.c                  |  2 +-
 9 files changed, 57 insertions(+), 56 deletions(-)


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




More information about the Gnupg-commits mailing list