Add post-quantum key agreement X25519MLKEM768
This is the successor of X25519Kyber768Draft00.
Spec:
https://datatracker.ietf.org/doc/draft-kwiatkowski-tls-ecdhe-mlkem/02/
IANA has assigned the codepoint.
https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8
Upstream BoringSSL support landed in.
7fb4d3da50
The version of BoringSSL we patch does not include it, so we add it manually.
Chrome and Firefox are planning to enable in October.
This PR is based on the IPD-Wing patch reviewed here:
https://github.com/cloudflare/boring/pull/243
There are two changes. First we simplify the patch a bit as we do not
need IPD-Wing. Secondly, we perform the encapsulation key check, which
was a last minute addition of NIST. We perform this check also for Kyber.
This commit is contained in:
parent
2c0a14253a
commit
6d3639f173
File diff suppressed because it is too large
Load Diff
|
|
@ -74,9 +74,11 @@
|
||||||
//! support by turning on `post-quantum` compilation feature.
|
//! support by turning on `post-quantum` compilation feature.
|
||||||
//!
|
//!
|
||||||
//! Upstream BoringSSL support the post-quantum hybrid key agreement `X25519Kyber768Draft00`. Most
|
//! Upstream BoringSSL support the post-quantum hybrid key agreement `X25519Kyber768Draft00`. Most
|
||||||
//! users should stick to that one. Enabling this feature, adds a few other post-quantum key
|
//! users should stick to that one for now. Enabling this feature, adds a few other post-quantum key
|
||||||
//! agreements:
|
//! agreements:
|
||||||
//!
|
//!
|
||||||
|
//! - `X25519MLKEM768` is the successor of `X25519Kyber768Draft00`. We expect servers to switch
|
||||||
|
//! before the end of 2024.
|
||||||
//! - `X25519Kyber768Draft00Old` is the same as `X25519Kyber768Draft00`, but under its old codepoint.
|
//! - `X25519Kyber768Draft00Old` is the same as `X25519Kyber768Draft00`, but under its old codepoint.
|
||||||
//! - `X25519Kyber512Draft00`. Similar to `X25519Kyber768Draft00`, but uses level 1 parameter set for
|
//! - `X25519Kyber512Draft00`. Similar to `X25519Kyber768Draft00`, but uses level 1 parameter set for
|
||||||
//! Kyber. Not recommended. It's useful to test whether the shorter ClientHello upsets fewer middle
|
//! Kyber. Not recommended. It's useful to test whether the shorter ClientHello upsets fewer middle
|
||||||
|
|
|
||||||
|
|
@ -765,6 +765,8 @@ impl SslCurve {
|
||||||
ffi::SSL_CURVE_X25519_KYBER512_DRAFT00 => Some(ffi::NID_X25519Kyber512Draft00),
|
ffi::SSL_CURVE_X25519_KYBER512_DRAFT00 => Some(ffi::NID_X25519Kyber512Draft00),
|
||||||
#[cfg(feature = "pq-experimental")]
|
#[cfg(feature = "pq-experimental")]
|
||||||
ffi::SSL_CURVE_P256_KYBER768_DRAFT00 => Some(ffi::NID_P256Kyber768Draft00),
|
ffi::SSL_CURVE_P256_KYBER768_DRAFT00 => Some(ffi::NID_P256Kyber768Draft00),
|
||||||
|
#[cfg(feature = "pq-experimental")]
|
||||||
|
ffi::SSL_CURVE_X25519_MLKEM768 => Some(ffi::NID_X25519MLKEM768),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2691,13 +2693,13 @@ impl SslRef {
|
||||||
if cfg!(feature = "kx-client-nist-required") {
|
if cfg!(feature = "kx-client-nist-required") {
|
||||||
"P256Kyber768Draft00:P-256:P-384:P-521"
|
"P256Kyber768Draft00:P-256:P-384:P-521"
|
||||||
} else {
|
} else {
|
||||||
"X25519Kyber768Draft00:X25519:P256Kyber768Draft00:P-256:P-384:P-521"
|
"X25519Kyber768Draft00:X25519MLKEM768:X25519:P256Kyber768Draft00:P-256:P-384:P-521"
|
||||||
}
|
}
|
||||||
} else if cfg!(feature = "kx-client-pq-supported") {
|
} else if cfg!(feature = "kx-client-pq-supported") {
|
||||||
if cfg!(feature = "kx-client-nist-required") {
|
if cfg!(feature = "kx-client-nist-required") {
|
||||||
"P-256:P-384:P-521:P256Kyber768Draft00"
|
"P-256:P-384:P-521:P256Kyber768Draft00"
|
||||||
} else {
|
} else {
|
||||||
"X25519:P-256:P-384:P-521:X25519Kyber768Draft00:P256Kyber768Draft00"
|
"X25519:P-256:P-384:P-521:X25519MLKEM768:X25519Kyber768Draft00:P256Kyber768Draft00"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if cfg!(feature = "kx-client-nist-required") {
|
if cfg!(feature = "kx-client-nist-required") {
|
||||||
|
|
@ -2713,8 +2715,10 @@ impl SslRef {
|
||||||
|
|
||||||
#[cfg(feature = "kx-safe-default")]
|
#[cfg(feature = "kx-safe-default")]
|
||||||
fn server_set_default_curves_list(&mut self) {
|
fn server_set_default_curves_list(&mut self) {
|
||||||
self.set_curves_list("X25519Kyber768Draft00:P256Kyber768Draft00:X25519:P-256:P-384")
|
self.set_curves_list(
|
||||||
.expect("invalid default server curves list");
|
"X25519Kyber768Draft00:X25519MLKEM768:P256Kyber768Draft00:X25519:P-256:P-384",
|
||||||
|
)
|
||||||
|
.expect("invalid default server curves list");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the [`SslCurve`] used for this `SslRef`.
|
/// Returns the [`SslCurve`] used for this `SslRef`.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue