Py3k: Fix test_importKey: Don't pass unicode string to .decrypt()
We work with bytes, not unicode.
diff --git a/lib/Crypto/SelfTest/PublicKey/test_importKey.py b/lib/Crypto/SelfTest/PublicKey/test_importKey.py
index ac22c5f..f9ae51a 100644
--- a/lib/Crypto/SelfTest/PublicKey/test_importKey.py
+++ b/lib/Crypto/SelfTest/PublicKey/test_importKey.py
@@ -128,14 +128,14 @@
def testImportKey5(self):
"""Verifies that the imported key is still a valid RSA pair"""
key = RSA.importKey(self.rsaKeyPEM)
- idem = key.encrypt(key.decrypt("Test"),0)
- self.assertEqual(idem[0],"Test")
+ idem = key.encrypt(key.decrypt(b("Test")),0)
+ self.assertEqual(idem[0],b("Test"))
def testImportKey6(self):
"""Verifies that the imported key is still a valid RSA pair"""
key = RSA.importKey(self.rsaKeyDER)
- idem = key.encrypt(key.decrypt("Test"),0)
- self.assertEqual(idem[0],"Test")
+ idem = key.encrypt(key.decrypt(b("Test")),0)
+ self.assertEqual(idem[0],b("Test"))
###
def testExportKey1(self):