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

gpg: Print a warning if the (draft) Kyber algorithm is used.

* g10/keygen.c (do_generate_keypair): Check for draf Kyber stuff.
This commit is contained in:
Werner Koch 2024-07-05 11:12:12 +02:00
parent ca3b8d2541
commit 6a40cfa6c0
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 73 additions and 3 deletions

View file

@ -1400,8 +1400,13 @@ write_keybinding (ctrl_t ctrl, kbnode_t root,
&& gnupg_rng_is_compliant (CO_DE_VS))
oduap.cpl_notation = "de-vs";
else if ((use & PUBKEY_USAGE_ENC)
&& sub_pk->pubkey_algo == PUBKEY_ALGO_KYBER)
oduap.cpl_notation = "fips203.ipd.2023-08-24";
&& sub_pk->pubkey_algo == PUBKEY_ALGO_KYBER
&& PUBKEY_ALGO_KYBER == 29)
{
/* FIXME: This can be removed as soon as we have implemented the
* final fips-203 specification. */
oduap.cpl_notation = "fips203.ipd.2023-08-24";
}
else
oduap.cpl_notation = NULL;
oduap.pk = sub_pk;
@ -6488,6 +6493,7 @@ do_generate_keypair (ctrl_t ctrl, struct para_data_s *para,
}
else
{
kbnode_t node;
PKT_public_key *pk = find_kbnode (pub_root,
PKT_PUBLIC_KEY)->pkt->pkt.public_key;
print_status_key_created (did_sub? 'B':'P', pk,
@ -6495,6 +6501,18 @@ do_generate_keypair (ctrl_t ctrl, struct para_data_s *para,
es_fflush (es_stdout);
if (any_adsk)
log_info (_("Note: The key has been created with one or more ADSK!\n"));
for (node=pub_root; node; node = node->next)
if ((node->pkt->pkttype == PKT_PUBLIC_KEY
|| node->pkt->pkttype == PKT_PUBLIC_SUBKEY)
&& node->pkt->pkt.public_key->pubkey_algo == PUBKEY_ALGO_KYBER)
{
log_info ("Note: The key uses the Kyber algorithm from"
" a draft specification\n");
log_info (" This is EXPERIMENTAL only;"
" the final version will not be compatible!\n");
break;
}
}
release_kbnode (pub_root);