summaryrefslogtreecommitdiff
path: root/M2Crypto
diff options
context:
space:
mode:
Diffstat (limited to 'M2Crypto')
-rw-r--r--M2Crypto/EVP.py10
-rw-r--r--M2Crypto/X509.py3
2 files changed, 12 insertions, 1 deletions
diff --git a/M2Crypto/EVP.py b/M2Crypto/EVP.py
index 7b1efc6..c48b670 100644
--- a/M2Crypto/EVP.py
+++ b/M2Crypto/EVP.py
@@ -298,6 +298,11 @@ class PKey(object):
:return: The signature.
"""
+
+ if m2.OPENSSL_VERSION_NUMBER < 0x10101000:
+ raise NotImplemented('This method requires OpenSSL version ' +
+ '1.1.1 or greater.')
+
return m2.digest_sign(self.ctx, data)
def digest_verify_init(self):
@@ -341,6 +346,11 @@ class PKey(object):
:return: Result of verification: 1 for success, 0 for failure, -1 on
other error.
"""
+
+ if m2.OPENSSL_VERSION_NUMBER < 0x10101000:
+ raise NotImplemented('This method requires OpenSSL version ' +
+ '1.1.1 or greater.')
+
return m2.digest_verify(self.ctx, sign, data)
def assign_rsa(self, rsa, capture=1):
diff --git a/M2Crypto/X509.py b/M2Crypto/X509.py
index 20beb4a..3b62dda 100644
--- a/M2Crypto/X509.py
+++ b/M2Crypto/X509.py
@@ -29,7 +29,8 @@ verify_ignore_critical = m2.VERIFY_IGNORE_CRITICAL
verify_inhibit_any = m2.VERIFY_INHIBIT_ANY
verify_inhibit_map = m2.VERIFY_INHIBIT_MAP
verify_no_alt_chains = m2.VERIFY_NO_ALT_CHAINS
-verify_no_check_time = m2.VERIFY_NO_CHECK_TIME
+if hasattr(m2, "VERIFY_NO_CHECK_TIME"):
+ verify_no_check_time = m2.VERIFY_NO_CHECK_TIME
verify_notify_policy = m2.VERIFY_NOTIFY_POLICY
verify_partial_chain = m2.VERIFY_PARTIAL_CHAIN
verify_policy_check = m2.VERIFY_POLICY_CHECK