From 03d53c88ccf53a282d994fbc9978dba9b51f8ce1 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 5 Apr 2024 16:16:53 +0200 Subject: 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 --- common/openpgp-oid.c | 1 + common/sexputil.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/openpgp-oid.c b/common/openpgp-oid.c index ceb211dd3..bc82cc6b0 100644 --- a/common/openpgp-oid.c +++ b/common/openpgp-oid.c @@ -623,6 +623,7 @@ map_gcry_pk_to_openpgp (enum gcry_pk_algos algo) case GCRY_PK_EDDSA: return PUBKEY_ALGO_EDDSA; case GCRY_PK_ECDSA: return PUBKEY_ALGO_ECDSA; case GCRY_PK_ECDH: return PUBKEY_ALGO_ECDH; + case GCRY_PK_KEM: return PUBKEY_ALGO_KYBER; default: return algo < 110 ? (pubkey_algo_t)algo : 0; } } diff --git a/common/sexputil.c b/common/sexputil.c index c7471be85..e6fc84da0 100644 --- a/common/sexputil.c +++ b/common/sexputil.c @@ -992,7 +992,7 @@ get_pk_algo_from_key (gcry_sexp_t key) gcry_sexp_t list; const char *s; size_t n; - char algoname[6]; + char algoname[10]; int algo = 0; list = gcry_sexp_nth (key, 1); -- cgit v1.2.3