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

Unified Diff: third_party/tlslite/patches/pycrypto_python2.patch

Issue 858373002: Update third_party/tlslite to 0.4.8. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish fixing client auth Created 5 years, 11 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
Index: third_party/tlslite/patches/pycrypto_python2.patch
diff --git a/third_party/tlslite/patches/pycrypto_python2.patch b/third_party/tlslite/patches/pycrypto_python2.patch
deleted file mode 100644
index 923c1d4d6b0ae5b67d4283ed5cf120237ac0676e..0000000000000000000000000000000000000000
--- a/third_party/tlslite/patches/pycrypto_python2.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/third_party/tlslite/tlslite/utils/compat.py b/third_party/tlslite/tlslite/utils/compat.py
-index 2bcaede..db95ac1 100755
---- a/third_party/tlslite/tlslite/utils/compat.py
-+++ b/third_party/tlslite/tlslite/utils/compat.py
-@@ -51,6 +51,9 @@ if sys.version_info >= (3,0):
- def readStdinBinary():
- return sys.stdin.buffer.read()
-
-+ def long(n):
-+ return n
-+
- else:
- # Python 2.6 requires strings instead of bytearrays in a couple places,
- # so we define this function so it does the conversion if needed.
-diff --git a/third_party/tlslite/tlslite/utils/cryptomath.py b/third_party/tlslite/tlslite/utils/cryptomath.py
-index ce56b4b..30354b2 100755
---- a/third_party/tlslite/tlslite/utils/cryptomath.py
-+++ b/third_party/tlslite/tlslite/utils/cryptomath.py
-@@ -94,7 +94,9 @@ def bytesToNumber(b):
- byte = b[count]
- total += multiplier * byte
- multiplier *= 256
-- return total
-+ # Force-cast to long to appease PyCrypto.
-+ # https://github.com/trevp/tlslite/issues/15
-+ return long(total)
-
- def numberToByteArray(n, howManyBytes=None):
- """Convert an integer into a bytearray, zero-pad to howManyBytes.
-diff --git a/third_party/tlslite/tlslite/utils/pycrypto_rsakey.py b/third_party/tlslite/tlslite/utils/pycrypto_rsakey.py
-index 3d56228..4de5436 100755
---- a/third_party/tlslite/tlslite/utils/pycrypto_rsakey.py
-+++ b/third_party/tlslite/tlslite/utils/pycrypto_rsakey.py
-@@ -26,13 +26,13 @@ if pycryptoLoaded:
- return self.rsa.has_private()
-
- def _rawPrivateKeyOp(self, m):
-- s = numberToString(m, numBytes(self.n))
-- c = stringToNumber(self.rsa.decrypt((s,)))
-+ s = bytes(numberToByteArray(m, numBytes(self.n)))
-+ c = bytesToNumber(bytearray(self.rsa.decrypt((s,))))
- return c
-
- def _rawPublicKeyOp(self, c):
-- s = numberToString(c, numBytes(self.n))
-- m = stringToNumber(self.rsa.encrypt(s, None)[0])
-+ s = bytes(numberToByteArray(c, numBytes(self.n)))
-+ m = bytesToNumber(bytearray(self.rsa.encrypt(s, None)[0]))
- return m
-
- def generate(bits):
« no previous file with comments | « third_party/tlslite/patches/intolerance_options.patch ('k') | third_party/tlslite/patches/req_cert_types.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698