aboutsummaryrefslogtreecommitdiffstats
path: root/g10/decrypt-data.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/decrypt-data.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/decrypt-data.c')
-rw-r--r--g10/decrypt-data.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/g10/decrypt-data.c b/g10/decrypt-data.c
index 6c1d6ebcd..bdc3e2214 100644
--- a/g10/decrypt-data.c
+++ b/g10/decrypt-data.c
@@ -242,10 +242,8 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek,
if ( opt.verbose && !dek->algo_info_printed )
{
if (!openpgp_cipher_test_algo (dek->algo))
- log_info (_("%s.%s encrypted data\n"),
- openpgp_cipher_algo_name (dek->algo),
- ed->aead_algo? openpgp_aead_algo_name (ed->aead_algo)
- /**/ : "CFB");
+ log_info (_("%s encrypted data\n"),
+ openpgp_cipher_algo_mode_name (dek->algo, ed->aead_algo));
else
log_info (_("encrypted with unknown algorithm %d\n"), dek->algo );
dek->algo_info_printed = 1;
@@ -265,7 +263,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek,
if (!gnupg_cipher_is_allowed (opt.compliance, 0, dek->algo, ciphermode))
{
log_error (_("cipher algorithm '%s' may not be used in %s mode\n"),
- openpgp_cipher_algo_name (dek->algo),
+ openpgp_cipher_algo_mode_name (dek->algo,ed->aead_algo),
gnupg_compliance_option_string (opt.compliance));
*compliance_error = 1;
if (opt.flags.require_compliance)