Support for building with fips support#24
Support for building with fips support#24arnarpall wants to merge 6 commits intocloudflare:masterfrom
Conversation
|
I see we have some errors that look unreleated to what you did. Looks good to me beyond that: not sure if it's an issue on master or if it's from being based on an old branch or what. Thanks for your contribution! |
|
Yeah I was wondering about that. |
|
@arnarpall it's the updated clippy complaining about the FFI names. Adding |
|
@wbl shouldn't we build from a particular branch for being FIPS-compatible? Or setting the compilation flag should be sufficient enough? |
|
And with a specified toolchain. |
|
From my tests I did not have to do any toolchain configuration or buld from a specific branch. The fips param into cmake seems to do the trick. |
|
Just becase isFIPS is true doesn't mean that you have built against a FIPS 140-2 certified module. |
|
Here is an excerpt from the document that you linked in your issue 12. Guidance and Secure Operation12.1 Installation InstructionsThe following steps shall be performed to build, compile and statically link the BoringCrypto module to
The FIPS 140-2 validated release of the module can be obtained by downloading the tarball containing Upon completion of the build process. The module’s status can be verified by issuing: I have also verified that the fips mode of operation works in a library that links against build of boring with the fips feature enabled. |
boring-sys/build.rs
Outdated
There was a problem hiding this comment.
Seems like this broke linking on Windows (see CI failures)
There was a problem hiding this comment.
Yeah I was looking into this. I'll need to spin up a windows box to investigate this further but I've at least verified that we are using the correct slashes / vs \ based on the build platform.
|
@arnarpall You need to explain to me how this does that. I don't think our submodule points at that version of BoringSSL for one. If we do go down this path there should be documentation. I think it would be easier to let the user point at an already built FIPS version as then whatever toolchain fun they engaged in doesn't affect the rust bit. |
|
Hey @wbl. I'm not exactly sure what you mean that the submodule does not point to the relevant version of BoringSSL, it's right here: https://github.com/google/boringssl/tree/067cfd92f4d7da0edfa073b096d090b98a83b860/src/crypto/fipsmodule If I'm mistaken in how this is setup then I need to revisit this. |
|
The most recent version of BoringSSL that went through FIPS validation is git commit ae223d6138807a13006342edfeef32e813246b39, tree 39abc40f885fa27499b15d1ae5180e7e793e514f, pointed at by the tag fips-20190808. That's not the same as the submodule which points at 067cfd92f4d7da0edfa073b096d090b98a83b860. Secondly this assumes that a more recent clang or ninja or go don't affect the certification. Reading https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Module-Validation-Program/documents/fips140-2/FIPS1402IG.pdf it's very unclear if this is the case for anyone not Google. |
|
Thanks for the clarification @wbl |
|
I have checked with our compliance officer and they think the toolchain won't be a problem, but the right version of BoringSSL definitely is. |
|
@wbl so, we good to merge this? |
|
I would say this should be fine and then we could potentially just have a branch / tag that would in fact point towards the fips validated version of the boringssl submodule. |
|
@inikulin do you think the tag pointing to the fips version is an appropriate solution? |
3261dd7 to
85d02f0
Compare
|
@arnarpall @wbl I think so |
|
@arnarpall can we add check/instructions or probably automate switching to the FIPS-validated branch in the build script? |
|
Shouldn't that use 2 submodules, one for the normal build and one for the FIPS version build? |
85d02f0 to
2b0ca67
Compare
Passes the FIPS=1 value into cmake to build the library in FIPS mode. https://boringssl.googlesource.com/boringssl/+/fed35d32245ee4563691d21f55c12b4f8dac840a/crypto/fipsmodule/FIPS.md Since the top level cmake file does not accept the fips variable we need to point the build towards the cmake file in the src directory and update the search paths for the crypto and ssl libraries respectively.
2b0ca67 to
0d6c59f
Compare
|
I think with the latest changes in master with the addition of the By pointing |
|
Ok after thinking about this some more we can do 2 things.
I would prefer going with suggestion number 2 |
|
@inikulin Have you had any time to take a look at my proposal in my latest comment ? |
@gabi-250 has run into issues with concurrent builds where if two build scripts are running at the same time with different features, it will error/cause an unexpected git state. They suggested using two different submodules instead, one for FIPS builds and one when the FIPS feature is disabled. |
| key: clippy-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} | ||
| - name: Run clippy | ||
| run: cargo clippy --all --all-targets | ||
| run: cargo clippy --all --all-targets -- -A clippy::upper_case_acronyms |
There was a problem hiding this comment.
Why did this change? If it's because of some difference between the FIPS and non-FIPS version, please use an attribute on the FFI module instead, rather than blanket allowing this for the whole workspace.
|
Closing in favor of #52. |
Passes the FIPS=1 value into cmake to build the library in FIPS mode.
https://boringssl.googlesource.com/boringssl/+/fed35d32245ee4563691d21f55c12b4f8dac840a/crypto/fipsmodule/FIPS.md
Since the top level cmake file does not accept the fips variable we need
to point the build towards the cmake file in the src directory and
update the search paths for the crypto and ssl libraries respectively.
issue: #8