From bdf1a9ecff137aa64a65d90ca139c0797924bd6e Mon Sep 17 00:00:00 2001 From: Victor Wagner Date: Fri, 6 Jun 2014 17:59:55 +0400 Subject: [PATCH] Ensured that encrypt and decrypt in test_ofb_noiv use physically different keys --- tests/testcipher.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/testcipher.py b/tests/testcipher.py index 052193c..ae74d41 100644 --- a/tests/testcipher.py +++ b/tests/testcipher.py @@ -56,12 +56,15 @@ class TestEncryptDecrypt(unittest.TestCase): def test_ofb_noiv(self): data="sdfdsddfxx" - key='abcdabcd' - c=cipher.new("AES-256-OFB",key) + encryptkey='abcdabcd'*4 + decryptkey=encryptkey[0:5]+encryptkey[5:] + + + c=cipher.new("AES-256-OFB",encryptkey) enc=c.update(data)+c.finish() # See if padding is added by default self.assertEqual(len(enc),len(data)) - d=cipher.new("AES-256-OFB",key,encrypt=False) + d=cipher.new("AES-256-OFB",decryptkey) dec=d.update(enc)+d.finish() self.assertEqual(data,dec) if __name__ == '__main__': -- 2.39.5