aboutsummaryrefslogtreecommitdiffstats
path: root/g10/dek.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-01-10 16:07:11 +0000
committerWerner Koch <[email protected]>2018-01-10 16:07:11 +0000
commit4e2ba546cdccbbc6d3e29867ee5671fd44d74e67 (patch)
treeed822c35d3c88ba22a4754e2765a02a928e1a6ef /g10/dek.h
parentgpg: Add option and preference framework for AEAD. (diff)
downloadgnupg-4e2ba546cdccbbc6d3e29867ee5671fd44d74e67.tar.gz
gnupg-4e2ba546cdccbbc6d3e29867ee5671fd44d74e67.zip
gpg: New option --force-aead
* g10/dek.h (DEK): Turn fields use_mdc, algo_printed and symmetric into single bit vars. Make sure they are always set to 1 or 0. (DEK): New field use_aead. * g10/options.h (struct opt): New field force_aead. * g10/pkclist.c (select_aead_from_pklist): New. * g10/gpg.c (oForceAEAD): New const. (opts): New options "--force-aead". (main): Set new option. * g10/encrypt.c (use_aead): New. (encrypt_simple): Implement new flags DEK.use_aead. (encrypt_crypt): Ditto. (encrypt_filter): Ditto. * g10/sign.c (sign_symencrypt_file): Ditto. -- This patch should be enough to detect whether AEAD can be used. Not tested. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/dek.h')
-rw-r--r--g10/dek.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/g10/dek.h b/g10/dek.h
index 666810c3d..64e98fca7 100644
--- a/g10/dek.h
+++ b/g10/dek.h
@@ -1,5 +1,5 @@
/* dek.h - The data encryption key structure.
- * Copyright (C) 2014 Werner Koch
+ * Copyright (C) 2014, 2017 Werner Koch
*
* This file is part of GnuPG.
*
@@ -26,14 +26,25 @@ typedef struct
int algo;
/* The length of the key (in bytes). */
int keylen;
+
/* Whether we've already printed information about this key. This
- is currently only used in decrypt_data() and only if we are in
- verbose mode. */
- int algo_info_printed;
- int use_mdc;
+ * is currently only used in decrypt_data() and only if we are in
+ * verbose mode. */
+ int algo_info_printed : 1;
+
+ /* AEAD shall be used. */
+ int use_aead : 1;
+
+ /* MDC shall be used. */
+ int use_mdc : 1;
+
/* This key was read from a SK-ESK packet (see proc_symkey_enc). */
- int symmetric;
- byte key[32]; /* This is the largest used keylen (256 bit). */
+ int symmetric : 1;
+
+ /* This is the largest used keylen (256 bit). */
+ byte key[32];
+
+ /* The cacheid for the S2K. */
char s2k_cacheid[1+16+1];
} DEK;