Commit Graph

3514 Commits

Author SHA1 Message Date
Alessandro Ghedini 97e2a8bc30 Add a few WouldBlock cases 2023-10-10 09:22:36 +01:00
Anthony Ramine 0a2013a6d5 Introduce helper module in tokio-boring tests 2023-10-10 09:22:36 +01:00
Anthony Ramine 3d7ff0a5c0 Introduce setup_accept and setup_connect
These two new kinds of methods immediately return a MidHandshakeSslStream
instead of actually initiating a handshake. This greatly simplifies
loops around MidHandshakeSslStream::WouldBlock.
2023-10-10 09:22:36 +01:00
Anthony Ramine 3b88f4ee5b Panic on error when setting default curves list
These lists are hardcoded and the calls have no business failing in the first place.
2023-10-10 09:22:36 +01:00
Alessandro Ghedini 7b0de9341c Introduce ssl::Error::would_block 2023-10-10 09:22:36 +01:00
Alexis (Poliorcetics) Bourget f67498cf00 deps: update to bindgen 0.68 2023-10-09 13:25:45 +02:00
Anthony Ramine 602bb6d63d Fix clippy lints 2023-10-09 11:49:07 +01:00
Yuchen Wu a3cdf8769a Add new(), connect(), accept() and handshake() to SslStream
These APIs allow more SslStream to be used more flexibly
2023-09-21 17:40:06 +02:00
Christopher Patton 6057ab79f9 Enable P-521 with "kx-safe-default"
While not commonly used, P-521 is a perfectly safe choice of key
exchange algorithm.
2023-09-20 11:09:38 +01:00
Yuchen Wu 52307b145b Provide into_ssl() for ConnectConfiguration
Port from openssl-rs.
2023-09-19 22:04:59 +02:00
Ivan Nikulin 4749c525e4 Update Cargo.toml 2023-09-13 12:38:03 +01:00
Ivan Nikulin e02d03b5e0 Update RELEASE_NOTES 2023-09-13 12:38:03 +01:00
Ivan Nikulin 255409cb98 Update RELEASE_NOTES 2023-09-13 12:38:03 +01:00
Manuel Olguín Muñoz c2cd349132 Release 3.0.5 2023-09-13 12:38:03 +01:00
Manuel Olguín Muñoz bdbef2003f tweaks for ergonomic linking 2023-09-13 12:38:03 +01:00
Christopher Patton 2fa3d96966 Use features to set key exchange preferences
Overwrite boringSSL's default key exchange preferences with safe
defaults using feature flags:

* "kx-pq-supported" enables support for PQ key exchange algorithms.
  Classical key exchange is still preferred, but will be upgraded to PQ
  if requested.

* "kx-pq-preferred" enables preference for PQ key exchange,
  with fallback to classical key exchange if requested.

* "kx-nist-required" disables non-NIST key exchange.

Each feature implies "kx-safe-default". When this feature is enabled,
don't compile bindings for `SSL_CTX_set1_curves()` and `SslCurve`. This
is to prevent the feature flags from silently overriding curve
preferences chosen by the user.

