[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-171-g37d0a1e

by Werner Koch cvs at cvs.gnupg.org
Fri Jul 19 18:44:28 CEST 2013


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 crypto library".

The branch, master has been updated
       via  37d0a1ebdc2dc74df4fb6bf0621045018122a68f (commit)
       via  2d3e8d4d9562d666420aadd9ffa8ac0456a1cd91 (commit)
      from  41e1a90fcf222affb4a06e50bdacd65f9a6797cf (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 37d0a1ebdc2dc74df4fb6bf0621045018122a68f
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Jul 19 18:14:38 2013 +0200

    pk: Allow the use of a hash element for DSA sign and verify.
    
    * cipher/pubkey.c (pubkey_sign): Add arg ctx and pass it to the sign
    module.
    (gcry_pk_sign): Pass CTX to pubkey_sign.
    (sexp_data_to_mpi): Add flag rfc6979 and code to alls hash with *DSA
    * cipher/rsa.c (rsa_sign, rsa_verify): Return an error if an opaque
    MPI is given for DATA/HASH.
    * cipher/elgamal.c (elg_sign, elg_verify): Ditto.
    * cipher/dsa.c (dsa_sign, dsa_verify): Convert a given opaque MPI.
    * cipher/ecc.c (ecc_sign, ecc_verify): Ditto.
    * tests/basic.c (check_pubkey_sign_ecdsa): Add a test for using a hash
    element with DSA.
    --
    
    This patch allows the use of
    
      (data (flags raw)
        (hash sha256 #80112233445566778899AABBCCDDEEFF
                      000102030405060708090A0B0C0D0E0F#))
    
    in addition to the old but more efficient
    
      (data (flags raw)
        (value #80112233445566778899AABBCCDDEEFF
                000102030405060708090A0B0C0D0E0F#))
    
    for DSA and ECDSA.  With the hash element the flag "raw" must be
    explicitly given because existing regression test code expects that
    conflict error is return if no flags but a hash element is given.
    
    Note that the hash algorithm name is currently not checked.  It may
    eventually be used to cross-check the length of the provided hash
    value.  It is suggested that the correct hash name is given - even if
    a truncated hash value is used.
    
    Finally this patch adds a way to pass the hash algorithm and flag
    values to the signing module.  "rfc6979" as been implemented as a new
    but not yet used flag.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/cipher/dsa.c b/cipher/dsa.c
index 55805e2..7652c19 100644
--- a/cipher/dsa.c
+++ b/cipher/dsa.c
@@ -1,6 +1,7 @@
 /* dsa.c - DSA signature algorithm
  * Copyright (C) 1998, 2000, 2001, 2002, 2003,
  *               2006, 2008  Free Software Foundation, Inc.
+ * Copyright (C) 2013 g10 Code GmbH.
  *
  * This file is part of Libgcrypt.
  *
@@ -539,7 +540,7 @@ check_secret_key( DSA_secret_key *sk )
    Make a DSA signature from HASH and put it into r and s.
  */
 static void
-sign(gcry_mpi_t r, gcry_mpi_t s, gcry_mpi_t hash, DSA_secret_key *skey )
+sign (gcry_mpi_t r, gcry_mpi_t s, gcry_mpi_t hash, DSA_secret_key *skey )
 {
   gcry_mpi_t k;
   gcry_mpi_t kinv;
@@ -929,7 +930,22 @@ dsa_sign (int algo, gcry_mpi_t *resarr, gcry_mpi_t data, gcry_mpi_t *skey,
       sk.x = skey[4];
       resarr[0] = mpi_alloc (mpi_get_nlimbs (sk.p));
       resarr[1] = mpi_alloc (mpi_get_nlimbs (sk.p));
-      sign (resarr[0], resarr[1], data, &sk);
+      if (mpi_is_opaque (data))
+        {
+          const void *abuf;
+          unsigned int abits;
+          gcry_mpi_t a;
+
+          abuf = gcry_mpi_get_opaque (data, &abits);
+          err = gcry_mpi_scan (&a, GCRYMPI_FMT_USG, abuf, abits/8, NULL);
+          if (!err)
+            {
+              sign (resarr[0], resarr[1], a, &sk);
+              gcry_mpi_release (a);
+            }
+        }
+      else
+        sign (resarr[0], resarr[1], data, &sk);
     }
   return err;
 }
@@ -954,8 +970,26 @@ dsa_verify (int algo, gcry_mpi_t hash, gcry_mpi_t *data, gcry_mpi_t *pkey,
       pk.q = pkey[1];
       pk.g = pkey[2];
       pk.y = pkey[3];
-      if (! verify (data[0], data[1], hash, &pk))
-	err = GPG_ERR_BAD_SIGNATURE;
+      if (mpi_is_opaque (hash))
+        {
+          const void *abuf;
+          unsigned int abits;
+          gcry_mpi_t a;
+
+          abuf = gcry_mpi_get_opaque (hash, &abits);
+          err = gcry_mpi_scan (&a, GCRYMPI_FMT_USG, abuf, abits/8, NULL);
+          if (!err)
+            {
+              if (!verify (data[0], data[1], a, &pk))
+                err = GPG_ERR_BAD_SIGNATURE;
+              gcry_mpi_release (a);
+            }
+        }
+      else
+        {
+          if (!verify (data[0], data[1], hash, &pk))
+            err = GPG_ERR_BAD_SIGNATURE;
+        }
     }
   return err;
 }
diff --git a/cipher/ecc.c b/cipher/ecc.c
index e4b1799..725dfbe 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
@@ -1347,7 +1347,24 @@ ecc_sign (int algo, gcry_mpi_t *resarr, gcry_mpi_t data, gcry_mpi_t *skey,
 
   resarr[0] = mpi_alloc (mpi_get_nlimbs (sk.E.p));
   resarr[1] = mpi_alloc (mpi_get_nlimbs (sk.E.p));
-  err = sign (data, &sk, resarr[0], resarr[1]);
+
+  if (mpi_is_opaque (data))
+    {
+      const void *abuf;
+      unsigned int abits;
+      gcry_mpi_t a;
+
+      abuf = gcry_mpi_get_opaque (data, &abits);
+      err = gcry_mpi_scan (&a, GCRYMPI_FMT_USG, abuf, abits/8, NULL);
+      if (!err)
+        {
+          err = sign (a, &sk, resarr[0], resarr[1]);
+          gcry_mpi_release (a);
+        }
+    }
+  else
+    err = sign (data, &sk, resarr[0], resarr[1]);
+
   if (err)
     {
       mpi_free (resarr[0]);
@@ -1394,7 +1411,22 @@ ecc_verify (int algo, gcry_mpi_t hash, gcry_mpi_t *data, gcry_mpi_t *pkey,
       return err;
     }
 
-  err = verify (hash, &pk, data[0], data[1]);
+  if (mpi_is_opaque (hash))
+    {
+      const void *abuf;
+      unsigned int abits;
+      gcry_mpi_t a;
+
+      abuf = gcry_mpi_get_opaque (hash, &abits);
+      err = gcry_mpi_scan (&a, GCRYMPI_FMT_USG, abuf, abits/8, NULL);
+      if (!err)
+        {
+          err = verify (a, &pk, data[0], data[1]);
+          gcry_mpi_release (a);
+        }
+    }
+  else
+    err = verify (hash, &pk, data[0], data[1]);
 
   point_free (&pk.E.G);
   point_free (&pk.Q);
diff --git a/cipher/elgamal.c b/cipher/elgamal.c
index 128dd99..b40d132 100644
--- a/cipher/elgamal.c
+++ b/cipher/elgamal.c
@@ -763,6 +763,9 @@ elg_sign (int algo, gcry_mpi_t *resarr, gcry_mpi_t data, gcry_mpi_t *skey,
   (void)flags;
   (void)hashalgo;
 
+  if (mpi_is_opaque (data))
+    return GPG_ERR_INV_DATA;
+
   if ((! data)
       || (! skey[0]) || (! skey[1]) || (! skey[2]) || (! skey[3]))
     err = GPG_ERR_BAD_MPI;
@@ -792,6 +795,9 @@ elg_verify (int algo, gcry_mpi_t hash, gcry_mpi_t *data, gcry_mpi_t *pkey,
   (void)cmp;
   (void)opaquev;
 
+  if (mpi_is_opaque (hash))
+    return GPG_ERR_INV_DATA;
+
   if ((! data[0]) || (! data[1]) || (! hash)
       || (! pkey[0]) || (! pkey[1]) || (! pkey[2]))
     err = GPG_ERR_BAD_MPI;
diff --git a/cipher/pubkey.c b/cipher/pubkey.c
index 23a4358..606cedf 100644
--- a/cipher/pubkey.c
+++ b/cipher/pubkey.c
@@ -37,7 +37,8 @@ static gcry_err_code_t pubkey_decrypt (int algo, gcry_mpi_t *result,
                                        gcry_mpi_t *data, gcry_mpi_t *skey,
                                        int flags);
 static gcry_err_code_t pubkey_sign (int algo, gcry_mpi_t *resarr,
-                                    gcry_mpi_t hash, gcry_mpi_t *skey);
+                                    gcry_mpi_t hash, gcry_mpi_t *skey,
+                                    struct pk_encoding_ctx *ctx);
 static gcry_err_code_t pubkey_verify (int algo, gcry_mpi_t hash,
                                       gcry_mpi_t *data, gcry_mpi_t *pkey,
 				     int (*cmp) (void *, gcry_mpi_t),
@@ -712,7 +713,7 @@ pubkey_decrypt (int algorithm, gcry_mpi_t *result, gcry_mpi_t *data,
  */
 static gcry_err_code_t
 pubkey_sign (int algorithm, gcry_mpi_t *resarr, gcry_mpi_t data,
-             gcry_mpi_t *skey)
+             gcry_mpi_t *skey, struct pk_encoding_ctx *ctx)
 {
   gcry_pk_spec_t *pubkey;
   gcry_module_t module;
@@ -732,7 +733,8 @@ pubkey_sign (int algorithm, gcry_mpi_t *resarr, gcry_mpi_t data,
   if (module)
     {
       pubkey = (gcry_pk_spec_t *) module->spec;
-      rc = pubkey->sign (algorithm, resarr, data, skey, 0, 0);
+      rc = pubkey->sign (algorithm, resarr, data, skey,
+                         ctx->flags, ctx->hash_algo);
       _gcry_module_release (module);
       goto ready;
     }
@@ -2477,7 +2479,7 @@ sexp_to_enc (gcry_sexp_t sexp, gcry_mpi_t **retarray, gcry_module_t *retalgo,
    (<mpi>)
    or
    (data
-    [(flags [raw, pkcs1, oaep, pss, no-blinding])]
+    [(flags [raw, direct, pkcs1, oaep, pss, no-blinding, rfc6979])]
     [(hash <algo> <value>)]
     [(value <text>)]
     [(hash-algo <algo>)]
@@ -2504,8 +2506,9 @@ sexp_data_to_mpi (gcry_sexp_t input, gcry_mpi_t *ret_mpi,
   int i;
   size_t n;
   const char *s;
-  int unknown_flag=0;
+  int unknown_flag = 0;
   int parsed_flags = 0;
+  int explicit_raw = 0;
 
   *ret_mpi = NULL;
   ldata = gcry_sexp_find_token (input, "data", 0);
@@ -2525,9 +2528,14 @@ sexp_data_to_mpi (gcry_sexp_t input, gcry_mpi_t *ret_mpi,
             s = gcry_sexp_nth_data (lflags, i, &n);
             if (!s)
               ; /* not a data element*/
+	    else if (n == 7 && ! memcmp (s, "rfc6979", 7))
+	      parsed_flags |= PUBKEY_FLAG_RFC6979;
             else if ( n == 3 && !memcmp (s, "raw", 3)
                       && ctx->encoding == PUBKEY_ENC_UNKNOWN)
-              ctx->encoding = PUBKEY_ENC_RAW;
+              {
+                ctx->encoding = PUBKEY_ENC_RAW;
+                explicit_raw = 1;
+              }
             else if ( n == 5 && !memcmp (s, "pkcs1", 5)
                       && ctx->encoding == PUBKEY_ENC_UNKNOWN)
               ctx->encoding = PUBKEY_ENC_PKCS1;
@@ -2557,8 +2565,47 @@ sexp_data_to_mpi (gcry_sexp_t input, gcry_mpi_t *ret_mpi,
     rc = GPG_ERR_INV_OBJ; /* none or both given */
   else if (unknown_flag)
     rc = GPG_ERR_INV_FLAG;
+  else if (ctx->encoding == PUBKEY_ENC_RAW && lhash
+           && (explicit_raw || (parsed_flags & PUBKEY_FLAG_RFC6979)))
+    {
+      /* Raw encoding along with a hash element.  This is commonly
+         used for DSA.  For better backward error compatibility we
+         allow this only if either the rfc6979 flag has been given or
+         the raw flags was explicitly given.  */
+      if (gcry_sexp_length (lhash) != 3)
+        rc = GPG_ERR_INV_OBJ;
+      else if ( !(s=gcry_sexp_nth_data (lhash, 1, &n)) || !n )
+        rc = GPG_ERR_INV_OBJ;
+      else
+        {
+          void *value;
+          size_t valuelen;
+
+	  ctx->hash_algo = get_hash_algo (s, n);
+          if (!ctx->hash_algo)
+            rc = GPG_ERR_DIGEST_ALGO;
+          else if (!(value=gcry_sexp_nth_buffer (lhash, 2, &valuelen)))
+            rc = GPG_ERR_INV_OBJ;
+          else if ((valuelen * 8) < valuelen)
+            {
+              gcry_free (value);
+              rc = GPG_ERR_TOO_LARGE;
+            }
+          else
+            *ret_mpi = gcry_mpi_set_opaque (NULL, value, valuelen*8);
+        }
+    }
   else if (ctx->encoding == PUBKEY_ENC_RAW && lvalue)
     {
+      /* RFC6969 may only be used with the a hash value and not the
+         MPI based value.  */
+      if (parsed_flags & PUBKEY_FLAG_RFC6979)
+        {
+          rc = GPG_ERR_CONFLICT;
+          goto leave;
+        }
+
+      /* Get the value */
       *ret_mpi = gcry_sexp_nth_mpi (lvalue, 1, GCRYMPI_FMT_USG);
       if (!*ret_mpi)
         rc = GPG_ERR_INV_OBJ;
@@ -3214,7 +3261,7 @@ gcry_pk_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_hash, gcry_sexp_t s_skey)
       rc = gpg_err_code_from_syserror ();
       goto leave;
     }
-  rc = pubkey_sign (module->mod_id, result, hash, skey);
+  rc = pubkey_sign (module->mod_id, result, hash, skey, &ctx);
   if (rc)
     goto leave;
 
diff --git a/cipher/rsa.c b/cipher/rsa.c
index 4787f81..c9fcebf 100644
--- a/cipher/rsa.c
+++ b/cipher/rsa.c
@@ -700,7 +700,7 @@ stronger_key_check ( RSA_secret_key *skey )
  * Where m is OUTPUT, c is INPUT and d,n,p,q,u are elements of SKEY.
  */
 static void
-secret(gcry_mpi_t output, gcry_mpi_t input, RSA_secret_key *skey )
+secret (gcry_mpi_t output, gcry_mpi_t input, RSA_secret_key *skey )
 {
   if (!skey->p || !skey->q || !skey->u)
     {
@@ -1002,6 +1002,9 @@ rsa_sign (int algo, gcry_mpi_t *resarr, gcry_mpi_t data, gcry_mpi_t *skey,
   (void)flags;
   (void)hashalgo;
 
+  if (mpi_is_opaque (data))
+    return GPG_ERR_INV_DATA;
+
   sk.n = skey[0];
   sk.e = skey[1];
   sk.d = skey[2];
@@ -1028,6 +1031,9 @@ rsa_verify (int algo, gcry_mpi_t hash, gcry_mpi_t *data, gcry_mpi_t *pkey,
   (void)cmp;
   (void)opaquev;
 
+  if (mpi_is_opaque (hash))
+    return GPG_ERR_INV_DATA;
+
   pk.n = pkey[0];
   pk.e = pkey[1];
   result = gcry_mpi_new ( 160 );
diff --git a/tests/basic.c b/tests/basic.c
index 88ae131..46e213c 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -3073,6 +3073,14 @@ check_pubkey_sign_ecdsa (int n, gcry_sexp_t skey, gcry_sexp_t pkey)
     int dummy;
   } datas[] =
     {
+      { 192,
+        "(data (flags raw)\n"
+        " (value #00112233445566778899AABBCCDDEEFF0001020304050607#))",
+        0,
+        "(data (flags raw)\n"
+        " (value #80112233445566778899AABBCCDDEEFF0001020304050607#))",
+        0
+      },
       { 256,
         "(data (flags raw)\n"
         " (value #00112233445566778899AABBCCDDEEFF"
@@ -3083,12 +3091,14 @@ check_pubkey_sign_ecdsa (int n, gcry_sexp_t skey, gcry_sexp_t pkey)
         /* */    "000102030405060708090A0B0C0D0E0F#))",
         0
       },
-      { 192,
+      { 256,
         "(data (flags raw)\n"
-        " (value #00112233445566778899AABBCCDDEEFF0001020304050607#))",
+        " (hash sha256 #00112233445566778899AABBCCDDEEFF"
+        /* */          "000102030405060708090A0B0C0D0E0F#))",
         0,
         "(data (flags raw)\n"
-        " (value #80112233445566778899AABBCCDDEEFF0001020304050607#))",
+        " (hash sha256 #80112233445566778899AABBCCDDEEFF"
+        /* */          "000102030405060708090A0B0C0D0E0F#))",
         0
       },
       { 0, NULL }

commit 2d3e8d4d9562d666420aadd9ffa8ac0456a1cd91
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Jul 19 15:54:03 2013 +0200

    sexp: Add function gcry_sexp_nth_buffer.
    
    * src/sexp.c (gcry_sexp_nth_buffer): New.
    * src/visibility.c, src/visibility.h: Add function wrapper.
    * src/libgcrypt.vers, src/libgcrypt.def: Add to API.
    * src/gcrypt.h.in: Add prototype.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/NEWS b/NEWS
index b1ad7ac..508b943 100644
--- a/NEWS
+++ b/NEWS
@@ -73,6 +73,7 @@ Noteworthy changes in version 1.6.0 (unreleased)
  GCRYCTL_DISABLE_LOCKED_SECMEM   NEW.
  GCRYCTL_DISABLE_PRIV_DROP       NEW.
  GCRY_CIPHER_SALSA20             NEW.
+ gcry_sexp_nth_buffer            NEW.
 
 
 Noteworthy changes in version 1.5.0 (2011-06-29)
diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi
index cfc0174..770a245 100644
--- a/doc/gcrypt.texi
+++ b/doc/gcrypt.texi
@@ -3596,6 +3596,30 @@ printf ("my name is %.*s\n", (int)len, name);
 @end example
 @end deftypefun
 
+ at deftypefun {void *} gcry_sexp_nth_buffer (@w{const gcry_sexp_t @var{list}}, @w{int @var{number}}, @w{size_t *@var{rlength}})
+
+This function is used to get data from a @var{list}.  A malloced
+buffer with the actual data at list index @var{number} is returned and
+the length of this buffer will be stored to @var{rlength}.  If there
+is no data at the given index or the index represents another list,
+ at code{NULL} is returned.  The caller must release the result using
+ at code{gcry_free}.
+
+ at noindent
+Here is an example on how to extract and print the CRC value from the
+S-expression @samp{(hash crc32 #23ed00d7)}:
+
+ at example
+size_t len;
+char *value;
+
+value = gcry_sexp_nth_buffer (list, 2, &len);
+if (value)
+  fwrite (value, len, 1, stdout);
+gcry_free (value);
+ at end example
+ at end deftypefun
+
 @deftypefun {char *} gcry_sexp_nth_string (@w{gcry_sexp_t @var{list}}, @w{int @var{number}})
 
 This function is used to get and convert data from a @var{list}. The
diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in
index 6bd615d..06d6663 100644
--- a/src/gcrypt.h.in
+++ b/src/gcrypt.h.in
@@ -423,6 +423,13 @@ gcry_sexp_t gcry_sexp_cadr (const gcry_sexp_t list);
 const char *gcry_sexp_nth_data (const gcry_sexp_t list, int number,
                                 size_t *datalen);
 
+/* This function is used to get data from a LIST.  A malloced buffer to the
+   data with index NUMBER is returned and the length of this
+   data will be stored to RLENGTH.  If there is no data at the given
+   index or the index represents another list, `NULL' is returned.  */
+void *gcry_sexp_nth_buffer (const gcry_sexp_t list, int number,
+                            size_t *rlength);
+
 /* This function is used to get and convert data from a LIST.  The
    data is assumed to be a Nul terminated string.  The caller must
    release the returned value using `gcry_free'.  If there is no data
diff --git a/src/libgcrypt.def b/src/libgcrypt.def
index 9eaf8a7..bbc8f43 100644
--- a/src/libgcrypt.def
+++ b/src/libgcrypt.def
@@ -236,3 +236,8 @@ EXPORTS
       gcry_pubkey_get_sexp      @212
 
       _gcry_mpi_get_const       @213
+
+      gcry_sexp_get_buffer      @214
+
+
+;; end of file with public symbols for Windows.
diff --git a/src/libgcrypt.vers b/src/libgcrypt.vers
index 6aaf0f1..473ee68 100644
--- a/src/libgcrypt.vers
+++ b/src/libgcrypt.vers
@@ -72,7 +72,7 @@ GCRYPT_1.6 {
     gcry_sexp_build_array; gcry_sexp_cadr; gcry_sexp_canon_len;
     gcry_sexp_car; gcry_sexp_cdr; gcry_sexp_cons; gcry_sexp_create;
     gcry_sexp_dump; gcry_sexp_find_token; gcry_sexp_length;
-    gcry_sexp_new; gcry_sexp_nth; gcry_sexp_nth_data;
+    gcry_sexp_new; gcry_sexp_nth; gcry_sexp_nth_buffer; gcry_sexp_nth_data;
     gcry_sexp_nth_mpi; gcry_sexp_prepend; gcry_sexp_release;
     gcry_sexp_sprint; gcry_sexp_sscan; gcry_sexp_vlist;
     gcry_sexp_nth_string;
diff --git a/src/sexp.c b/src/sexp.c
index 62126d3..6dedf4e 100644
--- a/src/sexp.c
+++ b/src/sexp.c
@@ -1,6 +1,7 @@
 /* sexp.c  -  S-Expression handling
  * Copyright (C) 1999, 2000, 2001, 2002, 2003,
  *               2004, 2006, 2007, 2008, 2011  Free Software Foundation, Inc.
+ * Copyright (C) 2013 g10 Code GmbH
  *
  * This file is part of Libgcrypt.
  *
@@ -713,6 +714,30 @@ gcry_sexp_nth_data (const gcry_sexp_t list, int number, size_t *datalen )
 }
 
 
+/* Get the nth element of a list which needs to be a simple object.
+   The returned value is a malloced buffer and needs to be freed by
+   the caller.  This is basically the same as gcry_sexp_nth_data but
+   with an allocated result. */
+void *
+gcry_sexp_nth_buffer (const gcry_sexp_t list, int number, size_t *rlength)
+{
+  const char *s;
+  size_t n;
+  char *buf;
+
+  *rlength = 0;
+  s = sexp_nth_data (list, number, &n);
+  if (!s || !n)
+    return NULL;
+  buf = gcry_malloc (n);
+  if (!buf)
+    return NULL;
+  memcpy (buf, s, n);
+  *rlength = n;
+  return buf;
+}
+
+
 /* Get a string from the car.  The returned value is a malloced string
    and needs to be freed by the caller.  */
 char *
@@ -733,6 +758,7 @@ gcry_sexp_nth_string (const gcry_sexp_t list, int number)
   return buf;
 }
 
+
 /*
  * Get a MPI from the car
  */
diff --git a/src/visibility.c b/src/visibility.c
index c86d31b..bb51d58 100644
--- a/src/visibility.c
+++ b/src/visibility.c
@@ -226,6 +226,12 @@ gcry_sexp_nth_data (const gcry_sexp_t list, int number, size_t *datalen)
   return _gcry_sexp_nth_data (list, number, datalen);
 }
 
+void *
+gcry_sexp_nth_buffer (const gcry_sexp_t list, int number, size_t *rlength)
+{
+  return _gcry_sexp_nth_buffer (list, number, rlength);
+}
+
 char *
 gcry_sexp_nth_string (gcry_sexp_t list, int number)
 {
diff --git a/src/visibility.h b/src/visibility.h
index 4837ed6..54da016 100644
--- a/src/visibility.h
+++ b/src/visibility.h
@@ -133,14 +133,15 @@
 #define gcry_sexp_length            _gcry_sexp_length
 #define gcry_sexp_new               _gcry_sexp_new
 #define gcry_sexp_nth               _gcry_sexp_nth
+#define gcry_sexp_nth_buffer        _gcry_sexp_nth_buffer
 #define gcry_sexp_nth_data          _gcry_sexp_nth_data
 #define gcry_sexp_nth_mpi           _gcry_sexp_nth_mpi
+#define gcry_sexp_nth_string        _gcry_sexp_nth_string
 #define gcry_sexp_prepend           _gcry_sexp_prepend
 #define gcry_sexp_release           _gcry_sexp_release
 #define gcry_sexp_sprint            _gcry_sexp_sprint
 #define gcry_sexp_sscan             _gcry_sexp_sscan
 #define gcry_sexp_vlist             _gcry_sexp_vlist
-#define gcry_sexp_nth_string        _gcry_sexp_nth_string
 
 #define gcry_mpi_add                _gcry_mpi_add
 #define gcry_mpi_add_ui             _gcry_mpi_add_ui
@@ -348,14 +349,15 @@ gcry_err_code_t gcry_md_get (gcry_md_hd_t hd, int algo,
 #undef gcry_sexp_length
 #undef gcry_sexp_new
 #undef gcry_sexp_nth
+#undef gcry_sexp_nth_buffer
 #undef gcry_sexp_nth_data
 #undef gcry_sexp_nth_mpi
+#undef gcry_sexp_nth_string
 #undef gcry_sexp_prepend
 #undef gcry_sexp_release
 #undef gcry_sexp_sprint
 #undef gcry_sexp_sscan
 #undef gcry_sexp_vlist
-#undef gcry_sexp_nth_string
 
 #undef gcry_mpi_add
 #undef gcry_mpi_add_ui
@@ -524,14 +526,15 @@ MARK_VISIBLE (gcry_sexp_find_token)
 MARK_VISIBLE (gcry_sexp_length)
 MARK_VISIBLE (gcry_sexp_new)
 MARK_VISIBLE (gcry_sexp_nth)
+MARK_VISIBLE (gcry_sexp_nth_buffer)
 MARK_VISIBLE (gcry_sexp_nth_data)
 MARK_VISIBLE (gcry_sexp_nth_mpi)
+MARK_VISIBLE (gcry_sexp_nth_string)
 MARK_VISIBLE (gcry_sexp_prepend)
 MARK_VISIBLE (gcry_sexp_release)
 MARK_VISIBLE (gcry_sexp_sprint)
 MARK_VISIBLE (gcry_sexp_sscan)
 MARK_VISIBLE (gcry_sexp_vlist)
-MARK_VISIBLE (gcry_sexp_nth_string)
 
 MARK_VISIBLE (gcry_mpi_add)
 MARK_VISIBLE (gcry_mpi_add_ui)

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

Summary of changes:
 NEWS               |    1 +
 cipher/dsa.c       |   42 ++++++++++++++++++++++++++++++++---
 cipher/ecc.c       |   36 +++++++++++++++++++++++++++++-
 cipher/elgamal.c   |    6 +++++
 cipher/pubkey.c    |   61 ++++++++++++++++++++++++++++++++++++++++++++++------
 cipher/rsa.c       |    8 ++++++-
 doc/gcrypt.texi    |   24 ++++++++++++++++++++
 src/gcrypt.h.in    |    7 ++++++
 src/libgcrypt.def  |    5 ++++
 src/libgcrypt.vers |    2 +-
 src/sexp.c         |   26 ++++++++++++++++++++++
 src/visibility.c   |    6 +++++
 src/visibility.h   |    9 +++++--
 tests/basic.c      |   16 +++++++++++--
 14 files changed, 228 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org




More information about the Gnupg-commits mailing list