[git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.25-3-g5798673

by Andreas Schwier cvs at cvs.gnupg.org
Mon Jul 21 14:51:20 CEST 2014


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-0 has been updated
       via  5798673156a66f4c39e1d34e358b03539194d57c (commit)
       via  9a1e195348daa9f719d34fdf4e4d6bfce4c8fb3e (commit)
      from  40215d8ecdb10d36c699aa66f6e35c43b31e4822 (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 5798673156a66f4c39e1d34e358b03539194d57c
Author: Andreas Schwier <andreas.schwier at cardcontact.de>
Date:   Fri Jul 18 18:22:26 2014 +0200

    scd: Allow for certificates > 1024 with PC/SC.
    
    * scd/pcsc-wrapper.c (handle_transmit): Enlarge buffer to 4096 too
    allow for larger certificates.

diff --git a/scd/pcsc-wrapper.c b/scd/pcsc-wrapper.c
index f3d92ff..0d572d2 100644
--- a/scd/pcsc-wrapper.c
+++ b/scd/pcsc-wrapper.c
@@ -714,7 +714,7 @@ handle_transmit (unsigned char *argbuf, size_t arglen)
   long err;
   struct pcsc_io_request_s send_pci;
   pcsc_dword_t recv_len;
-  unsigned char buffer[1024];
+  unsigned char buffer[4096];
 
   /* The apdu should at least be one byte. */
   if (!arglen)

commit 9a1e195348daa9f719d34fdf4e4d6bfce4c8fb3e
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Jul 21 13:50:36 2014 +0200

    gpg: Cap size of attribute packets at 16MB.
    
    * g10/parse-packet.c (parse_attribute): Avoid xmalloc failure and cap
    size of packet.
    --
    
    Tavis Ormandy reported a fatal error for attribute packets with a zero
    length payload.  This is due to a check in Libgcrypt's xmalloc which
    rejects a malloc(0) instead of silently allocating 1 byte.  The fix is
    obvious.
    
    In addition we cap the size of attribute packets similar to what we do
    with user id packets.  OpenPGP keys are not the proper way to store
    movies.
    
    Resolved conflicts:
    	g10/parse-packet.c - indentation.  Use plain fprintf.

diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index ab4655d..f1d7f71 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -2214,11 +2214,22 @@ parse_attribute( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *packet )
 
     (void)pkttype;
 
+    /* We better cap the size of an attribute packet to make DoS not
+       too easy.  16MB should be more then enough for one attribute
+       packet (ie. a photo).  */
+    if (pktlen > 16*1024*1024) {
+        log_error ("packet(%d) too large\n", pkttype);
+        if (list_mode)
+          fprintf (listfp, ":attribute packet: [too large]\n");
+        iobuf_skip_rest (inp, pktlen, 0);
+        return G10ERR_INVALID_PACKET;
+      }
+
 #define EXTRA_UID_NAME_SPACE 71
     packet->pkt.user_id = xmalloc_clear(sizeof *packet->pkt.user_id
 					+ EXTRA_UID_NAME_SPACE);
     packet->pkt.user_id->ref=1;
-    packet->pkt.user_id->attrib_data = xmalloc(pktlen);
+    packet->pkt.user_id->attrib_data = xmalloc(pktlen? pktlen:1);
     packet->pkt.user_id->attrib_len = pktlen;
 
     p = packet->pkt.user_id->attrib_data;

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

Summary of changes:
 g10/parse-packet.c |   13 ++++++++++++-
 scd/pcsc-wrapper.c |    2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)


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




More information about the Gnupg-commits mailing list