aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/backends/openssl/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptography/hazmat/backends/openssl/utils.py')
-rw-r--r--src/cryptography/hazmat/backends/openssl/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/utils.py b/src/cryptography/hazmat/backends/openssl/utils.py
index e8b4a307..f71a62a5 100644
--- a/src/cryptography/hazmat/backends/openssl/utils.py
+++ b/src/cryptography/hazmat/backends/openssl/utils.py
@@ -23,3 +23,11 @@ def _calculate_digest_and_algorithm(backend, data, algorithm):
)
return (data, algorithm)
+
+
+def _check_not_prehashed(signature_algorithm):
+ if isinstance(signature_algorithm, Prehashed):
+ raise TypeError(
+ "Prehashed is only supported in the sign and verify methods. "
+ "It cannot be used with signer or verifier."
+ )