Jussi Kivilinna | 27 Jul 11:04 2015
Picon
Picon

[PATCH 1/6] Add OCB bulk mode for AES SSSE3 implementation

* cipher/rijndael-ssse3-amd64.c (SSSE3_STATE_SIZE): New.
[HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] (vpaes_ssse3_prepare): Use
'ssse3_state' for storing current SSSE3 state.
[HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS]
(vpaes_ssse3_cleanup): Restore SSSE3 state from 'ssse3_state'.
(_gcry_aes_ssse3_do_setkey, _gcry_aes_ssse3_prepare_decryption)
(_gcry_aes_ssse3_encrypt, _gcry_aes_ssse3_cfb_enc)
(_gcry_aes_ssse3_cbc_enc, _gcry_aes_ssse3_ctr_enc)
(_gcry_aes_ssse3_decrypt, _gcry_aes_ssse3_cfb_dec)
(_gcry_aes_ssse3_cbc_dec, _gcry_aes_ssse3_cbc_dec): Add 'ssse3_state'
array.
(get_l, ssse3_ocb_enc, ssse3_ocb_dec, _gcry_aes_ssse3_ocb_crypt)
(_gcry_aes_ssse3_ocb_auth): New.
* cipher/rijndael.c (_gcry_aes_ssse3_ocb_crypt)
(_gcry_aes_ssse3_ocb_auth): New.
(_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth) [USE_SSSE3]: Use SSSE3
implementation for OCB.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna <at> iki.fi>
---
 cipher/rijndael-ssse3-amd64.c |  305 ++++++++++++++++++++++++++++++++++++++++-
 cipher/rijndael.c             |   19 +++
 2 files changed, 320 insertions(+), 4 deletions(-)

diff --git a/cipher/rijndael-ssse3-amd64.c b/cipher/rijndael-ssse3-amd64.c
index 21438dc..0cdb532 100644
--- a/cipher/rijndael-ssse3-amd64.c
+++ b/cipher/rijndael-ssse3-amd64.c
 <at>  <at>  -45,6 +45,7  <at>  <at> 
(Continue reading)

by Peter Wu | 26 Jul 16:00 2015
Picon

