[git] GnuPG - branch, master, updated. gnupg-2.2.7-255-g69930f6

by NIIBE Yutaka cvs at cvs.gnupg.org
Thu Nov 8 12:57:30 CET 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 Privacy Guard".

The branch, master has been updated
       via  69930f6884a934207f7aa523cf6d2b8e22dfe666 (commit)
      from  7fc3decc2e038be905d47701c7ce196ed86a725b (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 69930f6884a934207f7aa523cf6d2b8e22dfe666
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Nov 8 20:52:38 2018 +0900

    gpgcompose: Fix --sk-esk.
    
    * g10/gpgcompose.c (sk_esk): Copy the result content correctly.
    Don't forget to free the result.
    
    --
    
    Fixes-commit: 0131d4369a81a51bf7bb328cc81a3bb082ed1a94
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/gpgcompose.c b/g10/gpgcompose.c
index b3f7ecd..9b69015 100644
--- a/g10/gpgcompose.c
+++ b/g10/gpgcompose.c
@@ -2281,16 +2281,27 @@ sk_esk (const char *option, int argc, char *argv[], void *cookie)
     /* Encrypt the session key using the s2k specifier.  */
     {
       DEK *sesdekp = &sesdek;
+      void *enckey;
+      size_t enckeylen;
 
       /* Now encrypt the session key (or rather, the algorithm used to
-         encrypt the SKESK plus the session key) using ENCKEY.  */
-      err = encrypt_seskey (&s2kdek, 0, &sesdekp,
-                            (void**)&ske->seskey, (size_t *)&ske->seskeylen);
+         encrypt the SKESK plus the session key) using S2KDEK.  */
+      err = encrypt_seskey (&s2kdek, 0, &sesdekp, &enckey, &enckeylen);
+
       if (err)
         log_fatal ("encrypt_seskey failed: %s\n", gpg_strerror (err));
 
+      if (enckeylen - 1 > sesdek.keylen)
+        log_fatal ("key size is too big: %z\n", enckeylen);
+      else
+        {
+          ske->seskeylen = (byte)enckeylen;
+          memcpy (ske->seskey, enckey, enckeylen);
+        }
+
       /* Save the session key for later.  */
       session_key = sesdek;
+      xfree (enckey);
     }
 
   pkt.pkttype = PKT_SYMKEY_ENC;

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

Summary of changes:
 g10/gpgcompose.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list