-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opt-in rustls-ffi FIPS support, Linux CI coverage #478
base: main
Are you sure you want to change the base?
Conversation
Pulling this out into a separate PR since I have some TODOs for this one: #479 |
The Ubuntu FIPS CI works great, and so do my local test builds on Both MacOS and Windows build the Rust The MacOS builds fail to compile the client/server example
Similar failures for the
Probably missing some extra linker arguments for the C programs (?) - have to put a pin in this for today but will debug further when time permits. |
This comment was marked as outdated.
This comment was marked as outdated.
I believe the root cause of the trouble here is that I didn't realize the aws-lc FIPS module only supports static linking on Linux. On macOS the module .dylib needs to be used (aws/aws-lc-rs#495). On Windows, there are two Both are limitations we can surmount for the CI integration testing of a FIPS-enabled client/server test binary, but I need to think about the best way to pull out a predictable file path for both the Taking Windows as an example, right now they're under paths like:
I'm not sure the right way to jig a @ctz Do you have any experience with this? |
Some progress in 6732976 - mostly struggling with The solution in that commit works without too much hardcoding, but it assumes you've run a More iteration (and probably an attempt to properly learn |
I'm afraid not :( |
Np! I will keep plugging away at this, more because I'm overdue to better understand the existing Windows build than because I think it's super important to get working. Worst case I'll land Linux in CI and we can circle back on MacOS/Windows testing of the FIPS builds later on. |
Using `make FIPS=true` with the Makefiles, or `cmake -DFIPS="true" -S . -B build` with the Windows cmake build will activate the `aws-lc-rs` feature of `rustls-ffi`, and the `rustls/fips` feature of Rustls. On Linux our test client/server binaries Just Work thanks to the magic of static linking. On MacOS/Windows life is more complicated. For now we'll land support without testing on these platforms since the dynamic linking setup required for the end-user application is tricky. See the rustls manual[0] and the aws-lc-rs-fips-sys crate[1] for more information and further FIPS related caveats. [0]: https://docs.rs/rustls/latest/rustls/manual/_06_fips/index.html [1]: https://crates.io/crates/aws-lc-fips-sys
* Ability to instantiate the FIPS default `crypto_provider` using a new function `rustls_default_fips_provider()`, available only when the fips feature is activated. * Ability to determine if a given `crypto_provider` is in FIPS mode using a new function `rustls_crypto_provider_fips()`. * Ability to determine if a given `rustls_client_config` would create connections that are FIPS compatible with a new function `rustls_client_config_fips()`. * Ability to determine if a given `rustls_server_config` would create connections that are FIPS compatible with a new function `rustls_server_config_fips()`. * Ability to determine if a given `rustls_connection` was created from a `rustls_client_config` that was FIPS enabled with a new function `rustls_connection_fips()`. Doing equivalent for a server connection is not presently supported upstream (will be fixed next release).
I backed out the CI bits for MacOS and Windows. You can still build I've learned a lot (some would say: too much) about
Alternatively we could table this PR, do the build bits, and then rebase it and land it with full CI coverage. |
FIPS feature
Using
make FIPS=true
with the Makefiles, orcmake -DFIPS="true" -S . -B build
with the Windows cmake build will activate theaws-lc-rs
feature ofrustls-ffi
, and therustls/fips
feature of Rustls.On Linux our test client/server binaries Just Work thanks to the magic of static linking. On MacOS/Windows life is more complicated. For now we'll land support without testing on these platforms since the dynamic linking setup required for the end-user application is tricky.
See the rustls manual and the aws-lc-rs-fips-sys crate for more information and further FIPS related caveats.
API additions
Ability to instantiate the FIPS default
crypto_provider
using a new functionrustls_default_fips_provider()
, available only when the fips feature is activated.Ability to determine if a given
crypto_provider
is in FIPS mode using a new functionrustls_crypto_provider_fips()
.Ability to determine if a given
rustls_client_config
would create connections that are FIPS compatible with a new functionrustls_client_config_fips()
.Ability to determine if a given
rustls_server_config
would create connections that are FIPS compatible with a new functionrustls_server_config_fips()
.Ability to determine if a given
rustls_connection
was created from arustls_client_config
that was FIPS enabled with a new functionrustls_connection_fips()
. Doing equivalent for a server connection is not presently supported upstream (see consistent APIs for connection FIPS indicator rustls#2174).Future work
cmake
tidying before further investing in this direction.