aboutsummaryrefslogtreecommitdiffstats
path: root/g10/packet.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-01-10 10:42:38 +0000
committerWerner Koch <[email protected]>2018-01-10 10:51:03 +0000
commit8217cd49364b9f81b390f7ca6a608dd946f93efc (patch)
treecd6d10a7d9d9db4af692c9d67ec359cabff5a6b9 /g10/packet.h
parentdoc: Include NEWS from 2.2.4 (diff)
downloadgnupg-8217cd49364b9f81b390f7ca6a608dd946f93efc.tar.gz
gnupg-8217cd49364b9f81b390f7ca6a608dd946f93efc.zip
gpg: Add option and preference framework for AEAD.
* common/openpgpdefs.h (aead_algo_t): New. (SIGSUBPKT_PREF_AEAD): New. * g10/gpg.c (oAEADAlgo, oPersonalAEADPreferences): New. (opts): New options --aead-algo and --personal-aead-preferences. (set_compliance_option): Clar aead algo. (main): Parse and check the new options * g10/options.h (struct opt): Add fields def_aead_algo and personal_aead_prefs. * g10/packet.h (PREFTYPE_AEAD): New enum value. (PKT_user_id): Add field flags.aead. (PKT_public_key): Add field flags.aead. * g10/pkclist.c (select_algo_from_prefs): Support PREFTYPE_AEAD. * g10/getkey.c (fixup_uidnode): Set AEAD flag. (merge_selfsigs): Ditto. * g10/kbnode.c (dump_kbnode): Show aead flag. * g10/keyedit.c (show_prefs): Ditto. (show_key_with_all_names_colon): Ditto. * g10/keygen.c (aead_presf, n_aead_prefs): New vars. (set_one_pref): Suppport PREFTYPE_AEAD. (keygen_set_std_prefs): Parse AEAD preferences. (keygen_get_std_prefs): Ditto. (add_feature_aead): New. (keygen_upd_std_prefs): Call that and build AEAD pref packet. * g10/main.h (DEFAULT_AEAD_ALGO): New const. * g10/misc.c (openpgp_aead_test_algo): New. (openpgp_aead_algo_name): New. (string_to_aead_algo): New. (default_aead_algo): New. -- This is only used in --rfc4880bis mode and not really tested. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/packet.h')
-rw-r--r--g10/packet.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/g10/packet.h b/g10/packet.h
index 8dca88b75..894b38946 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -72,7 +72,8 @@ typedef enum {
PREFTYPE_NONE = 0,
PREFTYPE_SYM = 1,
PREFTYPE_HASH = 2,
- PREFTYPE_ZIP = 3
+ PREFTYPE_ZIP = 3,
+ PREFTYPE_AEAD = 4
} preftype_t;
typedef struct {
@@ -290,6 +291,7 @@ typedef struct
struct
{
unsigned int mdc:1;
+ unsigned int aead:1;
unsigned int ks_modify:1;
unsigned int compacted:1;
unsigned int primary:2; /* 2 if set via the primary flag, 1 if calculated */
@@ -386,6 +388,7 @@ typedef struct
struct
{
unsigned int mdc:1; /* MDC feature set. */
+ unsigned int aead:1; /* AEAD feature set. */
unsigned int disabled_valid:1;/* The next flag is valid. */
unsigned int disabled:1; /* The key has been disabled. */
unsigned int primary:1; /* This is a primary key. */
@@ -471,7 +474,7 @@ typedef struct {
Note: this is ignored when encrypting. */
byte is_partial;
/* If 0, MDC is disabled. Otherwise, the MDC method that was used
- (currently, only DIGEST_ALGO_SHA1 is supported). */
+ (only DIGEST_ALGO_SHA1 has ever been defined). */
byte mdc_method;
/* An iobuf holding the data to be decrypted. (This is not used for
encryption!) */