Skip to content

Conversation

@qmuntal
Copy link
Member

@qmuntal qmuntal commented Sep 8, 2023

This PR updates crypto/tls to implement PRF using OpenSSL/CNG instead of plain Go.

The Go implementation doesn't return an error, but OpenSSL/CNG do. I had to update a bunch of functions so that the error is correctly handled.

I've also updated both backends to their latest versions, as TLS1PRF support landed soon in there.

The final implementation will probably change a bit once golang-fips/openssl#116 and microsoft/go-crypto-winnative#45 are merged, but I prefer to submit this now, get some reviews and let the pipeline exercise the new code.

+ if version == "" {
+ var fallbackVersion string
+ var lcrypto string
+ if version, _ := syscall.Getenv("GO_OPENSSL_VERSION_OVERRIDE"); version != "" {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to update this code because openssl.Init now accepts a file path instead of a version suffix.

@qmuntal qmuntal requested a review from dagood September 21, 2023 13:28
@qmuntal
Copy link
Member Author

qmuntal commented Sep 21, 2023

Submitted an OpenSSL PR to fix the CI failures: golang-fips/openssl#121.

@qmuntal qmuntal merged commit 6c43d32 into microsoft/main Sep 26, 2023
@qmuntal qmuntal deleted the dev/qmuntal/tlsprf branch September 26, 2023 14:22
ueno added a commit to ueno/go-fips that referenced this pull request Feb 15, 2024
For FIPS compliance, this offloads the PRF computation in TLS to
OpenSSL, based on the work by Quim Muntal in:
microsoft/go#1036

Note that, on RHEL-9, this may cause interoperability issue against
the peers which do not use extended master secret, as described at:
https://www.redhat.com/en/blog/tls-extended-master-secret-and-fips-rhel
ueno added a commit to ueno/go-fips that referenced this pull request Feb 15, 2024
For FIPS compliance, this offloads the PRF computation in TLS to
OpenSSL, based on the work by Quim Muntal in:
microsoft/go#1036

Note that, on RHEL-9, this may cause interoperability issue against
the peers which do not use extended master secret, yielding a
connection close with internal_error alert. The way to mitigate that
behavior is described at:
https://www.redhat.com/en/blog/tls-extended-master-secret-and-fips-rhel
ueno added a commit to ueno/go-fips that referenced this pull request Feb 15, 2024
For FIPS compliance, this offloads the PRF computation in TLS to
OpenSSL, based on the work by Quim Muntal in:
microsoft/go#1036

Note that, on RHEL-9, this may cause interoperability issue against
the peers which do not use extended master secret, yielding a
connection close with internal_error alert. The way to mitigate that
behavior is described at:
https://www.redhat.com/en/blog/tls-extended-master-secret-and-fips-rhel
ueno added a commit to ueno/go-fips that referenced this pull request Feb 15, 2024
For FIPS compliance, this offloads the PRF computation in TLS to
OpenSSL, based on the work by Quim Muntal in:
microsoft/go#1036

Note that, on RHEL-9, this may cause interoperability issue against
the peers which do not use extended master secret, yielding a
connection close with internal_error alert. The way to mitigate that
behavior is described at:
https://www.redhat.com/en/blog/tls-extended-master-secret-and-fips-rhel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants