Skip to content

Commit bb42da5

Browse files
committed
Pull in release v4.15.0 plus the CI fix from upstream 'cloudflare/boring'
2 parents 615af5a + 221efdf commit bb42da5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+924
-695
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
id: rust-version
3737
run: echo "::set-output name=version::$(rustc --version)"
3838
- name: Cache cargo index
39-
uses: actions/cache@v1
39+
uses: actions/cache@v4
4040
with:
4141
path: ~/.cargo/registry/index
4242
key: index-${{ runner.os }}-${{ github.run_number }}
@@ -45,14 +45,14 @@ jobs:
4545
- name: Create lockfile
4646
run: cargo generate-lockfile
4747
- name: Cache cargo registry
48-
uses: actions/cache@v1
48+
uses: actions/cache@v4
4949
with:
5050
path: ~/.cargo/registry/cache
5151
key: registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
5252
- name: Fetch dependencies
5353
run: cargo fetch
5454
- name: Cache target directory
55-
uses: actions/cache@v1
55+
uses: actions/cache@v4
5656
with:
5757
path: target
5858
key: clippy-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88
resolver = "2"
99

1010
[workspace.package]
11-
version = "4.13.0"
11+
version = "4.15.0"
1212
repository = "https://github.com/cloudflare/boring"
1313
edition = "2021"
1414

@@ -19,9 +19,9 @@ tag-prefix = ""
1919
publish = false
2020

2121
[workspace.dependencies]
22-
boring-sys = { version = "4.13.0", path = "./boring-sys" }
23-
boring = { version = "4.13.0", path = "./boring" }
24-
tokio-boring = { version = "4.13.0", path = "./tokio-boring" }
22+
boring-sys = { version = "4.15.0", path = "./boring-sys" }
23+
boring = { version = "4.15.0", path = "./boring" }
24+
tokio-boring = { version = "4.15.0", path = "./tokio-boring" }
2525

2626
bindgen = { version = "0.70.1", default-features = false, features = ["runtime"] }
2727
bytes = "1"
@@ -44,9 +44,9 @@ hyper = "1"
4444
hyper-util = "0.1.6"
4545
hyper_old = { package = "hyper", version = "0.14", default-features = false }
4646
linked_hash_set = "0.1"
47-
once_cell = "1.0"
4847
openssl-macros = "0.1.1"
4948
tower = "0.4"
5049
tower-layer = "0.3"
5150
tower-service = "0.3"
5251
autocfg = "1.3.0"
52+
brotli = "6.0"

