Commit Graph

71 Commits

Author SHA1 Message Date
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