Skip to content
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

Make crypto run with FIPS on OpenSSL 3.0 #7392

Merged
merged 14 commits into from Jun 27, 2023

Conversation

sverker
Copy link
Contributor

@sverker sverker commented Jun 12, 2023

Fix #7086
Fix #6981
Fix #6566
Fix #6406

@sverker sverker added team:VM Assigned to OTP team VM fix labels Jun 12, 2023
@sverker sverker self-assigned this Jun 12, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 12, 2023

CT Test Results

    2 files    14 suites   7m 7s ⏱️
186 tests 173 ✔️   13 💤 0
480 runs  341 ✔️ 139 💤 0

Results for commit 830ce7a.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@sverker
Copy link
Contributor Author

sverker commented Jun 13, 2023

Added some tweaking of tests to please FIPS.
Still 5 failing test left.

@sverker sverker force-pushed the sverker/crypto/fips-openssl3.0 branch 2 times, most recently from 6cb003c to 701e5d8 Compare June 20, 2023 18:16
@sverker
Copy link
Contributor Author

sverker commented Jun 20, 2023

All crypto tests pass on OpenSSL 3.0.9 and 3.1.1 with FIPS.

It is not allowed to write to the binary buffer returned by
enif_inspect_binary() (even if you created the binary yourself).

In DEBUG built VM such abuse will be punished with:

"Readonly data written by NIF, checksums differ 8000425 != 25040008
ABORTING"

Instead use enif_make_new_binary() to create a writable binary buffer.
OpenSSL 3 FIPS does only accept named ec curves.

So we try that first, and if it fails we retry
with the params passed down by crypto.erl.
to pass OpenSSL the name it accepts.
FIPs on OpenSSL 3 seems to demand P to be a safe prime
where Q = (P-1)/2 is also prime.
@sverker sverker force-pushed the sverker/crypto/fips-openssl3.0 branch from 830ce7a to bb6e559 Compare June 27, 2023 14:06
@sverker sverker changed the base branch from master to maint June 27, 2023 14:07
@sverker sverker merged commit 3de0a09 into erlang:maint Jun 27, 2023
2 checks passed
@sverker
Copy link
Contributor Author

sverker commented Jun 27, 2023

Merged to maint for release in OTP-26.1.

The branch is based on OTP-25.3.2, but will probably not be release in any 25.3.2.* release as it's more than a bug fix.

@lukebakken
Copy link
Contributor

Thank you from Team RabbitMQ!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix team:VM Assigned to OTP team VM
Projects
None yet
2 participants