RELEASE_NOTES

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
2+
4.15.0
3+
- 2025-02-27 Expose API to enable certificate compression. (#241)
4+
- 2025-02-23 Fix lifetimes in ssl::select_next_proto
5+
- 2025-02-23 Revert cmake bump (for now) as it is overly restrictive (#321)
6+
- 2025-02-21 Introduce a builder pattern for SslEchKeys + make set_ech_keys take a reference (#320)
7+
- 2025-02-21 Revert "Refactor!: Remove strict `TokioIo` response requirement from `hyper_boring::v1::HttpsConnector`"
8+
- 2025-02-21 Revert "Refactor!: Introduce a Cargo feature for optional Hyper 0 support"
9+
- 2025-02-21 Address clippy lints
10+
- 2025-02-21 Actually expose SslEchKeys
11+
12+
4.14.0
13+
- 2025-02-19 Bump cmake-rs to improve Mac OS build parallelism
14+
- 2025-02-19 Expose SSL_CTX_set1_ech_keys from SslContextRef
15+
- 2024-01-27 Set CMAKE_BUILD_PARALLEL_LEVEL to available_parallelism
16+
- 2025-02-14 build: Fix the build for 32-bit Linux platform (#312)
17+
- 2024-11-30 Use corresponds macro
18+
- 2025-02-12 Expose SSL_set_enable_ech_grease
19+
- 2025-02-12 Clean up ECH tests
20+
- 2025-02-10 Expose client/server-side ECH
21+
- 2025-02-10 Expose EVP_HPKE_KEY
22+
- 2025-02-10 Clean up boring_sys::init()
23+
- 2024-11-27 Detailed error codes
24+
- 2025-02-04 chore: Fix docs on SslRef::replace_ex_data
25+
- 2025-01-22 fix manual_c_str_literals clippy warning
26+
- 2025-01-22 replace once_cell with LazyLock
27+
- 2025-01-13 RTG-3333 Support X25519MLKEM768 by default, but don't sent it as client
28+
- 2024-07-31 Allow dead_code instead of disabling clippy entirely for bindgen
29+
- 2024-11-12 Remove INVALID_CALL from mid-handshake error message
30+
- 2024-08-16 Fix bug with accessing memzero'd X509StoreContext in tests
31+
- 2024-08-16 Support linking with a runtime cpp library
32+
- 2024-12-06 Refactor!: Introduce a Cargo feature for optional Hyper 0 support
33+
- 2024-12-06 Refactor!: Remove strict `TokioIo` response requirement from `hyper_boring::v1::HttpsConnector`
34+
135
4.13.0
236
- 2024-11-26 Sync X509StoreBuilder with openssl
337
- 2024-11-26 Sync X509VerifyFlags with openssl
@@ -6,15 +40,15 @@
640
- 2024-11-28 Clippy
741
- 2024-03-11 Fix Windows build
842

9-
4.12.0
43+
4.12.0
1044
- 2024-11-20 Add bindings for SSL_CB_ACCEPT_EXIT and SSL_CB_CONNECT_EXIT
1145
- 2024-10-22 (ci): brew link x86 toolchain for macos13 runner
1246
- 2024-10-22 Skip bindgen 0.70's layout tests before Rust 1.77
1347
- 2024-10-18 Add `set_cert_verify_callback` (`SSL_CTX_set_cert_verify`)
1448

1549
4.11.0
1650
- 2024-10-17 boring-sys: include HPKE header file for bindgen
17-
- 2024-10-17 Add "fips-compat" feature
51+
- 2024-10-17 Add "fips-compat" feature (#286)
1852
- 2024-09-25 Create semgrep.yml
1953

2054
4.10.3
@@ -47,6 +81,7 @@
4781
- 2024-08-04 Properly handle `Option<i32>` in `SslRef::set_curves`
4882

4983
4.9.0
84+
- 2024-08-02 Actually Release 4.9.0
5085
- 2024-08-02 Guard against empty strings given to select_next_proto (#252)
5186
- 2024-08-01 Document `SslCurve::nid()`
5287
- 2024-08-01 Add SslCurve::to_nid() and remove SslCurveId

boring-sys/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ include = [
1919
"/LICENSE-MIT",
2020
"/cmake/*.cmake",
2121
# boringssl (non-FIPS)
22+
"/deps/boringssl/src/util/32-bit-toolchain.cmake",
2223
"/deps/boringssl/**/*.[chS]",
2324
"/deps/boringssl/**/*.asm",
2425
"/deps/boringssl/sources.json",
@@ -30,6 +31,7 @@ include = [
3031
"/deps/boringssl/**/sources.cmake",
3132
"/deps/boringssl/LICENSE",
3233
# boringssl (FIPS)
34+
"/deps/boringssl-fips/src/util/32-bit-toolchain.cmake",
3335
"/deps/boringssl-fips/**/*.[chS]",
3436
"/deps/boringssl-fips/**/*.asm",
3537
"/deps/boringssl-fips/**/*.pl",

boring-sys/build/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub(crate) struct Env {
3434
pub(crate) opt_level: Option<OsString>,
3535
pub(crate) android_ndk_home: Option<PathBuf>,
3636
pub(crate) cmake_toolchain_file: Option<PathBuf>,
37+
pub(crate) cpp_runtime_lib: Option<OsString>,
3738
}
3839

3940
impl Config {
@@ -164,6 +165,7 @@ impl Env {
164165
opt_level: target_var("OPT_LEVEL"),
165166
android_ndk_home: target_var("ANDROID_NDK_HOME").map(Into::into),
166167
cmake_toolchain_file: target_var("CMAKE_TOOLCHAIN_FILE").map(Into::into),
168+
cpp_runtime_lib: target_var("BORING_BSSL_RUST_CPPLIB"),
167169
}
168170
}
169171
}

boring-sys/build/main.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use fslock::LockFile;
2+
use std::env;
23
use std::ffi::OsString;
34
use std::fs;
45
use std::io;
@@ -575,6 +576,10 @@ fn built_boring_source_path(config: &Config) -> &PathBuf {
575576

576577
let mut cfg = get_boringssl_cmake_config(config);
577578

579+
if let Ok(threads) = std::thread::available_parallelism() {
580+
cfg.env("CMAKE_BUILD_PARALLEL_LEVEL", threads.to_string());
581+
}
582+
578583
if config.features.fips {
579584
let (clang, clangxx) = verify_fips_clang_version();
580585
cfg.define("CMAKE_C_COMPILER", clang)
@@ -636,6 +641,22 @@ fn link_in_precompiled_bcm_o(config: &Config) {
636641
.unwrap();
637642
}
638643

644+
fn get_cpp_runtime_lib(config: &Config) -> Option<String> {
645+
if let Some(ref cpp_lib) = config.env.cpp_runtime_lib {
646+
return cpp_lib.clone().into_string().ok();
647+
}
648+
649+
// TODO(rmehra): figure out how to do this for windows
650+
if env::var_os("CARGO_CFG_UNIX").is_some() {
651+
match env::var("CARGO_CFG_TARGET_OS").unwrap().as_ref() {
652+
"macos" | "ios" => Some("c++".into()),
653+
_ => Some("stdc++".into()),
654+
}
655+
} else {
656+
None
657+
}
658+
}
659+
639660
fn main() {
640661
let config = Config::from_env();
641662
let bssl_dir = built_boring_source_path(&config);
@@ -673,6 +694,9 @@ fn main() {
673694
link_in_precompiled_bcm_o(&config);
674695
}
675696

697+
if let Some(cpp_lib) = get_cpp_runtime_lib(&config) {
698+
println!("cargo:rustc-link-lib={}", cpp_lib);
699+
}
676700
println!("cargo:rustc-link-lib=static=crypto");
677701
println!("cargo:rustc-link-lib=static=ssl");
678702

boring-sys/src/lib.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ use std::convert::TryInto;
1616
use std::ffi::c_void;
1717
use std::os::raw::{c_char, c_int, c_uint, c_ulong};
1818

19-
#[allow(dead_code)]
20-
#[allow(clippy::all)]
21-
#[rustfmt::skip]
19+
#[allow(
20+
clippy::useless_transmute,
21+
clippy::derive_partial_eq_without_eq,
22+
dead_code
23+
)]
2224
mod generated {
2325
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
2426
}
@@ -46,18 +48,7 @@ pub const fn ERR_GET_REASON(l: c_uint) -> c_int {
4648
}
4749

4850
pub fn init() {
49-
use std::ptr;
50-
use std::sync::Once;
51-
52-
// explicitly initialize to work around https://github.com/openssl/openssl/issues/3505
53-
static INIT: Once = Once::new();
54-
55-
let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS;
56-
57-
INIT.call_once(|| {
58-
assert_eq!(
59-
unsafe { OPENSSL_init_ssl(init_options.try_into().unwrap(), ptr::null_mut()) },
60-
1
61-
)
62-
});
51+
unsafe {
52+
CRYPTO_library_init();
53+
}
6354
}

boring/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ readme = "README.md"
1010
keywords = ["crypto", "tls", "ssl", "dtls"]
1111
categories = ["cryptography", "api-bindings"]
1212
edition = { workspace = true }
13-
rust-version = "1.70"
13+
rust-version = "1.80"
1414

1515
[package.metadata.docs.rs]
1616
features = ["rpk", "pq-experimental", "underscore-wildcards"]
@@ -74,11 +74,11 @@ kx-client-nist-required = ["kx-safe-default"]
7474
[dependencies]
7575
bitflags = { workspace = true }
7676
foreign-types = { workspace = true }
77-
once_cell = { workspace = true }
7877
openssl-macros = { workspace = true }
7978
libc = { workspace = true }
8079
boring-sys = { workspace = true }
8180

8281
[dev-dependencies]
8382
hex = { workspace = true }
8483
rusty-hook = { workspace = true }
84+
brotli = { workspace = true }

boring/src/derive.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Shared secret derivation.
22
use crate::ffi;
33
use foreign_types::ForeignTypeRef;
4+
use openssl_macros::corresponds;
45
use std::marker::PhantomData;
56
use std::ptr;
67

@@ -25,10 +26,7 @@ impl Drop for Deriver<'_> {
2526
#[allow(clippy::len_without_is_empty)]
2627
impl<'a> Deriver<'a> {
2728
/// Creates a new `Deriver` using the provided private key.
28-
///
29-
/// This corresponds to [`EVP_PKEY_derive_init`].
30-
///
31-
/// [`EVP_PKEY_derive_init`]: https://www.openssl.org/docs/man1.0.2/crypto/EVP_PKEY_derive_init.html
29+
#[corresponds(EVP_PKEY_derive_init)]
3230
pub fn new<T>(key: &'a PKeyRef<T>) -> Result<Deriver<'a>, ErrorStack>
3331
where
3432
T: HasPrivate,
@@ -41,10 +39,7 @@ impl<'a> Deriver<'a> {
4139
}
4240

4341
/// Sets the peer key used for secret derivation.
44-
///
45-
/// This corresponds to [`EVP_PKEY_derive_set_peer`]:
46-
///
47-
/// [`EVP_PKEY_derive_set_peer`]: https://www.openssl.org/docs/man1.0.2/crypto/EVP_PKEY_derive_init.html
42+
#[corresponds(EVP_PKEY_derive_set_peer)]
4843
pub fn set_peer<T>(&mut self, key: &'a PKeyRef<T>) -> Result<(), ErrorStack>
4944
where
5045
T: HasPublic,
@@ -55,10 +50,7 @@ impl<'a> Deriver<'a> {
5550
/// Returns the size of the shared secret.
5651
///
5752
/// It can be used to size the buffer passed to [`Deriver::derive`].
58-
///
59-
/// This corresponds to [`EVP_PKEY_derive`].
60-
///
61-
/// [`Deriver::derive`]: #method.derive
53+
#[corresponds(EVP_PKEY_derive)]
6254
/// [`EVP_PKEY_derive`]: https://www.openssl.org/docs/man1.0.2/crypto/EVP_PKEY_derive_init.html
6355
pub fn len(&mut self) -> Result<usize, ErrorStack> {
6456
unsafe {
@@ -70,10 +62,7 @@ impl<'a> Deriver<'a> {
7062
/// Derives a shared secret between the two keys, writing it into the buffer.
7163
///
7264
/// Returns the number of bytes written.
73-
///
74-
/// This corresponds to [`EVP_PKEY_derive`].
75-
///
76-
/// [`EVP_PKEY_derive`]: https://www.openssl.org/docs/man1.0.2/crypto/EVP_PKEY_derive_init.html
65+
#[corresponds(EVP_PKEY_derive)]
7766
pub fn derive(&mut self, buf: &mut [u8]) -> Result<usize, ErrorStack> {
7867
let mut len = buf.len();
7968
unsafe {

boring/src/dh.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::error::ErrorStack;
22
use crate::ffi;
33
use foreign_types::{ForeignType, ForeignTypeRef};
4+
use openssl_macros::corresponds;
45
use std::mem;
56
use std::ptr;
67

@@ -25,20 +26,14 @@ where
2526
/// Serializes the parameters into a PEM-encoded PKCS#3 DHparameter structure.
2627
///
2728
/// The output will have a header of `-----BEGIN DH PARAMETERS-----`.
28-
///
29-
/// This corresponds to [`PEM_write_bio_DHparams`].
30-
///
31-
/// [`PEM_write_bio_DHparams`]: https://www.openssl.org/docs/manmaster/man3/PEM_write_bio_DHparams.html
29+
#[corresponds(PEM_write_bio_DHparams)]
3230
params_to_pem,
3331
ffi::PEM_write_bio_DHparams
3432
}
3533

3634
to_der! {
3735
/// Serializes the parameters into a DER-encoded PKCS#3 DHparameter structure.
38-
///
39-
/// This corresponds to [`i2d_DHparams`].
40-
///
41-
/// [`i2d_DHparams`]: https://www.openssl.org/docs/man1.1.0/crypto/i2d_DHparams.html
36+
#[corresponds(i2d_DHparams)]
4237
params_to_der,
4338
ffi::i2d_DHparams
4439
}
@@ -58,21 +53,15 @@ impl Dh<Params> {
5853
/// Deserializes a PEM-encoded PKCS#3 DHpararameters structure.
5954
///
6055
/// The input should have a header of `-----BEGIN DH PARAMETERS-----`.
61-
///
62-
/// This corresponds to [`PEM_read_bio_DHparams`].
63-
///
64-
/// [`PEM_read_bio_DHparams`]: https://www.openssl.org/docs/man1.0.2/crypto/PEM_read_bio_DHparams.html
56+
#[corresponds(PEM_read_bio_DHparams)]
6557
params_from_pem,
6658
Dh<Params>,
6759
ffi::PEM_read_bio_DHparams
6860
}
6961

7062
from_der! {
7163
/// Deserializes a DER-encoded PKCS#3 DHparameters structure.
72-
///
73-
/// This corresponds to [`d2i_DHparams`].
74-
///
75-
/// [`d2i_DHparams`]: https://www.openssl.org/docs/man1.1.0/crypto/d2i_DHparams.html
64+
#[corresponds(d2i_DHparams)]
7665
params_from_der,
7766
Dh<Params>,
7867
ffi::d2i_DHparams,

0 commit comments

Comments
 (0)