[git] GnuPG - branch, master, updated. gnupg-2.2.3-118-g7356d6e

by Werner Koch cvs at cvs.gnupg.org
Sun Jan 21 17:05:51 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  7356d6ec50ea24bc9449187e1c2b3ecd717b789f (commit)
      from  3f4ca85cb0cf58006417f4f7faafaa9a1f1bdf22 (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 7356d6ec50ea24bc9449187e1c2b3ecd717b789f
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Jan 21 16:42:29 2018 +0100

    gpg: Support EAX if for latest Libgcrypt.
    
    * g10/cipher-aead.c (MY_GCRY_CIPHER_MODE_EAX): New.
    (write_header): Use it.
    * g10/decrypt-data.c (MY_GCRY_CIPHER_MODE_EAX): New.
    (decrypt_data): Use it.
    * g10/misc.c (openpgp_aead_test_algo): Allow EAX.
    --
    
    This allows the use of EAX when the latest Libgcrypt master is used.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/cipher-aead.c b/g10/cipher-aead.c
index f247a83..1d72634 100644
--- a/g10/cipher-aead.c
+++ b/g10/cipher-aead.c
@@ -33,6 +33,11 @@
 #include "options.h"
 #include "main.h"
 
+/* FIXME: Libgcrypt 1.9 will support EAX.  Until we kame this a
+ * requirement we hardwire the enum used for EAX.  */
+#define MY_GCRY_CIPHER_MODE_EAX 14
+
+
 /* The size of the buffer we allocate to encrypt the data.  This must
  * be a multiple of the OCB blocksize (16 byte).  */
 #define AEAD_ENC_BUFFER_SIZE (64*1024)
@@ -151,6 +156,11 @@ write_header (cipher_filter_context_t *cfx, iobuf_t a)
       startivlen = 15;
       break;
 
+    case AEAD_ALGO_EAX:
+      ciphermode = MY_GCRY_CIPHER_MODE_EAX;
+      startivlen = 16;
+      break;
+
     default:
       log_error ("unsupported AEAD algo %d\n", cfx->dek->use_aead);
       err = gpg_error (GPG_ERR_NOT_IMPLEMENTED);
diff --git a/g10/decrypt-data.c b/g10/decrypt-data.c
index 80e16ec..79e2554 100644
--- a/g10/decrypt-data.c
+++ b/g10/decrypt-data.c
@@ -31,6 +31,10 @@
 #include "../common/status.h"
 #include "../common/compliance.h"
 
+/* FIXME: Libgcrypt 1.9 will support EAX.  Until we kame this a
+ * requirement we hardwire the enum used for EAX.  */
+#define MY_GCRY_CIPHER_MODE_EAX 14
+
 
 static int aead_decode_filter (void *opaque, int control, iobuf_t a,
                                byte *buf, size_t *ret_len);
@@ -278,9 +282,8 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
           break;
         case AEAD_ALGO_EAX:
           startivlen = 16;
-          log_error ("unsupported AEAD algo %d\n", ed->aead_algo);
-          rc = gpg_error (GPG_ERR_NOT_IMPLEMENTED);
-          goto leave;
+          ciphermode = MY_GCRY_CIPHER_MODE_EAX;
+          break;
         default:
           log_error ("unknown AEAD algo %d\n", ed->aead_algo);
           rc = gpg_error (GPG_ERR_INV_CIPHER_MODE);
diff --git a/g10/misc.c b/g10/misc.c
index 2da0d27..f7ac3c7 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -591,7 +591,6 @@ openpgp_aead_test_algo (aead_algo_t algo)
     case AEAD_ALGO_NONE:
       break;
     case AEAD_ALGO_EAX:
-      return gpg_error (GPG_ERR_NOT_SUPPORTED);
     case AEAD_ALGO_OCB:
       return 0;
     }

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

Summary of changes:
 g10/cipher-aead.c  | 10 ++++++++++
 g10/decrypt-data.c |  9 ++++++---
 g10/misc.c         |  1 -
 3 files changed, 16 insertions(+), 4 deletions(-)


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




More information about the Gnupg-commits mailing list