From f02e9a313221e7b69f064c3c716718e2f46c7742 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Sun, 2 Nov 2014 17:13:56 +0800 Subject: [PATCH] fix EVP_CIPHER_CTX_new's arg types --- shadowsocks/crypto/ctypes_openssl.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/shadowsocks/crypto/ctypes_openssl.py b/shadowsocks/crypto/ctypes_openssl.py index 39a8edd..0ef8ce0 100644 --- a/shadowsocks/crypto/ctypes_openssl.py +++ b/shadowsocks/crypto/ctypes_openssl.py @@ -49,8 +49,6 @@ def load_openssl(): libcrypto = CDLL(libcrypto_path) libcrypto.EVP_get_cipherbyname.restype = c_void_p libcrypto.EVP_CIPHER_CTX_new.restype = c_void_p - libcrypto.EVP_CIPHER_CTX_new.argtypes = (c_void_p, c_void_p, c_char_p, - c_char_p) libcrypto.EVP_CipherInit_ex.argtypes = (c_void_p, c_void_p, c_char_p, c_char_p, c_char_p, c_int) @@ -90,8 +88,7 @@ class CtypesCrypto(object): raise Exception('cipher %s not found in libcrypto' % cipher_name) key_ptr = c_char_p(key) iv_ptr = c_char_p(iv) - self._ctx = libcrypto.EVP_CIPHER_CTX_new(cipher, None, - key_ptr, iv_ptr) + self._ctx = libcrypto.EVP_CIPHER_CTX_new() if not self._ctx: raise Exception('can not create cipher context') r = libcrypto.EVP_CipherInit_ex(self._ctx, cipher, None,