diff --git a/Makefile b/Makefile index 019b0b9..5e5031e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ SHELL=/bin/bash lint: - ruff http_message_signatures + ruff check http_message_signatures mypy --check-untyped-defs http_message_signatures test: lint diff --git a/http_message_signatures/_algorithms.py b/http_message_signatures/_algorithms.py index d6d31e1..dcccebc 100644 --- a/http_message_signatures/_algorithms.py +++ b/http_message_signatures/_algorithms.py @@ -91,9 +91,9 @@ def __init__(self, public_key=None, private_key=None, password=None): raise HTTPMessageSignaturesException("Unexpected public key type") if self.private_key and not isinstance(self.private_key, ec.EllipticCurvePrivateKey): raise HTTPMessageSignaturesException("Unexpected private key type") - if self.public_key and type(self.public_key.curve) != ec.SECP256R1: + if self.public_key and not isinstance(self.public_key.curve, ec.SECP256R1): raise HTTPMessageSignaturesException("Unexpected elliptic curve type in public key") - if self.private_key and type(self.private_key.curve) != ec.SECP256R1: + if self.private_key and not isinstance(self.private_key.curve, ec.SECP256R1): raise HTTPMessageSignaturesException("Unexpected elliptic curve type in private key") self.signature_algorithm = ec.ECDSA(hashes.SHA256())