-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
gh-130149: cleanup refactorization of test_hmac.py
#131318
Conversation
- add `requires_builtin_hmac` to check if built-in HMAC is available - refactor `requires_hashdigest` in prevision of a future `requires_builtin_hashdigest` for built-in hashes only
- update comments for `CreatorMixin.hmac_new()` - update comments for `DigestMixin.hmac_digest()` - update comments for `TestVectorsMixin` - update comments for `TestVectorsMixin.hmac_new_by_name()` - update comments for `TestVectorsMixin.hmac_digest_by_name()`
* `assert_hmac_hexdigest_by_new` -> `assert_hmac_hexdigest_by_name` * use a single function for checking the hexdigest.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
89eadce
to
3ea207e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Failed tests are:
Those tests are failing for the past year. It's virtually impossible to easily make them succeed because |
…1318) New features: * refactor `hashlib_helper.requires_hashdigest` in prevision of a future `hashlib_helper.requires_builtin_hashdigest` for built-in hashes only * add `hashlib_helper.requires_openssl_hashdigest` to request OpenSSL hashes, assuming that `_hashlib` exists. Refactoring: * split hmac.copy() test by implementation * update how algorithms are discovered for RFC test cases * simplify how OpenSSL hash digests are requested * refactor hexdigest tests for RFC test vectors * typo fix: `assert_hmac_hexdigest_by_new` -> `assert_hmac_hexdigest_by_name` Improvements: * strengthen contract on `hmac_new_by_name` and `hmac_digest_by_name` * rename mixin classes to better match their responsibility
Backporting some changes from #130157 so that I don't need to put them out there.