We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
JWT decoding depends upon deprecated function
#### Environment details

  - OS: Debian 11 (bullseye)
  - Python version: 3.9.2
  - pip version: 20.3.4
  - `google-auth` version: 1.30

#### Steps to reproduce

Decode a JWT token from Google Cloud Identity-Aware Proxy

#### Error

The following deprecation warnings are issues from the `cryptography` library:

```
/usr/local/lib/python3.9/dist-packages/google/auth/crypt/es256.py:56: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
/usr/local/lib/python3.9/dist-packages/google/auth/crypt/es256.py:57: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
```

The changes necessary seem self evident. The [function in question][frombytes] exists in Python 3.2+ and therefore falls within the currently stated supported versions (3.5+).

[frombytes]: https://docs.python.org/3/library/stdtypes.html#int.from_bytes

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `google/auth/crypt/es256.py`
Content:
```
1 # Copyright 2017 Google Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 """ECDSA (ES256) verifier and signer that use the ``cryptography`` library.
16 """
17 
18 from cryptography import utils
19 import cryptography.exceptions
20 from cryptography.hazmat import backends
21 from cryptography.hazmat.primitives import hashes
22 from cryptography.hazmat.primitives import serialization
23 from cryptography.hazmat.primitives.asymmetric import ec
24 from cryptography.hazmat.primitives.asymmetric import padding
25 from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature
26 from cryptography.hazmat.primitives.asymmetric.utils import encode_dss_signature
27 import cryptography.x509
28 
29 from google.auth import _helpers
30 from google.auth.crypt import base
31 
32 
33 _CERTIFICATE_MARKER = b"-----BEGIN CERTIFICATE-----"
34 _BACKEND = backends.default_backend()
35 _PADDING = padding.PKCS1v15()
36 
37 
38 class ES256Verifier(base.Verifier):
39     """Verifies ECDSA cryptographic signatures using public keys.
40 
41     Args:
42         public_key (
43                 cryptography.hazmat.primitives.asymmetric.ec.ECDSAPublicKey):
44             The public key used to verify signatures.
45     """
46 
47     def __init__(self, public_key):
48         self._pubkey = public_key
49 
50     @_helpers.copy_docstring(base.Verifier)
51     def verify(self, message, signature):
52         # First convert (r||s) raw signature to ASN1 encoded signature.
53         sig_bytes = _helpers.to_bytes(signature)
54         if len(sig_bytes) != 64:
55             return False
56         r = utils.int_from_bytes(sig_bytes[:32], byteorder="big")
57         s = utils.int_from_bytes(sig_bytes[32:], byteorder="big")
58         asn1_sig = encode_dss_signature(r, s)
59 
60         message = _helpers.to_bytes(message)
61         try:
62             self._pubkey.verify(asn1_sig, message, ec.ECDSA(hashes.SHA256()))
63             return True
64         except (ValueError, cryptography.exceptions.InvalidSignature):
65             return False
66 
67     @classmethod
68     def from_string(cls, public_key):
69         """Construct an Verifier instance from a public key or public
70         certificate string.
71 
72         Args:
73             public_key (Union[str, bytes]): The public key in PEM format or the
74                 x509 public key certificate.
75 
76         Returns:
77             Verifier: The constructed verifier.
78 
79         Raises:
80             ValueError: If the public key can't be parsed.
81         """
82         public_key_data = _helpers.to_bytes(public_key)
83 
84         if _CERTIFICATE_MARKER in public_key_data:
85             cert = cryptography.x509.load_pem_x509_certificate(
86                 public_key_data, _BACKEND
87             )
88             pubkey = cert.public_key()
89 
90         else:
91             pubkey = serialization.load_pem_public_key(public_key_data, _BACKEND)
92 
93         return cls(pubkey)
94 
95 
96 class ES256Signer(base.Signer, base.FromServiceAccountMixin):
97     """Signs messages with an ECDSA private key.
98 
99     Args:
100         private_key (
101                 cryptography.hazmat.primitives.asymmetric.ec.ECDSAPrivateKey):
102             The private key to sign with.
103         key_id (str): Optional key ID used to identify this private key. This
104             can be useful to associate the private key with its associated
105             public key or certificate.
106     """
107 
108     def __init__(self, private_key, key_id=None):
109         self._key = private_key
110         self._key_id = key_id
111 
112     @property
113     @_helpers.copy_docstring(base.Signer)
114     def key_id(self):
115         return self._key_id
116 
117     @_helpers.copy_docstring(base.Signer)
118     def sign(self, message):
119         message = _helpers.to_bytes(message)
120         asn1_signature = self._key.sign(message, ec.ECDSA(hashes.SHA256()))
121 
122         # Convert ASN1 encoded signature to (r||s) raw signature.
123         (r, s) = decode_dss_signature(asn1_signature)
124         return utils.int_to_bytes(r, 32) + utils.int_to_bytes(s, 32)
125 
126     @classmethod
127     def from_string(cls, key, key_id=None):
128         """Construct a RSASigner from a private key in PEM format.
129 
130         Args:
131             key (Union[bytes, str]): Private key in PEM format.
132             key_id (str): An optional key id used to identify the private key.
133 
134         Returns:
135             google.auth.crypt._cryptography_rsa.RSASigner: The
136             constructed signer.
137 
138         Raises:
139             ValueError: If ``key`` is not ``bytes`` or ``str`` (unicode).
140             UnicodeDecodeError: If ``key`` is ``bytes`` but cannot be decoded
141                 into a UTF-8 ``str``.
142             ValueError: If ``cryptography`` "Could not deserialize key data."
143         """
144         key = _helpers.to_bytes(key)
145         private_key = serialization.load_pem_private_key(
146             key, password=None, backend=_BACKEND
147         )
148         return cls(private_key, key_id=key_id)
149
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/google/auth/crypt/es256.py b/google/auth/crypt/es256.py
--- a/google/auth/crypt/es256.py
+++ b/google/auth/crypt/es256.py
@@ -53,8 +53,8 @@
         sig_bytes = _helpers.to_bytes(signature)
         if len(sig_bytes) != 64:
             return False
-        r = utils.int_from_bytes(sig_bytes[:32], byteorder="big")
-        s = utils.int_from_bytes(sig_bytes[32:], byteorder="big")
+        r = int.from_bytes(sig_bytes[:32], byteorder="big")
+        s = int.from_bytes(sig_bytes[32:], byteorder="big")
         asn1_sig = encode_dss_signature(r, s)
 
         message = _helpers.to_bytes(message)

{"golden_diff": "diff --git a/google/auth/crypt/es256.py b/google/auth/crypt/es256.py\n--- a/google/auth/crypt/es256.py\n+++ b/google/auth/crypt/es256.py\n@@ -53,8 +53,8 @@\n         sig_bytes = _helpers.to_bytes(signature)\n         if len(sig_bytes) != 64:\n             return False\n-        r = utils.int_from_bytes(sig_bytes[:32], byteorder=\"big\")\n-        s = utils.int_from_bytes(sig_bytes[32:], byteorder=\"big\")\n+        r = int.from_bytes(sig_bytes[:32], byteorder=\"big\")\n+        s = int.from_bytes(sig_bytes[32:], byteorder=\"big\")\n         asn1_sig = encode_dss_signature(r, s)\n \n         message = _helpers.to_bytes(message)\n", "issue": "JWT decoding depends upon deprecated function\n#### Environment details\r\n\r\n  - OS: Debian 11 (bullseye)\r\n  - Python version: 3.9.2\r\n  - pip version: 20.3.4\r\n  - `google-auth` version: 1.30\r\n\r\n#### Steps to reproduce\r\n\r\nDecode a JWT token from Google Cloud Identity-Aware Proxy\r\n\r\n#### Error\r\n\r\nThe following deprecation warnings are issues from the `cryptography` library:\r\n\r\n```\r\n/usr/local/lib/python3.9/dist-packages/google/auth/crypt/es256.py:56: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead\r\n/usr/local/lib/python3.9/dist-packages/google/auth/crypt/es256.py:57: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead\r\n```\r\n\r\nThe changes necessary seem self evident. The [function in question][frombytes] exists in Python 3.2+ and therefore falls within the currently stated supported versions (3.5+).\r\n\r\n[frombytes]: https://docs.python.org/3/library/stdtypes.html#int.from_bytes\n", "before_files": [{"content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"ECDSA (ES256) verifier and signer that use the ``cryptography`` library.\n\"\"\"\n\nfrom cryptography import utils\nimport cryptography.exceptions\nfrom cryptography.hazmat import backends\nfrom cryptography.hazmat.primitives import hashes\nfrom cryptography.hazmat.primitives import serialization\nfrom cryptography.hazmat.primitives.asymmetric import ec\nfrom cryptography.hazmat.primitives.asymmetric import padding\nfrom cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature\nfrom cryptography.hazmat.primitives.asymmetric.utils import encode_dss_signature\nimport cryptography.x509\n\nfrom google.auth import _helpers\nfrom google.auth.crypt import base\n\n\n_CERTIFICATE_MARKER = b\"-----BEGIN CERTIFICATE-----\"\n_BACKEND = backends.default_backend()\n_PADDING = padding.PKCS1v15()\n\n\nclass ES256Verifier(base.Verifier):\n    \"\"\"Verifies ECDSA cryptographic signatures using public keys.\n\n    Args:\n        public_key (\n                cryptography.hazmat.primitives.asymmetric.ec.ECDSAPublicKey):\n            The public key used to verify signatures.\n    \"\"\"\n\n    def __init__(self, public_key):\n        self._pubkey = public_key\n\n    @_helpers.copy_docstring(base.Verifier)\n    def verify(self, message, signature):\n        # First convert (r||s) raw signature to ASN1 encoded signature.\n        sig_bytes = _helpers.to_bytes(signature)\n        if len(sig_bytes) != 64:\n            return False\n        r = utils.int_from_bytes(sig_bytes[:32], byteorder=\"big\")\n        s = utils.int_from_bytes(sig_bytes[32:], byteorder=\"big\")\n        asn1_sig = encode_dss_signature(r, s)\n\n        message = _helpers.to_bytes(message)\n        try:\n            self._pubkey.verify(asn1_sig, message, ec.ECDSA(hashes.SHA256()))\n            return True\n        except (ValueError, cryptography.exceptions.InvalidSignature):\n            return False\n\n    @classmethod\n    def from_string(cls, public_key):\n        \"\"\"Construct an Verifier instance from a public key or public\n        certificate string.\n\n        Args:\n            public_key (Union[str, bytes]): The public key in PEM format or the\n                x509 public key certificate.\n\n        Returns:\n            Verifier: The constructed verifier.\n\n        Raises:\n            ValueError: If the public key can't be parsed.\n        \"\"\"\n        public_key_data = _helpers.to_bytes(public_key)\n\n        if _CERTIFICATE_MARKER in public_key_data:\n            cert = cryptography.x509.load_pem_x509_certificate(\n                public_key_data, _BACKEND\n            )\n            pubkey = cert.public_key()\n\n        else:\n            pubkey = serialization.load_pem_public_key(public_key_data, _BACKEND)\n\n        return cls(pubkey)\n\n\nclass ES256Signer(base.Signer, base.FromServiceAccountMixin):\n    \"\"\"Signs messages with an ECDSA private key.\n\n    Args:\n        private_key (\n                cryptography.hazmat.primitives.asymmetric.ec.ECDSAPrivateKey):\n            The private key to sign with.\n        key_id (str): Optional key ID used to identify this private key. This\n            can be useful to associate the private key with its associated\n            public key or certificate.\n    \"\"\"\n\n    def __init__(self, private_key, key_id=None):\n        self._key = private_key\n        self._key_id = key_id\n\n    @property\n    @_helpers.copy_docstring(base.Signer)\n    def key_id(self):\n        return self._key_id\n\n    @_helpers.copy_docstring(base.Signer)\n    def sign(self, message):\n        message = _helpers.to_bytes(message)\n        asn1_signature = self._key.sign(message, ec.ECDSA(hashes.SHA256()))\n\n        # Convert ASN1 encoded signature to (r||s) raw signature.\n        (r, s) = decode_dss_signature(asn1_signature)\n        return utils.int_to_bytes(r, 32) + utils.int_to_bytes(s, 32)\n\n    @classmethod\n    def from_string(cls, key, key_id=None):\n        \"\"\"Construct a RSASigner from a private key in PEM format.\n\n        Args:\n            key (Union[bytes, str]): Private key in PEM format.\n            key_id (str): An optional key id used to identify the private key.\n\n        Returns:\n            google.auth.crypt._cryptography_rsa.RSASigner: The\n            constructed signer.\n\n        Raises:\n            ValueError: If ``key`` is not ``bytes`` or ``str`` (unicode).\n            UnicodeDecodeError: If ``key`` is ``bytes`` but cannot be decoded\n                into a UTF-8 ``str``.\n            ValueError: If ``cryptography`` \"Could not deserialize key data.\"\n        \"\"\"\n        key = _helpers.to_bytes(key)\n        private_key = serialization.load_pem_private_key(\n            key, password=None, backend=_BACKEND\n        )\n        return cls(private_key, key_id=key_id)\n", "path": "google/auth/crypt/es256.py"}], "after_files": [{"content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"ECDSA (ES256) verifier and signer that use the ``cryptography`` library.\n\"\"\"\n\nfrom cryptography import utils\nimport cryptography.exceptions\nfrom cryptography.hazmat import backends\nfrom cryptography.hazmat.primitives import hashes\nfrom cryptography.hazmat.primitives import serialization\nfrom cryptography.hazmat.primitives.asymmetric import ec\nfrom cryptography.hazmat.primitives.asymmetric import padding\nfrom cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature\nfrom cryptography.hazmat.primitives.asymmetric.utils import encode_dss_signature\nimport cryptography.x509\n\nfrom google.auth import _helpers\nfrom google.auth.crypt import base\n\n\n_CERTIFICATE_MARKER = b\"-----BEGIN CERTIFICATE-----\"\n_BACKEND = backends.default_backend()\n_PADDING = padding.PKCS1v15()\n\n\nclass ES256Verifier(base.Verifier):\n    \"\"\"Verifies ECDSA cryptographic signatures using public keys.\n\n    Args:\n        public_key (\n                cryptography.hazmat.primitives.asymmetric.ec.ECDSAPublicKey):\n            The public key used to verify signatures.\n    \"\"\"\n\n    def __init__(self, public_key):\n        self._pubkey = public_key\n\n    @_helpers.copy_docstring(base.Verifier)\n    def verify(self, message, signature):\n        # First convert (r||s) raw signature to ASN1 encoded signature.\n        sig_bytes = _helpers.to_bytes(signature)\n        if len(sig_bytes) != 64:\n            return False\n        r = int.from_bytes(sig_bytes[:32], byteorder=\"big\")\n        s = int.from_bytes(sig_bytes[32:], byteorder=\"big\")\n        asn1_sig = encode_dss_signature(r, s)\n\n        message = _helpers.to_bytes(message)\n        try:\n            self._pubkey.verify(asn1_sig, message, ec.ECDSA(hashes.SHA256()))\n            return True\n        except (ValueError, cryptography.exceptions.InvalidSignature):\n            return False\n\n    @classmethod\n    def from_string(cls, public_key):\n        \"\"\"Construct an Verifier instance from a public key or public\n        certificate string.\n\n        Args:\n            public_key (Union[str, bytes]): The public key in PEM format or the\n                x509 public key certificate.\n\n        Returns:\n            Verifier: The constructed verifier.\n\n        Raises:\n            ValueError: If the public key can't be parsed.\n        \"\"\"\n        public_key_data = _helpers.to_bytes(public_key)\n\n        if _CERTIFICATE_MARKER in public_key_data:\n            cert = cryptography.x509.load_pem_x509_certificate(\n                public_key_data, _BACKEND\n            )\n            pubkey = cert.public_key()\n\n        else:\n            pubkey = serialization.load_pem_public_key(public_key_data, _BACKEND)\n\n        return cls(pubkey)\n\n\nclass ES256Signer(base.Signer, base.FromServiceAccountMixin):\n    \"\"\"Signs messages with an ECDSA private key.\n\n    Args:\n        private_key (\n                cryptography.hazmat.primitives.asymmetric.ec.ECDSAPrivateKey):\n            The private key to sign with.\n        key_id (str): Optional key ID used to identify this private key. This\n            can be useful to associate the private key with its associated\n            public key or certificate.\n    \"\"\"\n\n    def __init__(self, private_key, key_id=None):\n        self._key = private_key\n        self._key_id = key_id\n\n    @property\n    @_helpers.copy_docstring(base.Signer)\n    def key_id(self):\n        return self._key_id\n\n    @_helpers.copy_docstring(base.Signer)\n    def sign(self, message):\n        message = _helpers.to_bytes(message)\n        asn1_signature = self._key.sign(message, ec.ECDSA(hashes.SHA256()))\n\n        # Convert ASN1 encoded signature to (r||s) raw signature.\n        (r, s) = decode_dss_signature(asn1_signature)\n        return utils.int_to_bytes(r, 32) + utils.int_to_bytes(s, 32)\n\n    @classmethod\n    def from_string(cls, key, key_id=None):\n        \"\"\"Construct a RSASigner from a private key in PEM format.\n\n        Args:\n            key (Union[bytes, str]): Private key in PEM format.\n            key_id (str): An optional key id used to identify the private key.\n\n        Returns:\n            google.auth.crypt._cryptography_rsa.RSASigner: The\n            constructed signer.\n\n        Raises:\n            ValueError: If ``key`` is not ``bytes`` or ``str`` (unicode).\n            UnicodeDecodeError: If ``key`` is ``bytes`` but cannot be decoded\n                into a UTF-8 ``str``.\n            ValueError: If ``cryptography`` \"Could not deserialize key data.\"\n        \"\"\"\n        key = _helpers.to_bytes(key)\n        private_key = serialization.load_pem_private_key(\n            key, password=None, backend=_BACKEND\n        )\n        return cls(private_key, key_id=key_id)\n", "path": "google/auth/crypt/es256.py"}]}