-
Notifications
You must be signed in to change notification settings - Fork 28
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
MacOS FIPS compliant app using FIPS OpenSSL doesn't restrict TLS ciphers to FIPS only #1521
Comments
This is something we're still working on documenting properly--there are some upstream Go 1.24 changes that introduce some new concepts that affect how this works. You should be able to set If you set On macOS, there's no system-wide FIPS indicator like there is for Linux and Windows, so the runtime environment needs to use a Go-specific FIPS configuration environment variable to indicate that the Go runtime (and therefore Go TLS) should run in a FIPS-compliant mode. |
@dagood, I'll try the MacOs build of the app with FIPS openssl 3.0.9 and set GODEBUG=fips140=on at runtime.
I've set GODEBUG=fips140 and rebuilt the Go app. Then restarted the app and captured the traffic using Wireshark. The advertised ciphers in the TLS handshake include FIPS and non-FIPS ciphers
|
Ah, I missed that you're using OpenSSL here on macOS. But same as #1520, you haven't provided enough info to reproduce. Can you try with my test app? |
@dagood, yes. I'll update. |
@dagood, just to make sure, was your app tested running with FIPS openssl on MacOS before? if openssl.FIPS() { What is the impact on linux that won't happen on darwin? Is there any change in the Microsoft Go fork related to support of openssl for MacOS in latest code in master? |
I haven't run this, no. I haven't gotten OpenSSL set up on macOS yet. Perhaps @gdams or @qmuntal have? A few questions to help the repro:
One thing missing to repro is source code, and using my test app is one way to fix that. Most apps should behave the same, but that also means it should be easy to make a repro program that can be freely shared. 😄
So far, it sounds like this might be an issue of setting the env variables in the wrong place, like #1520.
I don't see this code, where is it? |
Ah, sorry, just noticed this hiding in plain sight. 😄 1.24 changes a lot. In 1.23, you should use In 1.23, the OpenSSL backend is only supported on Linux. It's not just I'm unsure whether or not OpenSSL is supported on macOS in 1.24 (microsoft/main), but it's more likely. |
Ah, I also missed that you are also trying to modify 1.23. I made a lot of early assumptions based on #1520 (I thought this issue was simply a followup question) and haven't shaken them all yet.
It's not feasible for our patches to update every comment line in the upstream code--in fact, we may avoid doing so to reduce the diff vs. upstream and avoid merge conflicts. As a rule of thumb, if you take a look at the diff between the patched repo and the commit it's based on (e.g. |
@dagood, the answer is yes. I downloaded and installed official FIPS openssl and configured it for FIPS and did changes to build Microsoft Go fork with the openssl and even opened a PR (which you closed). Since the 1.24 that I've tested with the CommonCrypto integration doesn't have openssl_darwin.go, the only way to try it is to update the patches and build again. Correct? The version I have for 1.24: |
I took another look at 1.24, and it appears it will still require a Apologies that we haven't taken this work into the repo--we're a relatively small team, and need to be careful to avoid adding features that might make it harder for us to maintain the features that our internal users need. We're focusing on cryptokit/commoncrypto for our internal users that target macOS. (Also, want to make sure you see my last comment, about |
I was able to build MacOS app using Microsoft Go fork after updating the patches to create openssl_darwin.go.
But, testing the Go app and capturing the advertised ciphers, they contain FIPS and non-FIPS, which is unexpected.
FIPS openssl vendor is installed and fips openssl config was verified. The FIPS mode is enabled in the app on runtime.
The gap from openssl_linux is the following:
Checking the code I understood that it is not allowed to import the fipstls package since it belongs to BoringCrypto. The comment in the top of the file is confusing because of the go build statement in tls.go.
Trying to concatenate boringcrypto to the systemcrypto or opensslcrypto resulted in build error, when trying to build the application.
Trying to add the Force function in the openssl_darwin.go, it didn't have the effect of restricting the advertised TLS ciphers.
I understand that Linux is the only supported platform for BoringCrypto.
go/src/crypto/boring
[Can BoringCrypto be used only for Linux](https://stackoverflow.com/questions/75954995/can-boringcrypto-be-used-only-for-linux-linux-amd64-and-linux-arm64)
What is the recommended way to resolve above?
Thanks
The text was updated successfully, but these errors were encountered: