From e8dffb7c99079c721654f783dbccf274147956d3 Mon Sep 17 00:00:00 2001 From: Victor Wagner Date: Mon, 9 Jun 2014 12:51:36 +0400 Subject: [PATCH] fix forgotten encrypt=False in the test --- ctypescrypto/cipher.py | 2 +- tests/testcipher.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ctypescrypto/cipher.py b/ctypescrypto/cipher.py index 91c5283..f4a2d47 100644 --- a/ctypescrypto/cipher.py +++ b/ctypescrypto/cipher.py @@ -225,4 +225,4 @@ libcrypto.EVP_CIPHER_nid.argtypes=(c_void_p,) libcrypto.EVP_CipherUpdate.argtypes=(c_void_p,c_char_p,POINTER(c_int),c_char_p,c_int) libcrypto.EVP_get_cipherbyname.restype=c_void_p libcrypto.EVP_get_cipherbyname.argtypes=(c_char_p,) - +libcrypto.EVP_CIPHER_CTX_set_key_length.argtypes=(c_void_p,c_int) diff --git a/tests/testcipher.py b/tests/testcipher.py index de426cb..d9857cf 100644 --- a/tests/testcipher.py +++ b/tests/testcipher.py @@ -84,7 +84,7 @@ class TestEncryptDecrypt(unittest.TestCase): c=cipher.new("bf-ofb",encryptkey,iv=iv) ciphertext=c.update(data)+c.finish() decryptkey=encryptkey[0:5]+encryptkey[5:] - d=cipher.new("bf-ofb",decryptkey,iv=iv) + d=cipher.new("bf-ofb",decryptkey,encrypt=False,iv=iv) deciph=d.update(ciphertext)+d.finish() self.assertEqual(deciph,data) if __name__ == '__main__': -- 2.39.5