Skip to content

Commit b79b554

Browse files
authored
fix: use 'int.to_bytes' rather than deprecated crypto wrapper (#848)
Follow-on to #773, #846.
1 parent 466aed9 commit b79b554

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

google/auth/crypt/es256.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"""ECDSA (ES256) verifier and signer that use the ``cryptography`` library.
1616
"""
1717

18-
from cryptography import utils
1918
import cryptography.exceptions
2019
from cryptography.hazmat import backends
2120
from cryptography.hazmat.primitives import hashes
@@ -121,7 +120,7 @@ def sign(self, message):
121120

122121
# Convert ASN1 encoded signature to (r||s) raw signature.
123122
(r, s) = decode_dss_signature(asn1_signature)
124-
return utils.int_to_bytes(r, 32) + utils.int_to_bytes(s, 32)
123+
return r.to_bytes(32, byteorder="big") + s.to_bytes(32, byteorder="big")
125124

126125
@classmethod
127126
def from_string(cls, key, key_id=None):

0 commit comments

Comments
 (0)