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

Unified Diff: third_party/tlslite/tlslite/utils/cryptomath.py

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/tlslite/tlslite/utils/RSAKey.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tlslite/tlslite/utils/cryptomath.py
diff --git a/third_party/tlslite/tlslite/utils/cryptomath.py b/third_party/tlslite/tlslite/utils/cryptomath.py
index 385095ddcdc130b8e53782cdb77577610259be1a..86da25e52498d44358a720d0f17c1f170d2bfbe0 100644
--- a/third_party/tlslite/tlslite/utils/cryptomath.py
+++ b/third_party/tlslite/tlslite/utils/cryptomath.py
@@ -129,8 +129,9 @@ def bytesToNumber(bytes):
multiplier *= 256
return total
-def numberToBytes(n):
- howManyBytes = numBytes(n)
+def numberToBytes(n, howManyBytes=None):
+ if howManyBytes == None:
+ howManyBytes = numBytes(n)
bytes = createByteArrayZeros(howManyBytes)
for count in range(howManyBytes-1, -1, -1):
bytes[count] = int(n % 256)
« no previous file with comments | « third_party/tlslite/tlslite/utils/RSAKey.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698