]> wagner.pp.ru Git - oss/ctypescrypto.git/commitdiff
Added explicit check for CMS functions in libcrypto master
authorVictor Wagner <vitus@wagner.pp.ru>
Sun, 13 May 2018 04:14:44 +0000 (07:14 +0300)
committerVictor Wagner <vitus@wagner.pp.ru>
Sun, 13 May 2018 04:14:44 +0000 (07:14 +0300)
ctypescrypto/cms.py

index 8e856f50c24a5f5674282882db78e8aee7dd9268..d92b7335f2dc4917352c0c422a6376332dd6f016 100644 (file)
@@ -17,6 +17,12 @@ from ctypescrypto.bio import Membio
 from ctypescrypto.oid import Oid
 from ctypescrypto.x509 import StackOfX509
 
 from ctypescrypto.oid import Oid
 from ctypescrypto.x509 import StackOfX509
 
+# Check for neccesary functionality in libcrypto
+# LibreSSL fails this check
+
+if not hasattr(libcrypto,"CMS_decrypt"):
+    raise OSError("libcrypto lacks CMS functionality. Try using different libcrypto")
+
 class CMSError(LibCryptoError):
     """
     Exception which is raised when error occurs
 class CMSError(LibCryptoError):
     """
     Exception which is raised when error occurs