1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpg: Some support to allow Kyber decryption.

* g10/call-agent.c (agent_pkdecrypt): Support dual keygrips and switch
to KEM mode.
* g10/ecdh.c (pk_ecdh_decrypt): Add an extra length check.
* g10/keyid.c (do_hash_public_key): Fix Kyber fingerprint computation.

* g10/mainproc.c (release_list): Free all 4 data elements.
(proc_pubkey_enc): Copy all 4 data elements.
* g10/misc.c (openpgp_pk_test_algo2): Map Kyber to KEM.

* g10/parse-packet.c (parse_pubkeyenc): Fix Kyber parser.
* g10/pubkey-enc.c (get_session_key): Allow Kyber.
(get_it): Support Kyber.
--

GnuPG-bug-id: 6815
This commit is contained in:
Werner Koch 2024-04-09 11:00:35 +02:00
parent 1a37f0080b
commit 52c4b09080
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
7 changed files with 67 additions and 15 deletions

View file

@ -143,6 +143,8 @@ release_list( CTX c )
mpi_release (c->pkenc_list->data[0]);
mpi_release (c->pkenc_list->data[1]);
mpi_release (c->pkenc_list->data[2]);
mpi_release (c->pkenc_list->data[3]);
xfree (c->pkenc_list);
c->pkenc_list = tmp;
}
@ -527,11 +529,13 @@ proc_pubkey_enc (CTX c, PACKET *pkt)
x->keyid[1] = enc->keyid[1];
x->pubkey_algo = enc->pubkey_algo;
x->result = -1;
x->data[0] = x->data[1] = NULL;
x->data[0] = x->data[1] = x->data[2] = x->data[3] = NULL;
if (enc->data[0])
{
x->data[0] = mpi_copy (enc->data[0]);
x->data[1] = mpi_copy (enc->data[1]);
x->data[2] = mpi_copy (enc->data[2]);
x->data[3] = mpi_copy (enc->data[3]);
}
x->next = c->pkenc_list;
c->pkenc_list = x;