Skip to content

fix: ec isinstance fix#794

Closed
ShubhamChaturvedi7 wants to merge 1 commit intomasterfrom
pyca_ec_subclass_fix
Closed

fix: ec isinstance fix#794
ShubhamChaturvedi7 wants to merge 1 commit intomasterfrom
pyca_ec_subclass_fix

Conversation

@ShubhamChaturvedi7
Copy link
Copy Markdown
Contributor

Issue #, if available:
#793
Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

@ShubhamChaturvedi7 ShubhamChaturvedi7 requested a review from a team as a code owner April 8, 2026 22:53
texastony added a commit that referenced this pull request Apr 22, 2026
Replace isinstance(signing_algorithm_info, type(ec.EllipticCurve)) with
issubclass(signing_algorithm_info, ec.EllipticCurve) wrapped in try/except
TypeError. The old check used isinstance against ABCMeta which was fragile
and semantically incorrect for checking class hierarchy.

Update tests to use real EC curve classes (ec.SECP256R1, ec.SECP384R1)
instead of MagicMock with spec=ec.EllipticCurve, which masked the bug.

Based on PR #794.
texastony added a commit that referenced this pull request Apr 22, 2026
Replace isinstance(signing_algorithm_info, type(ec.EllipticCurve)) with
issubclass(signing_algorithm_info, ec.EllipticCurve) wrapped in try/except
TypeError. The old check used isinstance against ABCMeta which was fragile
and semantically incorrect for checking class hierarchy.

Update tests to use real EC curve classes (ec.SECP256R1, ec.SECP384R1)
instead of MagicMock with spec=ec.EllipticCurve, which masked the bug.

Based on PR #794.
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