Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: third_party/tlslite/patches/rsa_signature_length.patch

Issue 168903005: Ensure that RSA signatures have the correct length (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small correction to README.chromium. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/tlslite/README.chromium ('k') | third_party/tlslite/tlslite/utils/RSAKey.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 diff --git a/third_party/tlslite/tlslite/utils/RSAKey.py b/third_party/tlslite/t lslite/utils/RSAKey.py
2 index 37c292d..1b91742 100644
3 --- a/third_party/tlslite/tlslite/utils/RSAKey.py
4 +++ b/third_party/tlslite/tlslite/utils/RSAKey.py
5 @@ -117,7 +117,7 @@ class RSAKey:
6 if m >= self.n:
7 raise ValueError()
8 c = self._rawPrivateKeyOp(m)
9 - sigBytes = numberToBytes(c)
10 + sigBytes = numberToBytes(c, numBytes(self.n))
11 return sigBytes
12
13 def verify(self, sigBytes, bytes):
14 diff --git a/third_party/tlslite/tlslite/utils/cryptomath.py b/third_party/tlsli te/tlslite/utils/cryptomath.py
15 index 385095d..86da25e 100644
16 --- a/third_party/tlslite/tlslite/utils/cryptomath.py
17 +++ b/third_party/tlslite/tlslite/utils/cryptomath.py
18 @@ -129,8 +129,9 @@ def bytesToNumber(bytes):
19 multiplier *= 256
20 return total
21
22 -def numberToBytes(n):
23 - howManyBytes = numBytes(n)
24 +def numberToBytes(n, howManyBytes=None):
25 + if howManyBytes == None:
26 + howManyBytes = numBytes(n)
27 bytes = createByteArrayZeros(howManyBytes)
28 for count in range(howManyBytes-1, -1, -1):
29 bytes[count] = int(n % 256)
OLDNEW
« no previous file with comments | « third_party/tlslite/README.chromium ('k') | third_party/tlslite/tlslite/utils/RSAKey.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698