boring: Add SslCurve `FFDHE2048`/`FFDHE3072` NID support (#20)

This commit is contained in:
0x676e67 2024-12-18 13:14:02 +08:00 committed by GitHub
parent 30cadfb1eb
commit 6ef0ca379e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5070 additions and 21 deletions

View File

@ -484,10 +484,10 @@ fn ensure_patches_applied(config: &Config) -> io::Result<()> {
println!("cargo:warning=applying old ciphers patch to boringssl");
apply_patch(config, "boringssl-old-ciphers.patch")?;
if config.features.pq_experimental {
println!("cargo:warning=applying experimental post quantum crypto patch to boringssl");
apply_patch(config, "boring-pq.patch")?;
}
// if config.features.pq_experimental {
// println!("cargo:warning=applying experimental post quantum crypto patch to boringssl");
// apply_patch(config, "boring-pq.patch")?;
// }
if config.features.rpk {
println!("cargo:warning=applying RPK patch to boringssl");

File diff suppressed because it is too large Load Diff

View File

@ -708,9 +708,9 @@ impl SslCurve {
pub const X25519: SslCurve = SslCurve(ffi::SSL_CURVE_X25519 as _);
pub const FFDHE2048: SslCurve = SslCurve(ffi::SSL_CURVE_FFDHE2048 as _);
pub const FFDHE2048: SslCurve = SslCurve(ffi::SSL_CURVE_DHE2048 as _);
pub const FFDHE3072: SslCurve = SslCurve(ffi::SSL_CURVE_FFDHE3072 as _);
pub const FFDHE3072: SslCurve = SslCurve(ffi::SSL_CURVE_DHE3072 as _);
#[cfg(not(feature = "fips"))]
pub const X25519_KYBER768_DRAFT00: SslCurve =
@ -774,6 +774,8 @@ impl SslCurve {
ffi::SSL_CURVE_P256_KYBER768_DRAFT00 => Some(ffi::NID_P256Kyber768Draft00),
#[cfg(feature = "pq-experimental")]
ffi::SSL_CURVE_X25519_MLKEM768 => Some(ffi::NID_X25519MLKEM768),
ffi::SSL_CURVE_DHE2048 => Some(ffi::NID_ffdhe2048),
ffi::SSL_CURVE_DHE3072 => Some(ffi::NID_ffdhe3072),
_ => None,
}
}