]> www.wagner.pp.ru Git - oss/ctypescrypto.git/blobdiff - ctypescrypto/oid.py
Fix incompatibilities with OpenSSL 1.1.0
[oss/ctypescrypto.git] / ctypescrypto / oid.py
index 569739e6b7360c8c411580957847afd4117143e2..516c2e9e1331416209de3002d3b0a6f28fabe0a9 100644 (file)
@@ -42,7 +42,7 @@ class Oid(object):
 
     def __init__(self, value):
         """
-        Object constuctor. Accepts string, integer, or another Oid
+        Object constructor. Accepts string, integer, or another Oid
         object.
 
         Integer should be OpenSSL numeric identifier (nid) as returned
@@ -133,8 +133,11 @@ def cleanup():
     """
     Removes all the objects, dynamically added by current
     application from database.
+
+    Note that in OpenSSL 1.1.0 and above OBJ_cleanup really does nothing
     """
-    libcrypto.OBJ_cleanup()
+    if hasattr(libcrypto,"OBJ_cleanup"):
+        libcrypto.OBJ_cleanup()
 
 libcrypto.OBJ_nid2sn.restype = c_char_p
 libcrypto.OBJ_nid2ln.restype = c_char_p