Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use 'int.to_bytes' rather than deprecated crypto wrapper #848

Merged
merged 1 commit into from
Aug 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions google/auth/crypt/es256.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -121,7 +120,7 @@ def sign(self, message):

# 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):
Expand Down