X-Git-Url: http://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=ctypescrypto%2F__init__.py;h=a63fed425bdd9abe07d09ce915bb17030968f376;hb=876630b04080b68d724e22066d374ce25efd8a97;hp=1213398b08ff7069421841fe090175cd9ff6f7de;hpb=4b5cbc8c0a6f0ee8527cbc3ab9b8c92d77ec6c9f;p=oss%2Fctypescrypto.git diff --git a/ctypescrypto/__init__.py b/ctypescrypto/__init__.py index 1213398..a63fed4 100644 --- a/ctypescrypto/__init__.py +++ b/ctypescrypto/__init__.py @@ -4,9 +4,10 @@ """ -from ctypes import CDLL, c_char_p +from ctypes import CDLL, c_char_p, c_void_p, c_long,c_uint64 from ctypes.util import find_library import sys +global strings_loaded def config(filename=None): """ @@ -29,4 +30,11 @@ if __libname__ is None: libcrypto = CDLL(__libname__) libcrypto.OPENSSL_config.argtypes = (c_char_p, ) -libcrypto.OPENSSL_add_all_algorithms_conf() + +if hasattr(libcrypto,'OPENSSL_init_crypto'): + libcrypto.OPENSSL_init_crypto.argtypes = (c_uint64,c_void_p) + libcrypto.OPENSSL_init_crypto(2+4+8+0x40,None) + strings_loaded = True +else: + libcrypto.OPENSSL_add_all_algorithms_conf() + strings_loaded = False