Skip to content

fix(crypto): Replace isinstance metaclass check with issubclass in ge…#802

Merged
sharmabikram merged 1 commit intomasterfrom
shbikram/fix-issubclass-ecc-signing-key
Apr 30, 2026
Merged

fix(crypto): Replace isinstance metaclass check with issubclass in ge…#802
sharmabikram merged 1 commit intomasterfrom
shbikram/fix-issubclass-ecc-signing-key

Conversation

@sharmabikram
Copy link
Copy Markdown
Contributor

…nerate_ecc_signing_key

The isinstance check against type(ec.EllipticCurve) (ABCMeta) fails with newer versions of cryptography where EC curve classes are backed by Rust internals and have 'type' as their metaclass instead of ABCMeta. This causes NotSupportedError when using ECDSA signing algorithms like AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384.

Replace with issubclass which correctly handles both pure Python ABCs and Rust-backed types, matching the fix already applied to authentication.py _set_signature_type.

Fixes #793

Issue #, if available:

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.

@sharmabikram sharmabikram requested a review from a team as a code owner April 29, 2026 22:38
…nerate_ecc_signing_key

The isinstance check against type(ec.EllipticCurve) (ABCMeta) fails with
newer versions of cryptography where EC curve classes are backed by Rust
internals and have 'type' as their metaclass instead of ABCMeta. This
causes NotSupportedError when using ECDSA signing algorithms like
AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384.

Replace with issubclass which correctly handles both pure Python ABCs
and Rust-backed types, matching the fix already applied to
authentication.py _set_signature_type.

Fixes #793
@sharmabikram sharmabikram force-pushed the shbikram/fix-issubclass-ecc-signing-key branch from 87c17c9 to b5ce922 Compare April 30, 2026 00:08
@sharmabikram sharmabikram merged commit 6e958bd into master Apr 30, 2026
792 of 799 checks passed
@sharmabikram sharmabikram deleted the shbikram/fix-issubclass-ecc-signing-key branch April 30, 2026 21:03
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.

_set_signature_type returning "Unsupported signing algorithm info" due to isinstance check

2 participants