[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-237-g46c0726

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  46c072669eb81ed610cc5b3c0dc0c75a143afbb4 (commit)
      from  ada0a7d302cca97b327faaacac7a5d0b8043df88 (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 46c072669eb81ed610cc5b3c0dc0c75a143afbb4
Author: Peter Wu <peter <at> lekensteyn.nl>
Date:   Sun Jul 26 16:50:33 2015 +0300

    Fix undefined behavior wrt memcpy

    * cipher/cipher-gcm.c: Do not copy zero bytes from an empty buffer. Let
    the function continue to add padding as needed though.
    * cipher/mac-poly1305.c: If the caller requested to finish the hash
    function without a copy of the result, return immediately.
    --
    Caught by UndefinedBehaviorSanitizer.

    Signed-off-by: Peter Wu <peter <at> lekensteyn.nl>

diff --git a/cipher/cipher-gcm.c b/cipher/cipher-gcm.c
index 6b13fc5..3711a1d 100644
(Continue reading)

by Peter Wu | 23 Jul 14:51 2015
Picon

[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-236-gada0a7d

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  ada0a7d302cca97b327faaacac7a5d0b8043df88 (commit)
      from  da500a030481a3c534e933b642e6f051aa064b97 (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 ada0a7d302cca97b327faaacac7a5d0b8043df88
Author: Peter Wu <peter <at> lekensteyn.nl>
Date:   Thu Jul 9 17:11:33 2015 +0200

    build: ignore scissor line for the commit-msg hook

    * build-aux/git-hooks/commit-msg: Stop processing more lines when the
      scissor line is encountered.
    --
    This allows the command `git commit -v` to work even if the code is
    longer than 72 characters. Note that comments are already ignored by the
    previous line.

    Signed-off-by: Peter Wu <peter <at> lekensteyn.nl>

diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg
index 5a697c7..3ca918b 100755
(Continue reading)

by Werner Koch | 23 Jul 14:47 2015
Picon

[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-235-gda500a0

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  da500a030481a3c534e933b642e6f051aa064b97 (commit)
      from  9cd55e8e948f0049cb23495f536decf797d072f7 (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 da500a030481a3c534e933b642e6f051aa064b97
Author: Werner Koch <wk <at> gnupg.org>
Date:   Thu Jul 23 14:38:49 2015 +0200

    Register DCO for Peter Wu.

    --

diff --git a/AUTHORS b/AUTHORS
index 1e34aed..42d5ee6 100644
--- a/AUTHORS
+++ b/AUTHORS
 <at>  <at>  -165,6 +165,9  <at>  <at>  Markus Teich <markus dot teich at stusta dot mhn dot de>
 Milan Broz <gmazyland <at> gmail.com>
 2014-01-13:52D44CC6.4050707 <at> gmail.com:

+Peter Wu <peter <at> lekensteyn.nl>
(Continue reading)

Peter Wu | 22 Jul 21:13 2015
Picon

DCO signature

Libgcrypt Developer's Certificate of Origin.  Version 1.0
=========================================================

By making a contribution to the Libgcrypt project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the free software license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the
    best of my knowledge, is covered under an appropriate free
    software license and I have the right under that license to
    submit that work with modifications, whether created in whole
    or in part by me, under the same free software license
    (unless I am permitted to submit under a different license),
    as indicated in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including
    all personal information I submit with it, including my
    sign-off) is maintained indefinitely and may be redistributed
    consistent with this project or the free software license(s)
    involved.

Signed-off-by: Peter Wu <peter <at> lekensteyn.nl>
(Continue reading)

by Peter Wu | 16 Jul 07:12 2015
Picon

[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-234-g9cd55e8

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  9cd55e8e948f0049cb23495f536decf797d072f7 (commit)
      from  0f9532b186c1e0b54d7e7a6d76bce82b6226122b (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 9cd55e8e948f0049cb23495f536decf797d072f7
Author: Peter Wu <peter <at> lekensteyn.nl>
Date:   Thu Jul 16 13:59:44 2015 +0900

    rsa: Fix error in comments.

    * cipher/rsa.c: Fix.

    --

    Signed-off-by: Peter Wu <peter <at> lekensteyn.nl>

diff --git a/cipher/rsa.c b/cipher/rsa.c
index 9a8d235..e4f73d5 100644
--- a/cipher/rsa.c
+++ b/cipher/rsa.c
 <at>  <at>  -738,7 +738,7  <at>  <at>  secret (gcry_mpi_t output, gcry_mpi_t input, RSA_secret_key *skey )
(Continue reading)

by Peter Wu | 14 Jul 02:55 2015
Picon

[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-233-g0f9532b

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  0f9532b186c1e0b54d7e7a6d76bce82b6226122b (commit)
      from  2a7aa3ea4d03a9c808d5888f5509c08cd27aa27c (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 0f9532b186c1e0b54d7e7a6d76bce82b6226122b
Author: Peter Wu <peter <at> lekensteyn.nl>
Date:   Tue Jul 14 09:53:38 2015 +0900

    sexp: Fix invalid deallocation in error path.

    * src/sexp.c: Fix wrong condition.

    --

    Signed-off-by: Peter Wu <peter <at> lekensteyn.nl>

diff --git a/src/sexp.c b/src/sexp.c
index 9bc13ca..1c014e0 100644
--- a/src/sexp.c
+++ b/src/sexp.c
 <at>  <at>  -2405,7 +2405,7  <at>  <at>  _gcry_sexp_vextract_param (gcry_sexp_t sexp, const char *path,
(Continue reading)

by Peter Wu | 10 Jul 03:30 2015
Picon

[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-232-g2a7aa3e

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  2a7aa3ea4d03a9c808d5888f5509c08cd27aa27c (commit)
      from  0a7547e487a8bc4e7ac9599c55579eb2e4a13f06 (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 2a7aa3ea4d03a9c808d5888f5509c08cd27aa27c
Author: Peter Wu <peter <at> lekensteyn.nl>
Date:   Fri Jul 10 10:15:26 2015 +0900

    ecc: fix memory leak.

    * cipher/ecc.c (ecc_verify): Release memory which was allocated before
    by _gcry_pk_util_preparse_sigval.
    (ecc_decrypt_raw): Likewise.

    --

    Caught by LeakSanitizer (LSan). Now the test suite (make check) passes
    with no memleaks.

    Signed-off-by: Peter Wu <peter <at> lekensteyn.nl>

(Continue reading)

Peter Wu | 9 Jul 17:11 2015
Picon

[PATCH 0/6] Memory leaks and undefined behavior fixes

Hi,

Here are some small patches which fixes memory leaks and undefined
behavior (copying from/to a NULL buffer). These were caught by running
the test suite with ASAN and ubsan enabled.

There is also a patch to the commit-msg hook such that it does not
complain for the diff in `git commit -v`.

The "Add LSan annotation to ignore a memory leak" patch "works" in the
sense that the memory leak gets ignored.

Finally there is a patch to clarify the RSA secret calculation. This was
the original reason why I dug into the libgcrypt code. (I suspected a
bug in this code, but it turns out that Wireshark had an issue by
passing u = q^-1 mod p in the private key instead of u = p^-1 mod q.)

Kind regards,
Peter
--

Peter Wu (6):
  sexp: fix invalid deallocation in error path
  ecc: fix memory leak
  build: ignore scissor line for the commit-msg hook
  Fix undefined behavior wrt memcpy
  Add LSan annotation to ignore a memory leak
  rsa: clarify the RSA secret parameters

 build-aux/git-hooks/commit-msg |  6 ++++++
(Continue reading)

Ed Johns | 7 Jul 17:52 2015
Picon

[PATCH] Curve25519 encryption support (experimental)

Hello,

I was interested in trying your Curve25519 encryption support. I've downloaded the latest alpha code. I see that the patch exists.

Would you have a test case that I could used to get started with this patch?

Thanks

Ed Johns
_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel <at> gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
by NIIBE Yutaka | 7 Jul 04:09 2015
Picon

[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-231-g0a7547e

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  0a7547e487a8bc4e7ac9599c55579eb2e4a13f06 (commit)
      from  a36ee7501f68ad7ebcfe31f9659430b9d2c3ddd1 (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 0a7547e487a8bc4e7ac9599c55579eb2e4a13f06
Author: NIIBE Yutaka <gniibe <at> fsij.org>
Date:   Mon Jul 6 12:01:00 2015 +0900

    ecc: fix memory leaks.

    cipher/ecc.c (ecc_generate): Fix memory leak on error of
    _gcry_pk_util_parse_flaglist and _gcry_ecc_eddsa_encodepoint.
    (ecc_check_secret_key): Fix memory leak on error of
    _gcry_ecc_update_curve_param.
    (ecc_sign, ecc_verify, ecc_encrypt_raw, ecc_decrypt_raw): Remove
    unnecessary sexp_release and fix memory leak on error of
    _gcry_ecc_fill_in_curve.
    (ecc_decrypt_raw): Fix double free of the point kG and memory leak
    on error of _gcry_ecc_os2ec.

diff --git a/cipher/ecc.c b/cipher/ecc.c
index 5ffe84b..f5bc50a 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
 <at>  <at>  -551,7 +551,6  <at>  <at>  ecc_generate (const gcry_sexp_t genparms, gcry_sexp_t *r_skey)
     return GPG_ERR_NO_OBJ; /* No NBITS parameter. */

   rc = _gcry_ecc_fill_in_curve (nbits, curve_name, &E, &nbits);
-  xfree (curve_name); curve_name = NULL;
   if (rc)
     goto leave;

 <at>  <at>  -595,10 +594,9  <at>  <at>  ecc_generate (const gcry_sexp_t genparms, gcry_sexp_t *r_skey)
                                         !!(flags & PUBKEY_FLAG_COMP),
                                         &encpk, &encpklen);
       if (rc)
-        return rc;
+        goto leave;
       public = mpi_new (0);
       mpi_set_opaque (public, encpk, encpklen*8);
-      encpk = NULL;
     }
   else
     {
 <at>  <at>  -691,6 +689,7  <at>  <at>  ecc_generate (const gcry_sexp_t genparms, gcry_sexp_t *r_skey)
   mpi_free (Qx);
   mpi_free (Qy);
   _gcry_mpi_ec_free (ctx);
+  xfree (curve_name);
   sexp_release (curve_flags);
   sexp_release (curve_info);
   return rc;
 <at>  <at>  -744,7 +743,7  <at>  <at>  ecc_check_secret_key (gcry_sexp_t keyparms)
                                              &sk.E.p, &sk.E.a, &sk.E.b,
                                              &mpi_g, &sk.E.n, &sk.E.h);
           if (rc)
-            return rc;
+            goto leave;
         }
     }
   if (mpi_g)
 <at>  <at>  -877,7 +876,6  <at>  <at>  ecc_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms)
         goto leave;
     }
   /* Add missing parameters using the optional curve parameter.  */
-  sexp_release (l1);
   l1 = sexp_find_token (keyparms, "curve", 5);
   if (l1)
     {
 <at>  <at>  -886,7 +884,7  <at>  <at>  ecc_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms)
         {
           rc = _gcry_ecc_fill_in_curve (0, curvename, &sk.E, NULL);
           if (rc)
-            return rc;
+            goto leave;
         }
     }
   /* Guess required fields if a curve parameter has not been given.
 <at>  <at>  -1043,7 +1041,6  <at>  <at>  ecc_verify (gcry_sexp_t s_sig, gcry_sexp_t s_data, gcry_sexp_t s_keyparms)
         goto leave;
     }
   /* Add missing parameters using the optional curve parameter.  */
-  sexp_release (l1);
   l1 = sexp_find_token (s_keyparms, "curve", 5);
   if (l1)
     {
 <at>  <at>  -1052,7 +1049,7  <at>  <at>  ecc_verify (gcry_sexp_t s_sig, gcry_sexp_t s_data, gcry_sexp_t s_keyparms)
         {
           rc = _gcry_ecc_fill_in_curve (0, curvename, &pk.E, NULL);
           if (rc)
-            return rc;
+            goto leave;
         }
     }
   /* Guess required fields if a curve parameter has not been given.
 <at>  <at>  -1252,7 +1249,6  <at>  <at>  ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms)
         goto leave;
     }
   /* Add missing parameters using the optional curve parameter.  */
-  sexp_release (l1);
   l1 = sexp_find_token (keyparms, "curve", 5);
   if (l1)
     {
 <at>  <at>  -1261,7 +1257,7  <at>  <at>  ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms)
         {
           rc = _gcry_ecc_fill_in_curve (0, curvename, &pk.E, NULL);
           if (rc)
-            return rc;
+            goto leave;
         }
     }
   /* Guess required fields if a curve parameter has not been given.  */
 <at>  <at>  -1421,7 +1417,6  <at>  <at>  ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
         goto leave;
     }
   /* Add missing parameters using the optional curve parameter.  */
-  sexp_release (l1);
   l1 = sexp_find_token (keyparms, "curve", 5);
   if (l1)
     {
 <at>  <at>  -1430,7 +1425,7  <at>  <at>  ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
         {
           rc = _gcry_ecc_fill_in_curve (0, curvename, &sk.E, NULL);
           if (rc)
-            return rc;
+            goto leave;
         }
     }
   /* Guess required fields if a curve parameter has not been given.  */
 <at>  <at>  -1467,10 +1462,7  <at>  <at>  ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
    */
   rc = _gcry_ecc_os2ec (&kG, data_e);
   if (rc)
-    {
-      point_free (&kG);
-      return rc;
-    }
+    goto leave;

   ec = _gcry_mpi_ec_p_internal_new (sk.E.model, sk.E.dialect, 0,
                                     sk.E.p, sk.E.a, sk.E.b);

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

Summary of changes:
 cipher/ecc.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

hooks/post-receive
--

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

_______________________________________________
Gnupg-commits mailing list
Gnupg-commits <at> gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits

Gmane