aboutsummaryrefslogtreecommitdiffstats
path: root/g10/decrypt-data.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-01-23 11:07:25 +0000
committerWerner Koch <[email protected]>2018-01-23 11:07:57 +0000
commit9aab9167bca38323973e853845ca95ae8e9b6871 (patch)
treef06594e52ed3722b0cc37979c7d6d3829dcb0d96 /g10/decrypt-data.c
parentgpg: Unify AEAD parameter retrieval. (diff)
downloadgnupg-9aab9167bca38323973e853845ca95ae8e9b6871.tar.gz
gnupg-9aab9167bca38323973e853845ca95ae8e9b6871.zip
gpg: Implement AEAD for SKESK packets.
* g10/packet.h (PKT_symkey_enc): Add field aead_algo. * g10/build-packet.c (do_symkey_enc): Support version 5 packets. * g10/parse-packet.c (parse_symkeyenc): Ditto. * g10/encrypt.c (encrypt_symmetric): Force using a random session key in AEAD mode. (encrypt_seskey): Add and support arg aead_algo. (write_symkey_enc): Ditto. (encrypt_simple): Adjust accordingly. (encrypt_filter): Ditto. * g10/gpgcompose.c (sk_esk): For now call encrypt_seskey without AEAD support. * g10/mainproc.c (symkey_decrypt_seskey): Support AEAD. Nver call BUG but return an error. (proc_symkey_enc): Call symkey_decrypt_seskey in a bug compatible way. * g10/import.c (check_prefs): Check AEAD preferences. * g10/keyedit.c (show_prefs): Print AEAD preferences. -- For easier debugging this patch also changes some diagnostics to also print the encryption mode with the cipher algorithm. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/decrypt-data.c')
-rw-r--r--g10/decrypt-data.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/g10/decrypt-data.c b/g10/decrypt-data.c
index 7ed0bf006..46650f269 100644
--- a/g10/decrypt-data.c
+++ b/g10/decrypt-data.c
@@ -212,8 +212,10 @@ 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 encrypted data\n"),
- openpgp_cipher_algo_name (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");
else
log_info (_("encrypted with unknown algorithm %d\n"), dek->algo );
dek->algo_info_printed = 1;