-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Set usedforsecurity=False
in hashlib methods (FIPS compliance)
#27483
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating!
Happy to merge once all dependencies have been handled. Would be good to have a quick review from @ydshieh who is the packages and CI master 👑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Usually we don't touch any file udner examples/research_projects
, but it's fine here (for me).
(not sure the name insecure_hashlib
is the best name, but that is not the point of this PR 😄 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Not 100% sure we need to rely on the utility as it's a pretty small piece of code for something pretty code + not very intuitive to me that we need to import from hf hub. If others are fine good for me as well
Agree it's not big piece of code. But having it from an explicitly named |
You are right! 🤗 |
Thanks for merging #27494 @ArthurZucker ! I merged |
Still some issue with the dependencies... 😕 |
I converted this PR to draft because of the dependency issues we're having. I'll push a new fix in Please do not merge even if CI is green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the investigative work on this!
Look good! |
Confirmed with @Wauplin over slack that the PR is good to go - merging! |
…gingface#27483) * Set usedforsecurity=False in hashlib methods (FIPS compliance) * trigger ci * tokenizers version * deps * bump hfh version * let's try this
Solves #27034 (cc @DueViktor).
This PR makes
transformers
FIPS-compliant regarding hashlib usage by settingusedforsecurity=False
in every hashlib method (used for file checking, not cryptography purposes). It's based on utilities added in huggingface/huggingface_hub#1782 and released inhuggingface_hub==v0.19.0
.Note: before merging this we need to release a new tokenizers version that would allow new
huggingface_hub
version (see huggingface/tokenizers#1385). Tests are currently failing because of this which is expected. cc @ArthurZucker what's the status on the next release?