From 85c9494a40f36f283d7f9ba4ecfd98c5ffbafbb8 Mon Sep 17 00:00:00 2001 From: adamantike Date: Sat, 16 Apr 2016 23:48:08 -0300 Subject: [PATCH] Fix edge case for byte() call at pkcs1 test --- tests/test_pkcs1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_pkcs1.py b/tests/test_pkcs1.py index 39555f6..5702aae 100644 --- a/tests/test_pkcs1.py +++ b/tests/test_pkcs1.py @@ -48,7 +48,8 @@ def test_decoding_failure(self): a = encrypted[5] if is_bytes(a): a = ord(a) - encrypted = encrypted[:5] + byte(a + 1) + encrypted[6:] + altered_a = (a + 1) % 256 + encrypted = encrypted[:5] + byte(altered_a) + encrypted[6:] self.assertRaises(pkcs1.DecryptionError, pkcs1.decrypt, encrypted, self.priv)