From: Victor Wagner Date: Mon, 9 Jun 2014 08:51:36 +0000 (+0400) Subject: fix forgotten encrypt=False in the test X-Git-Url: https://www.wagner.pp.ru/gitweb/?p=oss%2Fctypescrypto.git;a=commitdiff_plain;h=e8dffb7c99079c721654f783dbccf274147956d3 fix forgotten encrypt=False in the test --- 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__':