aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2021-08-23 14:24:28 -0400
committerGitHub <noreply@github.com>2021-08-23 14:24:28 -0400
commitb79b55407b31933c9a8fe6de01478fa00a33fa2b (patch)
treedf68937bbba312350933ea9a10cc8f5e2e21bd28
parent466aed99f5c2ba15d2036fa21cc83b3f0fc22639 (diff)
downloadgoogle-auth-library-python-b79b55407b31933c9a8fe6de01478fa00a33fa2b.tar.gz
fix: use 'int.to_bytes' rather than deprecated crypto wrapper (#848)
Follow-on to #773, #846.
-rw-r--r--google/auth/crypt/es256.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/google/auth/crypt/es256.py b/google/auth/crypt/es256.py
index 7465cd6..71dcbfc 100644
--- a/google/auth/crypt/es256.py
+++ b/google/auth/crypt/es256.py
@@ -15,7 +15,6 @@
"""ECDSA (ES256) verifier and signer that use the ``cryptography`` library.
"""
-from cryptography import utils
import cryptography.exceptions
from cryptography.hazmat import backends
from cryptography.hazmat.primitives import hashes
@@ -121,7 +120,7 @@ class ES256Signer(base.Signer, base.FromServiceAccountMixin):
# Convert ASN1 encoded signature to (r||s) raw signature.
(r, s) = decode_dss_signature(asn1_signature)
- return utils.int_to_bytes(r, 32) + utils.int_to_bytes(s, 32)
+ return r.to_bytes(32, byteorder="big") + s.to_bytes(32, byteorder="big")
@classmethod
def from_string(cls, key, key_id=None):