summaryrefslogtreecommitdiffstats
path: root/g10/keylist.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2024-11-14 14:04:50 +0100
committerWerner Koch <wk@gnupg.org>2024-11-14 14:04:50 +0100
commit7e066f614a60c1f6bea601f72a330a57474d088c (patch)
tree28ca772d2bb3006014f7bfd9459968211176aca4 /g10/keylist.c
parentgpg: Add option to create Kyber with --full-gen-key. (diff)
downloadgnupg2-7e066f614a60c1f6bea601f72a330a57474d088c.tar.xz
gnupg2-7e066f614a60c1f6bea601f72a330a57474d088c.zip
gpg: For composite algos add the algo string to the colons listings.
* g10/keylist.c (list_keyblock_colon): Put the algo string into the curve field for Kyber. -- GnuPG-bug-id: 6638
Diffstat (limited to 'g10/keylist.c')
-rw-r--r--g10/keylist.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/g10/keylist.c b/g10/keylist.c
index 1fe39433b..499bdf91f 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -1882,6 +1882,7 @@ list_keyblock_colon (ctrl_t ctrl, kbnode_t keyblock,
unsigned int keylength;
char *curve = NULL;
const char *curvename = NULL;
+ char pkstrbuf[PUBKEY_STRING_SIZE];
/* Get the keyid from the keyblock. */
node = find_kbnode (keyblock, PKT_PUBLIC_KEY);
@@ -1971,6 +1972,14 @@ list_keyblock_colon (ctrl_t ctrl, kbnode_t keyblock,
curvename = curve;
es_fputs (curvename, es_stdout);
}
+ else if (pk->pubkey_algo == PUBKEY_ALGO_KYBER)
+ {
+ /* Note that Kyber should actually not appear here because it is
+ * the primary key and Kyber is not able to certify. But we
+ * prepare it here for future composite algorithms and in case
+ * of faulty packets. */
+ es_fputs (pubkey_string (pk, pkstrbuf, sizeof pkstrbuf), es_stdout);
+ }
es_putc (':', es_stdout); /* End of field 17. */
print_compliance_flags (pk, keylength, curvename);
es_putc (':', es_stdout); /* End of field 18 (compliance). */
@@ -2122,6 +2131,11 @@ list_keyblock_colon (ctrl_t ctrl, kbnode_t keyblock,
curvename = curve;
es_fputs (curvename, es_stdout);
}
+ else if (pk2->pubkey_algo == PUBKEY_ALGO_KYBER)
+ {
+ es_fputs (pubkey_string (pk2, pkstrbuf, sizeof pkstrbuf),
+ es_stdout);
+ }
es_putc (':', es_stdout); /* End of field 17. */
print_compliance_flags (pk2, keylength, curvename);
es_putc (':', es_stdout); /* End of field 18. */