prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Signer/Verifier deprecation warning has wrong stacklevel
  Seeing this with Cryptography 2.0:
  
  ```
  .../python3.5/site-packages/cryptography/hazmat/backends/openssl/rsa.py:477: DeprecationWarning: signer and verifier have been deprecated. Please use sign and verify instead.
    _warn_sign_verify_deprecated()
  .../python3.5/site-packages/cryptography/hazmat/backends/openssl/rsa.py:382: DeprecationWarning: signer and verifier have been deprecated. Please use sign and verify instead.
    _warn_sign_verify_deprecated()
  ```
  
  I see a few open issues related to deprecations (e.g. #3794), but I'm not sure if any of them cover this particular message.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/cryptography/hazmat/backends/openssl/utils.py`
  Content:
  ```
  1 # This file is dual licensed under the terms of the Apache License, Version
  2 # 2.0, and the BSD License. See the LICENSE file in the root of this repository
  3 # for complete details.
  4 
  5 from __future__ import absolute_import, division, print_function
  6 
  7 import warnings
  8 
  9 from cryptography import utils
  10 from cryptography.hazmat.primitives import hashes
  11 from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
  12 
  13 
  14 def _calculate_digest_and_algorithm(backend, data, algorithm):
  15     if not isinstance(algorithm, Prehashed):
  16         hash_ctx = hashes.Hash(algorithm, backend)
  17         hash_ctx.update(data)
  18         data = hash_ctx.finalize()
  19     else:
  20         algorithm = algorithm._algorithm
  21 
  22     if len(data) != algorithm.digest_size:
  23         raise ValueError(
  24             "The provided data must be the same length as the hash "
  25             "algorithm's digest size."
  26         )
  27 
  28     return (data, algorithm)
  29 
  30 
  31 def _check_not_prehashed(signature_algorithm):
  32     if isinstance(signature_algorithm, Prehashed):
  33         raise TypeError(
  34             "Prehashed is only supported in the sign and verify methods. "
  35             "It cannot be used with signer or verifier."
  36         )
  37 
  38 
  39 def _warn_sign_verify_deprecated():
  40     warnings.warn(
  41         "signer and verifier have been deprecated. Please use sign "
  42         "and verify instead.",
  43         utils.PersistentlyDeprecated,
  44         stacklevel=2
  45     )
  46
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/src/cryptography/hazmat/backends/openssl/utils.py b/src/cryptography/hazmat/backends/openssl/utils.py
  --- a/src/cryptography/hazmat/backends/openssl/utils.py
  +++ b/src/cryptography/hazmat/backends/openssl/utils.py
  @@ -41,5 +41,5 @@
           "signer and verifier have been deprecated. Please use sign "
           "and verify instead.",
           utils.PersistentlyDeprecated,
  -        stacklevel=2
  +        stacklevel=3
       )
  
verification_info: {"golden_diff": "diff --git a/src/cryptography/hazmat/backends/openssl/utils.py b/src/cryptography/hazmat/backends/openssl/utils.py\n--- a/src/cryptography/hazmat/backends/openssl/utils.py\n+++ b/src/cryptography/hazmat/backends/openssl/utils.py\n@@ -41,5 +41,5 @@\n         \"signer and verifier have been deprecated. Please use sign \"\n         \"and verify instead.\",\n         utils.PersistentlyDeprecated,\n-        stacklevel=2\n+        stacklevel=3\n     )\n", "issue": "Signer/Verifier deprecation warning has wrong stacklevel\nSeeing this with Cryptography 2.0:\r\n\r\n```\r\n.../python3.5/site-packages/cryptography/hazmat/backends/openssl/rsa.py:477: DeprecationWarning: signer and verifier have been deprecated. Please use sign and verify instead.\r\n  _warn_sign_verify_deprecated()\r\n.../python3.5/site-packages/cryptography/hazmat/backends/openssl/rsa.py:382: DeprecationWarning: signer and verifier have been deprecated. Please use sign and verify instead.\r\n  _warn_sign_verify_deprecated()\r\n```\r\n\r\nI see a few open issues related to deprecations (e.g. #3794), but I'm not sure if any of them cover this particular message.\n", "before_files": [{"content": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nfrom __future__ import absolute_import, division, print_function\n\nimport warnings\n\nfrom cryptography import utils\nfrom cryptography.hazmat.primitives import hashes\nfrom cryptography.hazmat.primitives.asymmetric.utils import Prehashed\n\n\ndef _calculate_digest_and_algorithm(backend, data, algorithm):\n    if not isinstance(algorithm, Prehashed):\n        hash_ctx = hashes.Hash(algorithm, backend)\n        hash_ctx.update(data)\n        data = hash_ctx.finalize()\n    else:\n        algorithm = algorithm._algorithm\n\n    if len(data) != algorithm.digest_size:\n        raise ValueError(\n            \"The provided data must be the same length as the hash \"\n            \"algorithm's digest size.\"\n        )\n\n    return (data, algorithm)\n\n\ndef _check_not_prehashed(signature_algorithm):\n    if isinstance(signature_algorithm, Prehashed):\n        raise TypeError(\n            \"Prehashed is only supported in the sign and verify methods. \"\n            \"It cannot be used with signer or verifier.\"\n        )\n\n\ndef _warn_sign_verify_deprecated():\n    warnings.warn(\n        \"signer and verifier have been deprecated. Please use sign \"\n        \"and verify instead.\",\n        utils.PersistentlyDeprecated,\n        stacklevel=2\n    )\n", "path": "src/cryptography/hazmat/backends/openssl/utils.py"}], "after_files": [{"content": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nfrom __future__ import absolute_import, division, print_function\n\nimport warnings\n\nfrom cryptography import utils\nfrom cryptography.hazmat.primitives import hashes\nfrom cryptography.hazmat.primitives.asymmetric.utils import Prehashed\n\n\ndef _calculate_digest_and_algorithm(backend, data, algorithm):\n    if not isinstance(algorithm, Prehashed):\n        hash_ctx = hashes.Hash(algorithm, backend)\n        hash_ctx.update(data)\n        data = hash_ctx.finalize()\n    else:\n        algorithm = algorithm._algorithm\n\n    if len(data) != algorithm.digest_size:\n        raise ValueError(\n            \"The provided data must be the same length as the hash \"\n            \"algorithm's digest size.\"\n        )\n\n    return (data, algorithm)\n\n\ndef _check_not_prehashed(signature_algorithm):\n    if isinstance(signature_algorithm, Prehashed):\n        raise TypeError(\n            \"Prehashed is only supported in the sign and verify methods. \"\n            \"It cannot be used with signer or verifier.\"\n        )\n\n\ndef _warn_sign_verify_deprecated():\n    warnings.warn(\n        \"signer and verifier have been deprecated. Please use sign \"\n        \"and verify instead.\",\n        utils.PersistentlyDeprecated,\n        stacklevel=3\n    )\n", "path": "src/cryptography/hazmat/backends/openssl/utils.py"}]}