mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Support decryption of the new AEAD packet
* common/openpgpdefs.h (aead_algo_t): New.
(pkttype_t): Add PKT_ENCRYPTED_AEAD.
* g10/decrypt-data.c (struct decode_filter_context_s): Add fields for
AEAD.
(aead_set_nonce_and_ad): New.
(aead_checktag): New.
(decrypt_data): Support AEAD.
(aead_underflow): New.
(aead_decode_filter): New.
* g10/dek.h (DEK): Add field use_aead. Turn use_mdc,
algo_info_printed, and symmetric into bit flags.
* g10/mainproc.c (struct mainproc_context): Add field
seen_pkt_encrypted_aead.
(release_list): Clear it.
(have_seen_pkt_encrypted_aead): New.
(symkey_decrypt_seskey): Support AEAD.
(proc_symkey_enc): Ditto.
(proc_encrypted): Ditto.
(proc_plaintext): Ditto.
* g10/misc.c (MY_GCRY_CIPHER_MODE_EAX): New.
(openpgp_aead_test_algo): New.
(openpgp_aead_algo_name): New.
(openpgp_aead_algo_info): New.
* g10/packet.h (PKT_symkey_enc): Add field use_aead.
(PKT_user_id): Add field flags.aead
(PKT_public_key): Ditto.
(PKT_encrypted): Add fields for AEAD.
* g10/parse-packet.c (parse): Handle PKT_ENCRYPTED_AEAD.
(parse_symkeyenc): Support AEAD.
(parse_encrypted): Ditto.
(dump_sig_subpkt): Dump AEAD preference packet.
(parse_encrypted_aead): New.
--
This patch allows to decrypt data encrypted using the new AEAD
mechanism as specified in rfc4880bis. Although preferences are used
to enable this new mode, it is useful to have at least a decryption
option in case a user switches between GnuPG 2.2 and newer versions.
The new AEAD mechanism is much faster than the current CFB+MDC and
thus 2.2 will allow faster decryption of symmetric only decryption.
This patch is based on the current master (2.3) code base and includes
a few other patches. In particular
commit 44be675b75
(gpg: More check for symmetric key encryption.)
is included.
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
144b95cc9d
commit
1dfe71c62b
10 changed files with 907 additions and 68 deletions
|
@ -122,6 +122,12 @@ int openpgp_cipher_blocklen (cipher_algo_t algo);
|
|||
int openpgp_cipher_test_algo(cipher_algo_t algo);
|
||||
const char *openpgp_cipher_algo_name (cipher_algo_t algo);
|
||||
|
||||
gpg_error_t openpgp_aead_test_algo (aead_algo_t algo);
|
||||
const char *openpgp_aead_algo_name (aead_algo_t algo);
|
||||
gpg_error_t openpgp_aead_algo_info (aead_algo_t algo,
|
||||
enum gcry_cipher_modes *r_mode,
|
||||
unsigned int *r_noncelen);
|
||||
|
||||
pubkey_algo_t map_pk_gcry_to_openpgp (enum gcry_pk_algos algo);
|
||||
int openpgp_pk_test_algo (pubkey_algo_t algo);
|
||||
int openpgp_pk_test_algo2 (pubkey_algo_t algo, unsigned int use);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue