trevp/tlslite — pull request #17 by abravetti (2013-11-08 17:19:26+00:00)
Title: Fix RSAKey.decrypt(): Revert a patch that broke compatibility with previ...

...ous tlslite version

The patch in commit 0b8b2b4122109f22900ec929432308dd685f1d45 introduced a check on the size of encBytes that make the library incompatible (sometimes, in a pseudo random way...) with previous versione where encBytes is not padded:

+ if len(sigBytes) != numBytes(self.n):
+ return False

If a check should exists it should be like this:

+ if len(sigBytes) > numBytes(self.n):
+ return False

We need to retain compatibility with text encrypted with tlslite 0.3.8, and generally I think is a bad idea to break compatibility this way.