Skip to content

use sha1 for hashes instead of md5 - #40755

Merged
rkooo567 merged 4 commits into
ray-project:masterfrom
KPostOffice:fips-compliant
Dec 6, 2023
Merged

rkooo567 merged 4 commits into
ray-project:masterfrom
KPostOffice:fips-compliant

Conversation

@KPostOffice

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Use FIPS compliant hashing algorithm for file hashes

Related issue number

closes #40534

Checks

@thomasdesr

Copy link
Copy Markdown
Collaborator

These hashes aren't really used for anything sensitive so that they're md5 isn't really an issue. I'll find someone appropriate to review what the consequences are if we change all these paths :D

@rkooo567

rkooo567 commented Nov 7, 2023

Copy link
Copy Markdown
Contributor

can you merge the latest master? One premerge test failure seems to keep failing

@KPostOffice
KPostOffice force-pushed the fips-compliant branch 2 times, most recently from e2af980 to b023702 Compare November 9, 2023 23:04
@rkooo567

Copy link
Copy Markdown
Contributor

hmm some of the premerge failures may be related to failures in the master. I will lyk one more time when you need to merge the latest master...

@rkooo567

Copy link
Copy Markdown
Contributor

can you merge it now? I believe it should be working now...

@architkulkarni

Copy link
Copy Markdown
Contributor

can you merge it now? I believe it should be working now...

@rkooo567 I noticed we have access to this button now, I think it's a new thing... I'm going to hit it now just to speed things up and start CI again
Screenshot 2023-11-15 at 11 31 01 AM

@KPostOffice

Copy link
Copy Markdown
Contributor Author

@rkooo567 LMK if there's anything else you need me to do

@rkooo567

rkooo567 commented Nov 27, 2023 •

Copy link
Copy Markdown
Contributor

I believe if you merge master now, it should pass!

@rkooo567

Copy link
Copy Markdown
Contributor

retrying failed test now///

@rkooo567

rkooo567 commented Dec 4, 2023

Copy link
Copy Markdown
Contributor

I will merge this after the branch cut

@rkooo567
rkooo567 merged commit 6948c20 into ray-project:master Dec 6, 2023
@rkooo567

rkooo567 commented Dec 6, 2023

Copy link
Copy Markdown
Contributor

cc @jjyao not sure if it can impact any performance, but please take a close look in regression!

toabctl added a commit to toabctl/ray that referenced this pull request Sep 16, 2026
hashlib.md5() raises on FIPS-enabled OpenSSL because MD5 isn't in the
OpenSSL FIPS provider. ray-project#40755 fixed this for runtime_env by moving to
SHA-1, but three MD5 calls are left where the digest value matters and
the algorithm can't change:

- _generate_arm_guid replicates ARM's guid(), which is defined as MD5
- _rewrite_iceberg_file needs a stable write_uuid so retries overwrite
  the same object, and uuid.UUID wants 128 bits anyway
- _compute_row_hashes uses the digest as a reproducible 64-bit seed

All three derive an identifier from a string rather than doing anything
security related, so usedforsecurity=False fits, and it leaves the
digests identical.

Signed-off-by: Thomas Bechtold <[email protected]>
toabctl added a commit to toabctl/ray that referenced this pull request Sep 24, 2026
…urity=False

hashlib.md5() raises on FIPS-enabled OpenSSL because MD5 isn't in the
OpenSSL FIPS provider. hashlib.blake2b() is served by the _blake2 builtin
rather than OpenSSL, but distributions that wrap the builtins when
_hashlib.get_fips_mode() is set reject it the same way, so both need the
same treatment.

ray-project#40755 fixed this for runtime_env by moving to SHA-1, which the FIPS
provider does allow. These five calls are what is left, and in each the
digest value matters so the algorithm can't change:

- _generate_arm_guid replicates ARM's guid(), which is defined as MD5
- _rewrite_iceberg_file needs a stable write_uuid so retries overwrite
  the same object, and uuid.UUID wants 128 bits anyway
- _compute_row_hashes uses the digest as a reproducible 64-bit seed
- Dataset.train_test_split buckets rows by a digest of the split key
- get_worker_id derives a Dynamo worker id from a replica's unique id

All five derive an identifier from a string rather than doing anything
security related, so usedforsecurity=False fits, and it leaves the
digests identical.

Signed-off-by: Thomas Bechtold <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.

[Core] MD5 not supported as is for FIPS enabled machines

4 participants