Skip to content

feat(hashlib): add usedforsecurity kwarg to hash functions#3474

Merged
youknowone merged 2 commits into
RustPython:mainfrom
TeamTamoad:hashlib
Nov 29, 2021
Merged

feat(hashlib): add usedforsecurity kwarg to hash functions#3474
youknowone merged 2 commits into
RustPython:mainfrom
TeamTamoad:hashlib

Conversation

@TeamTamoad
Copy link
Copy Markdown
Contributor

This PR is related to #3467
I add "usedforsecurity" as a optional keyword argument to hash functions in hashlib.
I also copy test_hashlib.py from CPython v3.9.9 and mark some tests expectedFailure

Copy link
Copy Markdown
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

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

The changed code looks perfect. But we are commiting CPython-originated files separatedly with its source version name. Could you split and message the commits like this PR?

https://github.com/RustPython/RustPython/pull/3207/commits

@TeamTamoad
Copy link
Copy Markdown
Contributor Author

Do I need to split this PR into 2 PRs ? or I can just split this PR into 2 commits?

@youknowone
Copy link
Copy Markdown
Member

single PR with 2 commits will be the best

Copy link
Copy Markdown
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@youknowone
Copy link
Copy Markdown
Member

@TeamTamoad if you are interested in further contribution, uuid.py probably now can be updated to Python 3.9 since this was a blocker of them.

@TeamTamoad
Copy link
Copy Markdown
Contributor Author

@TeamTamoad if you are interested in further contribution, uuid.py probably now can be updated to Python 3.9 since this was a blocker of them.

OK I'll work on that. Can I just copy uuid.py from CPython and update the test_uuid.py? Do I need to do anything in particular?

@youknowone
Copy link
Copy Markdown
Member

test_uuid.py is already very updated. I think updating uuid.py matches to test_uuid.py would be great. Just like you handled test_hashlib.py here, we make separated commit with version message for CPython originated files.

@TeamTamoad
Copy link
Copy Markdown
Contributor Author

Done #3489

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.

2 participants