-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
Description
We are currently only using the OpenSSL backend if goexperiment=opensslcrypto
and FIPS mode is requested, either via GOFIPS=1
or system-wide setting. In all other situations we fallback to Go crypto.
We inherited this approach from RedHat fork and I initially though it would be good to keep it for the following reasons:
- We don't have to support using OpenSSL in non-FIPS mode.
- An application would still work in case it could not load the OpenSSL libraries, either because the system doesn't have them or because it is using an unsupported version, unless
GOFIPS=1
.
On the other hand, there are some downsides:
boring.Enabled
is no longer constant, because the OpenSSL backend can be disabled at runtime in some situations. This hurts the Go reachability, inlining and escape analyses, because it can't eliminate non-OpenSSL code paths even whengoexperiment=opensslcrypto
.- We diverge from the Boring approach, where
goexperiment=boringcrypto
always uses the boring backend.
The OpenSSL backend is now more robust, better tested and has a smarter OpenSSL library loading strategy, so I'm leaning towards always using the OpenSSL backend so that boring.Enabled
can be made constant and we diverge less from the Boring approach.
If we do this change, applications running with GOFIPS=1
would still panic if OpenSSL can't be load or FIPS can't be configured.