Normalize P-521 test fixture for cryptography 47+#96
Open
sebasxsala wants to merge 1 commit intoauthlib:mainfrom
Open
Normalize P-521 test fixture for cryptography 47+#96sebasxsala wants to merge 1 commit intoauthlib:mainfrom
sebasxsala wants to merge 1 commit intoauthlib:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates an EC private-key test fixture so it can be parsed by cryptography 47+ while preserving the same key material/public key, resolving failures when loading the P-521 (ES512) key.
Changes:
- Normalized the P-521 private scalar encoding in
tests/keys/ec-p512-private.pemfrom 65 bytes to the required fixed 66 bytes socryptography47+ accepts it.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #96 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 47 47
Lines 2929 2929
Branches 339 339
=========================================
Hits 2929 2929
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94.
cryptography47+ rejectstests/keys/ec-p512-private.pembecause the P-521 private scalar is encoded as 65 bytes, while P-521 requires a fixed 66-byte private key value.This updates only the test fixture, preserving the same key material and public key, but normalizing the private key encoding so it can be loaded by newer
cryptographyversions.Verified:
cryptography==47.0.0loads the normalized fixturecryptography==48.0.0loads the normalized fixtureuv run pytestpasses:273 passed