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

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

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
« no previous file with comments | « third_party/tlslite/tlslite/utils/python_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/rsakey.py
diff --git a/third_party/tlslite/tlslite/utils/rsakey.py b/third_party/tlslite/tlslite/utils/rsakey.py
index 3f2100ebc0d09b3d9d96b7be8b4fc9fc2925775a..fb022cc6445d0ad2fa244e147d89ee3f09e93531 100644
--- a/third_party/tlslite/tlslite/utils/rsakey.py
+++ b/third_party/tlslite/tlslite/utils/rsakey.py
@@ -60,7 +60,7 @@ class RSAKey(object):
@return: A PKCS1-SHA1 signature on the passed-in data.
"""
hashBytes = SHA1(bytearray(bytes))
- prefixedHashBytes = self._addPKCS1SHA1Prefix(hashBytes)
+ prefixedHashBytes = self.addPKCS1SHA1Prefix(hashBytes)
sigBytes = self.sign(prefixedHashBytes)
return sigBytes
@@ -81,8 +81,8 @@ class RSAKey(object):
hashBytes = SHA1(bytearray(bytes))
# Try it with/without the embedded NULL
- prefixedHashBytes1 = self._addPKCS1SHA1Prefix(hashBytes, False)
- prefixedHashBytes2 = self._addPKCS1SHA1Prefix(hashBytes, True)
+ prefixedHashBytes1 = self.addPKCS1SHA1Prefix(hashBytes, False)
+ prefixedHashBytes2 = self.addPKCS1SHA1Prefix(hashBytes, True)
result1 = self.verify(sigBytes, prefixedHashBytes1)
result2 = self.verify(sigBytes, prefixedHashBytes2)
return (result1 or result2)
@@ -221,7 +221,8 @@ class RSAKey(object):
# Helper Functions for RSA Keys
# **************************************************************************
- def _addPKCS1SHA1Prefix(self, bytes, withNULL=True):
+ @staticmethod
+ def addPKCS1SHA1Prefix(bytes, withNULL=True):
# There is a long history of confusion over whether the SHA1
# algorithmIdentifier should be encoded with a NULL parameter or
# with the parameter omitted. While the original intention was
@@ -229,8 +230,7 @@ class RSAKey(object):
# specifies the NULL should be included, and this behavior is also
# mandated in recent versions of PKCS #1, and is what tlslite has
# always implemented. Anyways, verification code should probably
- # accept both. However, nothing uses this code yet, so this is
- # all fairly moot.
+ # accept both.
if not withNULL:
prefixBytes = bytearray(\
[0x30,0x1f,0x30,0x07,0x06,0x05,0x2b,0x0e,0x03,0x02,0x1a,0x04,0x14])
« no previous file with comments | « third_party/tlslite/tlslite/utils/python_rsakey.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698