Skip to content

Normalize P-521 test fixture for cryptography 47+#96

Open
sebasxsala wants to merge 1 commit intoauthlib:mainfrom
sebasxsala:fix-p512-fixture
Open

Normalize P-521 test fixture for cryptography 47+#96
sebasxsala wants to merge 1 commit intoauthlib:mainfrom
sebasxsala:fix-p512-fixture

Conversation

@sebasxsala
Copy link
Copy Markdown

Closes #94.

cryptography 47+ rejects tests/keys/ec-p512-private.pem because 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 cryptography versions.

Verified:

  • cryptography==47.0.0 loads the normalized fixture
  • cryptography==48.0.0 loads the normalized fixture
  • uv run pytest passes: 273 passed

Copilot AI review requested due to automatic review settings May 8, 2026 05:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.pem from 65 bytes to the required fixed 66 bytes so cryptography 47+ accepts it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8817129) to head (b89eadf).

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           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Test failures with cryptography 47.0.0

2 participants