Commit Graph

3308 Commits

Author SHA1 Message Date
Kornel c5045fb6b4 Fix patched docs.rs builds 2025-09-03 17:24:22 +01:00
Kornel 8966ca27b7 Test docs.rs docs 2025-09-03 17:24:22 +01:00
Kornel 3de1385660 Fix doc links 2025-09-03 17:24:22 +01:00
Kornel 404a753921 Bump 2025-08-29 19:45:01 +01:00
Kornel a264df22fa Clippy 2025-08-29 10:51:09 -07:00
Harry Stern 26ac58b2bd Remove some comments referring to OpenSSL
Signed-off-by: Harry Stern <hstern@cloudflare.com>
2025-07-21 09:39:25 -07:00
Kornel 0ca11b5680 Use cargo:warning for warnings 2025-06-13 15:06:50 +02:00
Kornel 8d5fba3767 Don't link binaries on docs.rs 2025-06-13 15:06:50 +02:00
Jordan Rose b01510d050
Expose PKey::raw_{private,public}_key (#364) 2025-06-13 09:11:51 +01:00
Alex Bakon c596d7d47c Upgrade bindgen to v0.72.0
This release includes a fix for a build issue with the latest XCode
release.
2025-06-10 12:39:19 +01:00
Justin-Kwan 17d137e33b
Expose SSL_set1_groups to Efficiently Set Curves on SSL Session (#346) 2025-06-06 02:25:28 +01:00
Kornel 5fa9c81c88
Sprinkle #[must_use] (#368) 2025-06-05 20:40:35 +01:00
Kornel 5d57b3a057 Make X509Store shareable between contexts
#362
2025-06-05 14:45:40 +01:00
Kornel 4d178a7f9f Clippy 2025-06-05 10:16:08 +01:00
Kornel bcec9462af Don't unwrap when Result can be returned instead 2025-06-05 10:14:54 +01:00
Kornel 29c05d41cd Avoid panicking in error handling 2025-06-05 10:14:54 +01:00
Kornel 05f798adc4 Rename to reset_with_context_data 2025-06-05 01:06:09 +01:00
Anthony Ramine 56e9fef055 Add X509StoreContextRef::init_without_cleanup
As X509_STORE_CTX_init requires its arguments to outlive
the store context, we take ownership of all of them
and put them in the store context's ex data, ensuring
the soundness of the operation without the mandatory
call to X509_STORE_CTX_cleanup after a closure
is run.
2025-06-05 01:06:09 +01:00
Anthony Ramine 45f8589d48 Add mutable ex_data APIs for X509StoreContext 2025-06-05 01:06:09 +01:00
Anthony Ramine 15975ddde4
Ensure we call X509_STORE_CTX_cleanup on error path too (#360)
As X509_STORE_CTX_init may fail after setting some values
that should outlive the store context, we must ensure we
clean things up on its error path too.

We also know it's always ok to call X509_STORE_CTX_cleanupas X509_STORE_CTX_init starts with a call to it.
2025-06-02 16:40:44 +02:00
Anthony Ramine 6789a72fc0
Fix X509VerifyContextRef::set_verify_param (#358)
This method takes ownership of the given verify param.
2025-06-02 16:39:25 +02:00
Anthony Ramine 7a52fbbe99
Add X509VerifyParamRef::copy_from (#361) 2025-06-02 16:39:11 +02:00
James Larisch 2bc82e8d1c Add support for X509_STORE_CTX_get0_untrusted 2025-06-01 19:04:22 +01:00
James Larisch e99d162891 Add set_verify_param 2025-05-30 02:17:53 +02:00
Anthony Ramine 5e8aaf63f0
Release 4.17.0 (#354) 2025-05-28 11:53:09 +02:00
Anthony Ramine 560925293b
Revert "feat(x509): Implement `Clone` for `X509Store` (#339)" (#353)
* Revert "feat(x509): Implement `Clone` for `X509Store` (#339)"

This reverts commit 49a8d0906a.

See <https://github.com/cloudflare/boring/pull/120>.

* Ensure Clone is not added to X509Store

* Add comment about why X509Store must not implement Clone

---------

Co-authored-by: Kornel <kornel@cloudflare.com>
2025-05-27 18:19:35 +02:00
Yury Yarashevich 4ea82a2e1b Update bindgen from 0.70.1 -> 0.71.1. 2025-05-27 15:04:04 +01:00
James Larisch eefc7b7265 Add `X509_STORE_CTX_get0_cert` interface
This method reliably retrieves the certificate the `X509_STORE_CTX` is
verifying, unlike `X509_STORE_CTX_get_current_cert`, which may return
the "problematic" cert when verification fails.
2025-05-27 14:41:16 +01:00
0x676e67 6e35abb2cd boring(ssl): use `corresponds` macro in `add_certificate_compression_algorithm` 2025-05-26 08:51:37 -07:00
0x676e67 15281c77e2 Update Cargo.toml 2025-05-26 08:51:37 -07:00
0x676e67 eb48ab9a26 build: Fix the build for 32-bit Linux platform 2025-05-26 08:51:37 -07:00
Kornel 3ab8b53532 rustfmt ;( 2025-05-26 16:30:09 +01:00
Kornel 0327dd03c6 Fix linking SystemFunction036 from advapi32 in Rust 1.87 2025-05-26 16:30:09 +01:00
Kornel 23863ffd1b Clippy 2025-05-26 16:30:09 +01:00
Eric Rosenberg 9b34d3524b add SslCurve::X25519_MLKEM768 constant 2025-05-03 01:25:12 +09:00
Rushil Mehra 9c4ea22f72 Use ubuntu-latest for all ci jobs
ubuntu 20.04 is now deprecated:
https://github.com/actions/runner-images/issues/11101
2025-04-17 01:18:30 -07:00
Shih-Chiang Chien b29537e08f fix clippy error 2025-04-17 01:18:30 -07:00
Shih-Chiang Chien 220bedf239 expose SSL_set_compliance_policy 2025-04-17 01:18:30 -07:00
0x676e67 49a8d0906a
feat(x509): Implement `Clone` for `X509Store` (#339)
* boring(x509): impl Clone of X509Store
2025-04-07 18:05:27 +01:00
Rushil Mehra 20ad2665b2
Release 4.16.0 (#341) 2025-04-02 18:26:29 -07:00
Rushil Mehra 721b6fca2e
Add fips-precompiled feature to support newer versions of FIPS (#338)
Newer versions of FIPS don't need any special casing in our bindings,
unlike the submoduled boringssl-fips. In addition, many users currently
use FIPS by precompiling BoringSSL with the proper build tools and
passing that in to the bindings.

Until we adopt the Update Stream pattern for FIPS, there are two main
use cases:

1. Passing an unmodified, precompiled FIPS validated version of
   boringssl (fips-precompiled)

2. Passing a custom source directory of boringssl meant to be linked
   with a FIPS validated bcm.o. This is mainly useful if you carry
   custom patches but still want to use a FIPS validated BoringCrypto.
   (fips-link-precompiled)

This commit introduces the `fips-precompiled` feature and removes the
`fips-no-compat` feature.
2025-03-31 12:34:29 -07:00
Felix Hanau d5bd85b3e5
Document linking to C++ standard library (#335)
This was added in #264, but not documented so far.
2025-03-18 10:16:43 -05:00
Rushil Mehra 11630058f0
Revert "Remove "fips-no-compat", decouple "fips-compat" from "fips"" (#334) 2025-03-17 21:37:14 -05:00
Christopher Patton d8975dc413 boring: Disable `SslCurve` API with "fips" feature
The "fips" feature implies use of a prebuilt boringSSL. The boringSSL
API consumed by `SslCurve` in incompatible with older versions of
boringSSL.

In the `ffi` bindings, the following symbols don't exist in older
builds:

* NID_X25519MLKEM768
* SSL_CURVE_X25519_MLKEM768
* NID_X25519Kyber768Draft00Old

The following symbols have been renamed:
* SSL_CURVE_P256KYBER768DRAFT00 => SSL_CURVE_P256_KYBER768_DRAFT00
* SSL_CURVE_X25519KYBER512DRAFT00 => SSL_CURVE_X25519_KYBER512_DRAFT00
* SSL_CURVE_X25519KYBER768DRAFT00OLD => SSL_CURVE_X25519_KYBER768_DRAFT00_OLD
* SSL_CURVE_P256KYBER768DRAFT00 => SSL_CURVE_P256_KYBER768_DRAFT00

Meanwhile, the `ssl_set_curves_list()` API is stable across these
versions of boringSSL.

These codepoints are added to the `SslCurve` API whenever
"pq-experimental" is enabled. Since this feature is no longer mutually
exclusive with prebuilt boringSSL (`boring-sys` just ignores patches),
we also need to disable this API whenever "fips" is enabled.
2025-03-16 08:45:01 +00:00
Christopher Patton 867f2b3b99 boring-sys: Ignore patches when boringSSL is precompiled
Internal users often have two builds for `boring`, one using a
precompiled build of boringSSL and another built from source with
patches applied. However the features that enable these builds are
mutually exclusive. For example, the `"pq-experimental"` feature is
required to build the source with all of the necessary codepoints for PQ
key exchange, but if this feature is enabled and a precompiled boringSSL
is provided, then the build will fail. This means users will have to
also control their builds with mutually exclusive features.

An alternative is to *ignore* features that enable patches whenever a
precompiled boringSSL is provided. This is a little different from the
"assume patched" environment variable, which applies whenever we're
building from source.
2025-03-16 08:45:01 +00:00
Christopher Patton 57307d739e Remove "fips-no-compat", decouple "fips-compat" from "fips"
Modify the "fips" feature so that it no longer implies "fips-compat".
The latter is no longer needed for recent builds of boringSSL; users who
need older builds will need to enable "fips-compat" explicitly.

Also, remove the "fipps-no-compat" feature, as it's now equivalent to
"fips".
2025-03-16 08:43:52 +00:00
Christopher Patton c774afc859 Add feature "fips-no-compat"
As of boringSSL commit a430310d6563c0734ddafca7731570dfb683dc19, we no
longer need to make exceptions for the types of BufLen, ProtosLen, and
ValueLen, which means the "fips-compat" feature is no longer needed for
"fips" users.

Currently "fips" implies "fips-compat". To allow users to upgrade
without breaking API compatibility with boring version 4, add a new
feature, "fips-no-compat", that does not imply "fips-compat".

In boring 5, we should remove "fips-no-compat" and decouple
"fips-compat" from "fips".
2025-03-14 22:22:41 +00:00
Christopher Patton dde4b9ccde
Advertise X25519MLKEM768 with "kx-client-pq-preferred" (#329)
This algorithm is advertised with "kx-client-pq-supported" but not with
"preferred". However the algorithm is wide spread enough that preferring
it is not a significant risk.
2025-03-10 11:30:56 -07:00
andrew-signal 221efdfea9
Update to actions/cache@v4 (#328) 2025-03-10 10:03:32 -07:00
Rushil Mehra ae1851ba03
Add missing release notes entry (#324)
v4.15.0 was tagged a few days ago but wasn't released until today, where
a new commit made it to master and snuck into the publish. I updated the
v4.15.0 tag to point to the right commit hash as well.
2025-02-28 10:54:55 -08:00