Cannot encrypt a string > 124 bytes
Status: Alpha
Brought to you by:
trevp
For some reason, if I try to encrypt a string greater
than 124 bytes, I get the following exception:
File
"/usr/lib/python2.4/site-packages/tlslite/utils/RSAKey.py",
line 156, in encrypt
paddedBytes = self._addPKCS1Padding(bytes, 2)
File
"/usr/lib/python2.4/site-packages/tlslite/utils/RSAKey.py",
line 262, in _addPKCS1Padding
padding = createByteArraySequence([blockType] +
pad + [0])
TypeError: can only concatenate list (not
"array.array") to list
Looking at the code, I couldn't find anything
obvious, but I didn't really look that hard.
I have attached a test case.
Test case showing that strings greater than 124 bytes cannot be encrypted