Ideally we'd allow both: that is, use "kx-*" to set defaults, but still
allow the user to manually override them. However, this doesn't work
because by the time the `SSL_CTX` is constructed, we don't yet know
whether we're the client or server. (The "kx-*" features set different
preferences for each.) If "kx-sfe-default" is set, then the curve
preferences are set just before initiating a TLS handshake
(`SslStreamBuilder::connect()`) or waiting for a TLS handshake
(`SslStreamBuilder::accept()`).
2023-09-01 14:21:35 -07:00
Ivan Nikulin 5d6ca7e19c Introduce `no-patches` feature 2023-09-01 09:28:27 +01:00
Eliza Weisman 190fb900a0 run `publish --dry-run` instead of `pacakge` on CI
As suggested by @inikulin in
https://github.com/cloudflare/boring/pull/159#issuecomment-1697324821
2023-08-30 14:54:18 +01:00
Eliza Weisman e9318132d8 fix missing space in cargo package CI command 2023-08-30 14:54:18 +01:00
Eliza Weisman 3056660c86 ci: run the cargo package check for all targets 2023-08-30 14:54:18 +01:00
Eliza Weisman 2345c2f988 boring-sys: include all files needed to build FIPS
This commit modifies the Cargo `include` field for `boring-sys` to
include all the files necessary to actually build the FIPS-certified
revision of BoringSSL. Currently, some of these files are missing (see
#157 for details on this).

This branch improves on my previous approach in PR #158, which switched
from using a Cargo `include` to a Cargo `exclude`. Using `exclude`
rather than `include` resulted in a much larger crates.io package, but
at the time, I thought this was less likely to result in breakage in the
future, because I was concerned about the inability to verify that the
set of excludes/includes can build a new pinned `boringssl` git revision
without having to actually publish a crates.io release.

However, as @nox pointed out in [this comment][1], `cargo package` can
be used to verify a build with the `exclude`s/`include`s applied. This
branch therefore adds `cargo package` steps to CI that check that the
package can actually be built. This way, we are able to make a much
smaller change to the included files, resulting in a smaller package
published to crates.io.

On this branch, the package is 6.7MiB compressed, which is not much
larger than it was previously:

```
    Finished dev [unoptimized + debuginfo] target(s) in 55.65s
    Packaged 1851 files, 33.7MiB (6.7MiB compressed)
```

Fixes #157
Closes #158

[1]: https://github.com/cloudflare/boring/pull/158#issuecomment-1693067112,
2023-08-30 14:54:18 +01:00
Eliza Weisman c8d52a7614 add CI jobs to run `cargo package` 2023-08-30 14:54:18 +01:00
Paolo Barbolini ed91cce367 Fix -Z minimal-versions 2023-08-30 12:19:04 +01:00
Ivan Nikulin 011d500460 Separate `fips` and `fips-link-precompiled` features.
Make the later compatible with `rpk` feature.
2023-08-30 11:41:20 +01:00
Ivan Nikulin a6e35a46b6 Bump version in Cargo.toml 2023-08-05 14:36:12 +01:00
Ivan Nikulin c482097d96 Release 3.0.4 2023-08-05 14:34:05 +01:00
Ivan Nikulin edfe18b196 Add missing cmake files to the package 2023-08-05 14:32:02 +01:00
Ivan Nikulin 55d2731a18 Release 3.0.3 2023-08-05 14:03:58 +01:00
Manuel Olguín Muñoz 57e54be907 Fix missing .trim() when verifying FIPS module name 2023-08-05 13:54:26 +01:00
Ivan Nikulin bb063aa9e6 Fix Diplay panics for HandshakeError with `rpk` (fixes #140) 2023-08-03 15:00:09 +01:00
Ivan Nikulin 308f0405bd Release 3.0.2 2023-08-03 13:38:59 +01:00
Ivan Nikulin 7fd29555b6 Fix feature gates for fips-link-precompiled 2023-08-03 13:38:59 +01:00
Anthony Ramine abfe2f7980 Switch boring from lazy_static to once_cell 2023-08-02 12:14:02 +01:00
Anthony Ramine af5bb39a78 Clean up and remove some unsafe code from ffi callbacks 2023-08-02 12:14:02 +01:00
Ivan Nikulin 959d7c034e Reduce release bundle size by excluding PQ test data 2023-08-01 18:36:51 +01:00
Nathan Mittler 74fd7a8ce4 Adding hmac.h to included headers
This was originally going to be fixed by #101, however that PR was closed and superseded by #117, which was missing this fix.

The original problem was caused by #97, which updated boringssl to a version that included [a change that removed hmac.h from ssl.h](05b360d797).

This PR adds an include for hmac.h, so it is again available through boring-sys.
2023-08-01 19:13:19 +02:00
Ivan Nikulin 2475ef386b Reduce release bundle size by excluding PQ test data 2023-08-01 17:51:44 +01:00
Ivan Nikulin 33e3d756ff Fix builds for features that require git patches
Previously we were building from the deps directory with submodules. For publishing we were copying files in sumbodules into the package. With this we were making the package directory dirty with build artifacts and applied patches.

This commit change the build script's behaviour: sources are now copied to the output directory and then boringssl is built from there.

In addition, this commit adds files that were missing from the package for building with patches.
2023-08-01 17:33:29 +01:00
Ivan Nikulin 6435c5b8d5 Fix publishing 2023-08-01 11:32:20 +01:00
Ivan Nikulin c71e2bed39
Merge pull request #131 from inikulin/rel-3.0.0
Release 3.0.0
2023-07-28 14:15:39 +01:00
Ivan Nikulin c12bfc21f6 Release 3.0.0 2023-07-28 14:07:22 +01:00
Ivan Nikulin 07a8b431ea Add git-cliff configuration 2023-07-28 14:02:46 +01:00
Ivan Nikulin 4761cf7805
Merge pull request #84 from signalapp/macos-cross-compile
boring-sys: Handle cross-compiling macOS targets
2023-07-28 13:21:04 +01:00
Ivan Nikulin 4e190ad00c
Merge pull request #95 from signalapp/libsignal-arm
boring-sys: Add support for cross-compiling to Linux ARM(v7)
2023-07-28 13:20:32 +01:00
Ivan Nikulin c07c414565
Merge pull request #96 from signalapp/android-sysroot
boring-sys: Update Android NDK sysroot path
2023-07-28 13:19:58 +01:00
Jordan Rose a39f0c78ee boring-sys: Handle cross-compiling macOS targets
...such as compiling for Apple Silicon on an Intel Mac.
2023-07-27 13:17:40 -07:00
morph027 bb5caa43a2 boring-sys: Add support for Linux ARM(v7)
Signed-off-by: morph027 <stefan.heitmueller@gmx.com>
2023-07-27 13:15:53 -07:00
Jordan Rose 32feb4f958 boring-sys: Update Android NDK sysroot path
This longer path (inside the prebuilt toolchain included in the NDK)
has been the preferred sysroot since NDK r19. Newer NDKs no longer
have a top-level "sysroot" directory at all.
2023-07-27 13:12:57 -07:00
Ivan Nikulin 3478bc2668
Merge pull request #83 from signalapp/private_key_to_der_pkcs8
boring: Expose PKey::private_key_to_der_pkcs8(_passphrase)
2023-07-27 10:11:02 +01:00
Ivan Nikulin f9e1d2e51c
Merge pull request #130 from inikulin/frankenfips
Add fips-link-precompiled feature
2023-07-27 10:05:08 +01:00