summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Manganiello <adamantike@users.noreply.github.com>2016-04-23 05:46:16 -0300
committerSybren A. Stüvel <sybren@stuvel.eu>2016-04-23 10:46:16 +0200
commitcf124d3fbf4aaa98da36d65ec92daf0d7bc8c094 (patch)
treef41fd8b38159c4d78d9fd35c9235ab7834a6cdc6 /tests
parentfb062b303a84f716e6180a365f7f507c662152f7 (diff)
downloadrsa-git-cf124d3fbf4aaa98da36d65ec92daf0d7bc8c094.tar.gz
Fix edge case for byte() call at pkcs1 test (#64)
Nice catch :)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pkcs1.py3
1 files changed, 2 insertions, 1 deletions
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 @@ class BinaryTest(unittest.TestCase):
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)