[git] GPGME - branch, master, updated. gpgme-1.4.3-29-g88f1533

by Werner Koch cvs at cvs.gnupg.org
Thu May 8 20:38:07 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 "GnuPG Made Easy".

The branch, master has been updated
       via  88f15336ec0eadde68ff2618349efb9006b8e801 (commit)
       via  de4a1ea684e1591975feb801e7651309e1ee2c49 (commit)
      from  d5fb92cdaed21eea2f1a921e4f11df72635a8462 (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 88f15336ec0eadde68ff2618349efb9006b8e801
Author: Werner Koch <wk at gnupg.org>
Date:   Thu May 8 20:39:15 2014 +0200

    Add field CURVE to the key info.
    
    * src/gpgme.h.in (struct _gpgme_subkey): Add field CURVE.
    * src/key.c (gpgme_key_unref): Free CURVE.
    * src/keylist.c (keylist_colon_handler): Set CURVE.
    
    * src/gpgme.c (gpgme_release): For failsafe reasons reset engine and
    engine info after freeing.
    --
    
    The engine hack is useful in case the other release functions
    accidently call engine release.

diff --git a/NEWS b/NEWS
index b9d2f35..9433356 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Noteworthy changes in version 1.5.0 (unreleased)
  GPGME_ENCRYPT_NO_COMPRESS      NEW.
  GPGME_PK_ECC                   NEW.
  GPGME_MD_SHA224                NEW.
+ gpgme_subkey_t                 EXTENDED: New field curve.
 
 
 Noteworthy changes in version 1.4.3 (2013-08-12)
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 9a67c3b..e326574 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -2742,6 +2742,10 @@ True if the secret key is stored on a smart card.
 
 @item char *card_number
 The serial number of a smart card holding this key or @code{NULL}.
+
+ at item char *curve
+For ECC algoritms the name of the curve.
+
 @end table
 @end deftp
 
diff --git a/src/gpgme.c b/src/gpgme.c
index a3768ef..628cdae 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -233,6 +233,7 @@ gpgme_release (gpgme_ctx_t ctx)
     return;
 
   _gpgme_engine_release (ctx->engine);
+  ctx->engine = NULL;
   _gpgme_fd_table_deinit (&ctx->fdt);
   _gpgme_release_result (ctx);
   _gpgme_signers_clear (ctx);
@@ -244,6 +245,7 @@ gpgme_release (gpgme_ctx_t ctx)
   if (ctx->lc_messages)
     free (ctx->lc_messages);
   _gpgme_engine_info_release (ctx->engine_info);
+  ctx->engine_info = NULL;
   DESTROY_LOCK (ctx->lock);
   free (ctx);
 }
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index d58c114..170d7dd 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -629,6 +629,9 @@ struct _gpgme_subkey
 
   /* The serial number of a smart card holding this key or NULL.  */
   char *card_number;
+
+  /* The name of the curve for ECC algorithms or NULL.  */
+  char *curve;
 };
 typedef struct _gpgme_subkey *gpgme_subkey_t;
 
diff --git a/src/key.c b/src/key.c
index 59d4908..1a68966 100644
--- a/src/key.c
+++ b/src/key.c
@@ -331,6 +331,8 @@ gpgme_key_unref (gpgme_key_t key)
       gpgme_subkey_t next = subkey->next;
       if (subkey->fpr)
 	free (subkey->fpr);
+      if (subkey->curve)
+	free (subkey->curve);
       if (subkey->card_number)
 	free (subkey->card_number);
       free (subkey);
diff --git a/src/keylist.c b/src/keylist.c
index a361333..582b241 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -422,7 +422,7 @@ keylist_colon_handler (void *priv, char *line)
       RT_SSB, RT_SEC, RT_CRT, RT_CRS, RT_REV, RT_SPK
     }
   rectype = RT_NONE;
-#define NR_FIELDS 16
+#define NR_FIELDS 17
   char *field[NR_FIELDS];
   int fields = 0;
   void *hook;
@@ -584,6 +584,15 @@ keylist_colon_handler (void *priv, char *line)
           if (err)
             return err;
         }
+
+      /* Field 17 has the curve name for ECC.  */
+      if (fields >= 17 && *field[16])
+        {
+          subkey->curve = strdup (field[16]);
+          if (!subkey->curve)
+            return gpg_error_from_syserror ();
+        }
+
       break;
 
     case RT_SUB:
@@ -646,6 +655,15 @@ keylist_colon_handler (void *priv, char *line)
           if (err)
             return err;
         }
+
+      /* Field 17 has the curve name for ECC.  */
+      if (fields >= 17 && *field[16])
+        {
+          subkey->curve = strdup (field[16]);
+          if (!subkey->curve)
+            return gpg_error_from_syserror ();
+        }
+
       break;
 
     case RT_UID:

commit de4a1ea684e1591975feb801e7651309e1ee2c49
Author: Werner Koch <wk at gnupg.org>
Date:   Thu May 8 20:35:57 2014 +0200

    Fix a memory access and a double slash bug.
    
    * src/engine-spawn.c (engspawn_start): Allocate space for list
    terminator.
    * src/posix-util.c (walk_path): Fix trailing slash detection.
    --
    
    Kudos to Valgrind for pointing out these two problems.
    
    The first is a plain allocation bug in a code pattern I have written
    thousands of times - this time it went wrong.  The allocation is not
    user controlled thus not directly exploitable.
    
    The second is missed to do what it intended to do.  Found due to the
    access of malloced but not initialized memory.  Not using calloc
    again proved to be helpful to detect logical error.

diff --git a/src/engine-spawn.c b/src/engine-spawn.c
index bfcad3d..8ffc628 100644
--- a/src/engine-spawn.c
+++ b/src/engine-spawn.c
@@ -250,7 +250,7 @@ engspawn_start (engine_spawn_t esp, const char *file, const char *argv[],
   n = 0;
   for (i = 0; esp->fd_data_map[i].data; i++)
     n++;
-  fd_list = calloc (n, sizeof *fd_list);
+  fd_list = calloc (n+1, sizeof *fd_list);
   if (!fd_list)
     return gpg_error_from_syserror ();
 
diff --git a/src/posix-util.c b/src/posix-util.c
index e78cd77..f7e0a17 100644
--- a/src/posix-util.c
+++ b/src/posix-util.c
@@ -95,7 +95,7 @@ walk_path (const char *pgm)
     {
       for (s=path, p=fname; *s && *s != ':'; s++, p++)
         *p = *s;
-      if (*p != '/')
+      if (p != fname && p[-1] != '/')
         *p++ = '/';
       strcpy (p, pgm);
       if (!access (fname, X_OK))

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

Summary of changes:
 NEWS               |    1 +
 doc/gpgme.texi     |    4 ++++
 src/engine-spawn.c |    2 +-
 src/gpgme.c        |    2 ++
 src/gpgme.h.in     |    3 +++
 src/key.c          |    2 ++
 src/keylist.c      |   20 +++++++++++++++++++-
 src/posix-util.c   |    2 +-
 8 files changed, 33 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list