gpg: Implement AEAD for SKESK packets.
authorWerner Koch <wk@gnupg.org>
Tue, 23 Jan 2018 11:07:25 +0000 (12:07 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 23 Jan 2018 11:07:57 +0000 (12:07 +0100)
commit9aab9167bca38323973e853845ca95ae8e9b6871
treef06594e52ed3722b0cc37979c7d6d3829dcb0d96
parentda3015e3c05030fe709c8f922486e73d06d1d16a
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 <wk@gnupg.org>
g10/build-packet.c
g10/decrypt-data.c
g10/encrypt.c
g10/gpgcompose.c
g10/import.c
g10/keyedit.c
g10/main.h
g10/mainproc.c
g10/packet.h
g10/parse-packet.c
g10/sign.c