From: Bob Halley Date: Sat, 27 Jan 2024 13:45:35 +0000 (-0800) Subject: Fix elliptic curve test deprecation warning from cryptography 42. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c897ecf7967b5433e9aa45d53b2348452d20810d;p=thirdparty%2Fdnspython.git Fix elliptic curve test deprecation warning from cryptography 42. We were passing a curve class as the curve parameter in testSignatureECDSAP256SHA256 and testSignatureECDSAP384SHA384, not an instance of the curve class. The official API has always been to pass an instance, but it tolerated passing a class. Starting with Cryptogrphy 42, passing a class is deprecated. (cherry picked from commit 8131d0cf4254d9d42f6e23cde3bcc95ff034d341) --- diff --git a/tests/test_dnssec.py b/tests/test_dnssec.py index c4a8d684..c2cdb8ec 100644 --- a/tests/test_dnssec.py +++ b/tests/test_dnssec.py @@ -1398,11 +1398,11 @@ class DNSSECSignatureTestCase(unittest.TestCase): self._test_signature(key, dns.dnssec.Algorithm.RSASHA256, abs_soa) def testSignatureECDSAP256SHA256(self): # type: () -> None - key = ec.generate_private_key(curve=ec.SECP256R1, backend=default_backend()) + key = ec.generate_private_key(curve=ec.SECP256R1(), backend=default_backend()) self._test_signature(key, dns.dnssec.Algorithm.ECDSAP256SHA256, abs_soa) def testSignatureECDSAP384SHA384(self): # type: () -> None - key = ec.generate_private_key(curve=ec.SECP384R1, backend=default_backend()) + key = ec.generate_private_key(curve=ec.SECP384R1(), backend=default_backend()) self._test_signature(key, dns.dnssec.Algorithm.ECDSAP384SHA384, abs_soa) def testSignatureED25519(self): # type: () -> None