aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS6
-rw-r--r--src/conversion.c18
-rw-r--r--src/gpgme.c4
-rw-r--r--src/gpgme.h.in4
-rw-r--r--src/keylist.c2
5 files changed, 31 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index bb978ede..249eab3e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,10 @@
-Noteworthy changes in version 2.2.1 (unreleased) [C__/A_/R0]
+Noteworthy changes in version 2.3.0 (unreleased) [C__/A_/R0]
------------------------------------------------
+ * Interface changes relative to the 2.2.0 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPGME_PK_MLKEM NEW.
+ GPGME_PK_MLDSA NEW.
Release-info: https://dev.gnupg.org/T8427
diff --git a/src/conversion.c b/src/conversion.c
index 11e03e9c..b36457c1 100644
--- a/src/conversion.c
+++ b/src/conversion.c
@@ -693,6 +693,24 @@ _gpgme_map_pk_algo (int algo, gpgme_protocol_t protocol)
case 19: algo = GPGME_PK_ECDSA; break;
case 20: break;
case 22: algo = GPGME_PK_EDDSA; break;
+
+ case 25: algo = GPGME_PK_ECDH; break; /* X25519 (RFC9580). */
+ case 27: algo = GPGME_PK_EDDSA; break; /* Ed25519 (RFC9580). */
+
+ case 30: /* ML-DSA-65+Ed25519 (RFC9980) */
+ case 31: /* ML-DSA-87+Ed448 (RFC9980) */
+ algo = GPGME_PK_MLDSA;
+ break;
+
+ case 35: /* ML-KEM-768+X25519 (RFC9980) */
+ case 36: /* ML-KEM-1024+X448 (RFC9980) */
+ case 37: /* ML-KEM-768+ECDH-NIST-P-384 */
+ case 38: /* ML-KEM-1024+ECDH-NIST-P-521 */
+ case 39: /* ML-KEM-768+ECDH-brainpoolP384r1 */
+ case 40: /* ML-KEM-1024+ECDH-brainpoolP512r1 */
+ algo = GPGME_PK_MLKEM;
+ break;
+
default: algo = 0; break; /* Unknown. */
}
}
diff --git a/src/gpgme.c b/src/gpgme.c
index 7025b20b..ec99a131 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -1328,6 +1328,8 @@ gpgme_pubkey_algo_string (gpgme_subkey_t subkey)
case GPGME_PK_ECDH:
case GPGME_PK_ECDSA:
case GPGME_PK_EDDSA: prefix = ""; break;
+ case GPGME_PK_MLDSA: composite = 1; break;
+ case GPGME_PK_MLKEM: composite = 1; break;
}
if (composite && subkey->curve)
@@ -1366,6 +1368,8 @@ gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo)
case GPGME_PK_ECDSA: return "ECDSA";
case GPGME_PK_ECDH: return "ECDH";
case GPGME_PK_EDDSA: return "EdDSA";
+ case GPGME_PK_MLDSA: return "MLDSA";
+ case GPGME_PK_MLKEM: return "MLKEM";
default: return NULL;
}
}
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index 54dba0be..54c5c900 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -277,7 +277,9 @@ typedef enum
GPGME_PK_ELG = 20,
GPGME_PK_ECDSA = 301,
GPGME_PK_ECDH = 302,
- GPGME_PK_EDDSA = 303
+ GPGME_PK_EDDSA = 303,
+ GPGME_PK_MLKEM = 331, /* Kyber (ML-KEM). */
+ GPGME_PK_MLDSA = 332 /* Dilithium (ML-DSA). */
}
gpgme_pubkey_algo_t;
diff --git a/src/keylist.c b/src/keylist.c
index 31b5b5c3..06a0de7f 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -791,7 +791,7 @@ keylist_colon_handler (void *priv, char *line)
return err;
}
- /* Field 17 has the curve name for ECC. */
+ /* Field 17 has the curve name for ECC or the composite algo string. */
if (fields >= 17 && *field[16])
{
subkey->curve = strdup (field[16]);