diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-04-01 12:02:02 +0100 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-04-01 12:11:08 +0100 |
commit | 621635712962267e589b19fb2292a764e5ad71de (patch) | |
tree | 2a05ae3b20bd56ed968e105ba0e45a72e79d372d /cryptography | |
parent | 476682af2d4a9438026e69b6c1f3500c19f2f200 (diff) | |
download | cryptography-621635712962267e589b19fb2292a764e5ad71de.tar.gz cryptography-621635712962267e589b19fb2292a764e5ad71de.tar.bz2 cryptography-621635712962267e589b19fb2292a764e5ad71de.zip |
Add _Reasons.UNSUPPORTED_MGF
Diffstat (limited to 'cryptography')
-rw-r--r-- | cryptography/exceptions.py | 1 | ||||
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/cryptography/exceptions.py b/cryptography/exceptions.py index 4b4d4c37..d2782be6 100644 --- a/cryptography/exceptions.py +++ b/cryptography/exceptions.py @@ -19,6 +19,7 @@ class _Reasons(object): UNSUPPORTED_HASH = object() UNSUPPORTED_CIPHER = object() UNSUPPORTED_PADDING = object() + UNSUPPORTED_MGF = object() class UnsupportedAlgorithm(Exception): diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index 753717d4..3293741c 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -731,7 +731,8 @@ class _RSASignatureContext(object): elif isinstance(padding, PSS): if not isinstance(padding._mgf, MGF1): raise UnsupportedAlgorithm( - "Only MGF1 is supported by this backend" + "Only MGF1 is supported by this backend", + _Reasons.UNSUPPORTED_MGF ) # Size of key in bytes - 2 is the maximum @@ -915,7 +916,8 @@ class _RSAVerificationContext(object): elif isinstance(padding, PSS): if not isinstance(padding._mgf, MGF1): raise UnsupportedAlgorithm( - "Only MGF1 is supported by this backend" + "Only MGF1 is supported by this backend", + _Reasons.UNSUPPORTED_MGF ) # Size of key in bytes - 2 is the maximum |