From 0b71a493c4661ee64d8ec27c364c01af11e80737 Mon Sep 17 00:00:00 2001 From: Victor Wagner Date: Mon, 20 Jun 2016 17:48:33 +0300 Subject: [PATCH] Added prototypes for CMS_get0_type and OBJ_obj2nid --- ctypescrypto/__init__.py | 2 ++ ctypescrypto/cms.py | 2 ++ ctypescrypto/oid.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/ctypescrypto/__init__.py b/ctypescrypto/__init__.py index c55ae11..1213398 100644 --- a/ctypescrypto/__init__.py +++ b/ctypescrypto/__init__.py @@ -25,6 +25,8 @@ else: if __libname__ is None: raise OSError("Cannot find OpenSSL crypto library") +#__libname__ = "/usr/local/ssl/lib/libcrypto.so.1.1" + libcrypto = CDLL(__libname__) libcrypto.OPENSSL_config.argtypes = (c_char_p, ) libcrypto.OPENSSL_add_all_algorithms_conf() diff --git a/ctypescrypto/cms.py b/ctypescrypto/cms.py index 685d52b..f7e5e16 100644 --- a/ctypescrypto/cms.py +++ b/ctypescrypto/cms.py @@ -306,6 +306,8 @@ class EncryptedData(CMSBase): __all__ = ['CMS', 'CMSError', 'Flags', 'SignedData', 'EnvelopedData', 'EncryptedData'] +libcrypto.CMS_get0_type.restype = c_void_p +libcrypto.CMS_get0_type.argtypes = (c_void_p,) libcrypto.CMS_add1_cert.restype = c_int libcrypto.CMS_add1_cert.argtypes = (c_void_p, c_void_p) libcrypto.CMS_decrypt.restype = c_int diff --git a/ctypescrypto/oid.py b/ctypescrypto/oid.py index 28e12ba..569739e 100644 --- a/ctypescrypto/oid.py +++ b/ctypescrypto/oid.py @@ -139,6 +139,8 @@ def cleanup(): libcrypto.OBJ_nid2sn.restype = c_char_p libcrypto.OBJ_nid2ln.restype = c_char_p libcrypto.OBJ_nid2obj.restype = c_void_p +libcrypto.OBJ_obj2nid.restype = c_int libcrypto.OBJ_obj2txt.argtypes = (c_char_p, c_int, c_void_p, c_int) libcrypto.OBJ_txt2nid.argtupes = (c_char_p, ) +libcrypto.OBJ_obj2nid.argtupes = (c_void_p, ) libcrypto.OBJ_create.argtypes = (c_char_p, c_char_p, c_char_p) -- 2.39.2