aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2022-03-18 12:50:18 +0000
committerWerner Koch <[email protected]>2022-03-18 13:19:24 +0000
commit06b70daa505d3679985be47b6834f8ed7b64d6a9 (patch)
treee82bfa2e7b1f53244d9c6c64983196c361835fa3 /g10/misc.c
parentcommon: New function map_static_strings (diff)
downloadgnupg-06b70daa505d3679985be47b6834f8ed7b64d6a9.tar.gz
gnupg-06b70daa505d3679985be47b6834f8ed7b64d6a9.zip
gpg: Print info about the used AEAD algorithm in the compliance msg.
* g10/misc.c (openpgp_cipher_algo_mode_name): New. * g10/decrypt-data.c (decrypt_data): Use function here. -- Note that openpgp_cipher_algo_mode_name is different from the version 2.2 becuase we append ".CFB" here. Without this change we would see gpg: cipher algorithm 'AES256' may not be used in --compliance=de-vs mode This is confusing because AES256 is compliant. Now we see gpg: cipher algorithm 'AES256.OCB' may not be used in --compliance=de-vs mode which gives a hint on the problem.
Diffstat (limited to 'g10/misc.c')
-rw-r--r--g10/misc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/g10/misc.c b/g10/misc.c
index 2a431b137..581601209 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -614,6 +614,19 @@ openpgp_cipher_algo_name (cipher_algo_t algo)
}
+/* Same as openpgp_cipher_algo_name but returns a string in the form
+ * "ALGO.MODE". If AEAD is 0 "CFB" is used for the mode. */
+const char *
+openpgp_cipher_algo_mode_name (cipher_algo_t algo, aead_algo_t aead)
+{
+ return map_static_strings ("openpgp_cipher_algo_mode_name", algo, aead,
+ openpgp_cipher_algo_name (algo),
+ ".",
+ aead? openpgp_aead_algo_name (aead) : "CFB",
+ NULL);
+}
+
+
/* Return 0 if ALGO is supported. Return an error if not. */
gpg_error_t
openpgp_aead_test_algo (aead_algo_t algo)