diff options
author | Werner Koch <wk@gnupg.org> | 2024-04-05 16:16:53 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2024-04-05 16:16:53 +0200 |
commit | 03d53c88ccf53a282d994fbc9978dba9b51f8ce1 (patch) | |
tree | 5aa1794ebeddf4c6f6a54ffe5321168d5e33bc94 /agent | |
parent | agent: Fix error handling of READKEY. (diff) | |
download | gnupg2-03d53c88ccf53a282d994fbc9978dba9b51f8ce1.tar.xz gnupg2-03d53c88ccf53a282d994fbc9978dba9b51f8ce1.zip |
gpg: Allow to create a Kyber key from keygrips.
* agent/cvt-openpgp.c (extract_private_key): Support Kyber algorithms.
* common/openpgp-oid.c (map_gcry_pk_to_openpgp): Map KEM to Kyber.
* common/sexputil.c (get_pk_algo_from_key): Increase buffer for use
with "kyber1024".
* g10/call-agent.c (agent_get_keyinfo): Fix warning.
* g10/keygen.c (do_create_from_keygrip): Support Kyber.
(ask_algo): Ditto.
--
To test create a standard key and the use --edit-key and "addkey" with
selection 13 and use the comma delimited keygrips.
GnuPG-bug-id: 7014
Diffstat (limited to 'agent')
-rw-r--r-- | agent/cvt-openpgp.c | 11 | ||||
-rw-r--r-- | agent/divert-scd.c | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/agent/cvt-openpgp.c b/agent/cvt-openpgp.c index 50755c0fd..420dbb464 100644 --- a/agent/cvt-openpgp.c +++ b/agent/cvt-openpgp.c @@ -1384,6 +1384,17 @@ extract_private_key (gcry_sexp_t s_key, int req_private_key_data, err = gcry_sexp_extract_param (list, NULL, format, array+0, array+1, NULL); } + else if ( !strcmp (name, (algoname = "kyber512")) + || !strcmp (name, (algoname = "kyber768")) + || !strcmp (name, (algoname = "kyber1024"))) + { + format = "/ps?"; + elems = "ps?"; + npkey = 1; + nskey = 2; + err = gcry_sexp_extract_param (list, NULL, format, + array+0, array+1, NULL); + } else { err = gpg_error (GPG_ERR_PUBKEY_ALGO); diff --git a/agent/divert-scd.c b/agent/divert-scd.c index ed0173ea1..4a2bebffa 100644 --- a/agent/divert-scd.c +++ b/agent/divert-scd.c @@ -377,7 +377,7 @@ divert_pksign (ctrl_t ctrl, const unsigned char *grip, } -/* Decrypt the value given asn an S-expression in CIPHER using the +/* Decrypt the value given as an s-expression in CIPHER using the key identified by SHADOW_INFO and return the plaintext in an allocated buffer in R_BUF. The padding information is stored at R_PADDING with -1 for not known. */ |