Commit Graph

88 Commits

Author SHA1 Message Date
Chris Eager 08c417a97e Make arm and Android builds check-only 2023-12-14 13:25:47 +01:00
Chris Eager f5583312c5 Add matrix.apt_packages 2023-12-14 13:25:47 +01:00
Chris Eager bccb80b115 Refactor check-only and extra-test-args 2023-12-14 13:25:47 +01:00
Chris Eager bbe8cd1b9e Add relevant `--target` to `cargo test` in CI 2023-12-14 13:25:47 +01:00
Anthony Ramine 0f74eade4b Add CI for cross-building from macOS 2023-10-26 11:31:47 +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
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 c8d52a7614 add CI jobs to run `cargo package` 2023-08-30 14:54:18 +01:00
Ivan Nikulin d4ddd16ee2 Add fips-link-precompiled feature 2023-07-26 14:35:40 +01:00
Ivan Nikulin 0b542999d4 Address review comments 2023-07-10 14:00:52 +01:00
Ivan Nikulin d1ee9bfd86 Use workspace metadata for crates 2023-07-10 11:38:18 +01:00
Ivan Nikulin c4e8a94a69 Add RPK and PQ crypto features 2023-07-07 13:50:36 +01:00
Piotr Sikora 902e7d0c92 Update BoringCrypto to FIPS 140-2 certificate 4407.
Signed-off-by: Piotr Sikora <piotr@aviatrix.com>
2023-05-09 10:37:32 +02:00
Anthony Ramine 7215070e22 Use ubuntu-20.04 image for FIPS build
Later ubuntu images don't provide clang-7 anymore.
2023-03-27 12:59:13 +02:00
ilammy 87cdcee599 ci: Test builds for iOS targets
While it's possible to build Rust tests into an iOS app, start up
a simulator instance, upload the tests there, and launch them --
that's a bit involved process. For now, just check that BoringSSL
compiles for the specified target. Use "--all-targets" to check
all targets, including the unit tests.
2022-06-03 09:11:38 -05:00
ilammy 4c5ffc7723 ci: Don't run tests when targeting iOS
Even if "cargo test --target ${arch}-apple-ios" cross-compiles tests,
it's not possible to actually run them on the host macOS, as that's
a different execution environment.

Although, I guess, we could try only building tests with "--no-run",
GitHub Actions do not make it easy to construct command lines based
on matrix parameters. Thus it's easier to disable these steps, and
the following commit adds a "--no-run" step with "--target".
2022-06-03 09:11:38 -05:00
Braden Ehrat 1507689c5b
Add fips-3678 feature (#52)
* Add rerun-if-env-changed instructions for BORING_* variables

* Use X509_get0_notBefore() and X509_get0_notAfter() instead of X509_getm_notBefore() and X509_getm_notAfter().

According to
https://www.openssl.org/docs/man1.1.0/man3/X509_getm_notBefore.html,
"X509_getm_notBefore() and X509_getm_notAfter() are similar to
X509_get0_notBefore() and X509_get0_notAfter() except they return
non-constant mutable references to the associated date field of the
certificate".

* Only update boringssl submodule if BORING_BSSL_PATH not provided

* Allow BORING_BSSL_LIB_PATH to control link search

* Add fips feature

* Use X509_set_notAfter unconditionally for FIPS compatibility

This is equivalent according to
https://boringssl.googlesource.com/boringssl/+/c947efabcbc38dcf93e8ad0e6a76206cf0ec8072

The version of boringssl that's FIPS-certified doesn't have `X509_set1_notAfter`.
The only difference between that and `X509_set_notAfter` is whether they're const-correct,
which doesn't seem worth having two different code-paths.

* Check out fips commit automatically

* Verify the version of the compiler used for building boringssl

NIST specifies that it needs to be 7.0.1; I originally tried building with clang 10 and it failed.
Theoretically this should check the versions of Go and Ninja too, but they haven't given me trouble in practice.

Example error:
```
   Compiling boring-sys v1.1.1 (/home/jnelson/work/boring/boring-sys)
error: failed to run custom build command for `boring-sys v1.1.1 (/home/jnelson/work/boring/boring-sys)`

Caused by:
  process didn't exit successfully: `/home/jnelson/work/boring/target/debug/build/boring-sys-31b8ce53031cfd83/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=BORING_BSSL_PATH

  --- stderr
  warning: missing clang-7, trying other compilers: Permission denied (os error 13)
  warning: FIPS requires clang version 7.0.1, skipping incompatible version "clang version 10.0.0-4ubuntu1 "
  thread 'main' panicked at 'unsupported clang version "cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0": FIPS requires clang 7.0.1', boring-sys/build.rs:216:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

* Add Github actions workflow testing FIPS

Co-authored-by: Joshua Nelson <jnelson@cloudflare.com>
2022-01-31 16:11:33 -06:00
Frank Denis 05c6a41270 Use bindgen to automatically generate boring-sys
This ensures that all the Rust functions, types and constants
always match the actual BoringSSL definitions.

It also removes quite a lot of manually maintained code, as well
as the need for systest.

The value for `SslOptions::ALL`, for example, was wrong. On current
BoringSSL versions, this is a no-op, and is set to `0`.

Clearing it does nothing. So, the `clear_ctx_options` test, that
passed by accident, was adjusted to use a different option.

The `libc` crate is not required, as we only use it for types that
are already defined in the standard library. It was removed from
`boring-sys`. The same can be done to other crates later.
2021-02-12 15:03:45 +01:00
Ivan Nikulin f4096d8afd Add hyper-boring 2020-11-11 20:29:54 +00:00
Ivan Nikulin ec45baa6d8 Revive CI 2020-11-11 19:01:29 +00:00
Ivan Nikulin fc07d7dfbb Fix doc comments 2020-11-11 18:08:14 +00:00
Steven Fackler 16a0e6f674 Test openssl-errors on windows 2020-08-15 15:18:32 -04:00
Steven Fackler 2f98f1c821 Fix CI branch 2020-06-06 16:32:27 -07:00
Steven Fackler 7546bfd148 Ignore default verify paths test on windows 2020-06-06 13:58:44 -07:00
Steven Fackler 60118dddad test env lookup 2020-06-06 13:58:44 -07:00
Steven Fackler 52c1b6fdc2 set vcpkg root 2020-06-06 13:58:44 -07:00
Steven Fackler a9a092a9ff run stuff 2020-06-06 13:58:44 -07:00
Steven Fackler 5f59ee012e update vcpkg 2020-06-06 13:58:44 -07:00
Steven Fackler 6f7501b034 Move vcpkg build to github actions 2020-06-06 13:58:44 -07:00
Steven Fackler 24af7de14c fix clippy 2020-06-05 13:33:13 -07:00
Steven Fackler 639c8af5c1 Fix cache name 2020-06-03 14:49:51 -07:00
Steven Fackler 63928bdaaf fix syntax 2020-05-25 17:56:04 -07:00
Steven Fackler 8909396836 Move min-version to github actions 2020-05-25 17:53:53 -07:00
Steven Fackler b34f3e8d29 asdf 2020-05-25 17:36:45 -07:00
Steven Fackler f401ba2ec1 Run clippy 2020-05-24 16:31:04 -07:00
Steven Fackler 406031991f Run rustfmt on github actions 2020-05-24 10:39:01 -07:00