[git] GCRYPT - branch, LIBGCRYPT-1.8-BRANCH, updated. libgcrypt-1.8.2-10-gbbf88f0

by Stephan Mueller cvs at cvs.gnupg.org
Tue Apr 17 17:56:53 CEST 2018


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, LIBGCRYPT-1.8-BRANCH has been updated
       via  bbf88f0e9d481486ceca079e2611e84db8d039c7 (commit)
      from  a0e016e29409ccd78966a5eb82dea236ad44d9c9 (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 bbf88f0e9d481486ceca079e2611e84db8d039c7
Author: Stephan Mueller <smueller at chronox.de>
Date:   Mon Mar 12 22:24:37 2018 +0100

    AES-KW: fix in-place encryption
    
    * cipher/cipher-aeswrap.c: move memmove call before KW IV setting
    --
    
    In case AES-KW in-place encryption is performed, the plaintext must be
    moved to the correct destination location before the first semiblock of
    the destination buffer is modified. Without the patch, the first
    semiblock of the plaintext is overwritten with a6a6a6a6a6a6a6a6.
    
    Signed-off-by: Stephan Mueller <smueller at chronox.de>
    (cherry picked from commit 330ec66e0babdabb658dc7d6db78f37b2a1b996e)

diff --git a/cipher/cipher-aeswrap.c b/cipher/cipher-aeswrap.c
index 698742d..a8d0e03 100644
--- a/cipher/cipher-aeswrap.c
+++ b/cipher/cipher-aeswrap.c
@@ -70,6 +70,9 @@ _gcry_cipher_aeswrap_encrypt (gcry_cipher_hd_t c,
   a = outbuf;  /* We store A directly in OUTBUF.  */
   b = c->u_ctr.ctr;  /* B is also used to concatenate stuff.  */
 
+  /* Copy the inbuf to the outbuf. */
+  memmove (r+8, inbuf, inbuflen);
+
   /* If an IV has been set we use that IV as the Alternative Initial
      Value; if it has not been set we use the standard value.  */
   if (c->marks.iv)
@@ -77,9 +80,6 @@ _gcry_cipher_aeswrap_encrypt (gcry_cipher_hd_t c,
   else
     memset (a, 0xa6, 8);
 
-  /* Copy the inbuf to the outbuf. */
-  memmove (r+8, inbuf, inbuflen);
-
   memset (t, 0, sizeof t); /* t := 0.  */
 
   for (j = 0; j <= 5; j++)

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

Summary of changes:
 cipher/cipher-aeswrap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list