diff options
author | Werner Koch <wk@gnupg.org> | 2024-04-11 15:56:21 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2024-04-11 15:56:21 +0200 |
commit | 813f8d1b8e4b6c4365f0bd2a5305bdbe1e049d05 (patch) | |
tree | e8c88bf44d695c7d1e3d8186e52324f9b12c9aaf /g10/mainproc.c | |
parent | agent: Add more diagnostics to PQC decryption. (diff) | |
download | gnupg2-813f8d1b8e4b6c4365f0bd2a5305bdbe1e049d05.tar.xz gnupg2-813f8d1b8e4b6c4365f0bd2a5305bdbe1e049d05.zip |
gpg: Changed internal data format for Kyber.
* g10/packet.h (PKT_pubkey_enc): Add field seskey_algo.
(struct pubkey_enc_list): Ditto.
* g10/misc.c (pubkey_get_nenc): Change value for Kyber from 4 to 3.
* g10/parse-packet.c (parse_pubkeyenc): Store the Kyber algo in the
new field and adjust data. Do not store the length byte in data[2].
* g10/build-packet.c (do_pubkey_enc): Take the session algo for Kyber
from the new field.
* g10/encrypt.c (write_pubkey_enc): Ses the seskey_algo.
* g10/mainproc.c (proc_pubkey_enc): Copy it.
* g10/pubkey-enc.c (get_it): Support Kyber decryption.
* g10/seskey.c (encode_session_key): Handle Kyber different from ECDH.
--
Having always the single byte in the packet data than to store and
retrieve it from an MPI is much easier. Thus this patch changes the
original internal format. With this chnages decryption of the slighly
modified test data works now. See the bug tracker for test data.
GnuPG-bug-id: 6815
Diffstat (limited to 'g10/mainproc.c')
-rw-r--r-- | g10/mainproc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c index 6f3254e88..48bc463c5 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -529,6 +529,7 @@ proc_pubkey_enc (CTX c, PACKET *pkt) x->keyid[1] = enc->keyid[1]; x->pubkey_algo = enc->pubkey_algo; x->result = -1; + x->seskey_algo = enc->seskey_algo; x->data[0] = x->data[1] = x->data[2] = x->data[3] = NULL; if (enc->data[0]) { |