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

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

Issue 210323002: Update tlslite to 0.4.6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Executable bit and --similarity=80 Created 6 years, 8 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/tlslite/utils/pycrypto_rc4.py
diff --git a/third_party/tlslite/tlslite/utils/pycrypto_rc4.py b/third_party/tlslite/tlslite/utils/pycrypto_rc4.py
index a9f11406115fab365513153407aea729bf3c79dd..fc98d7c78b1cad53cbe71c7ce6ff8c63e7895ad1 100644
--- a/third_party/tlslite/tlslite/utils/pycrypto_rc4.py
+++ b/third_party/tlslite/tlslite/utils/pycrypto_rc4.py
@@ -1,7 +1,10 @@
+# Author: Trevor Perrin
+# See the LICENSE file for legal information regarding use of this file.
+
"""PyCrypto RC4 implementation."""
-from cryptomath import *
-from rc4 import *
+from .cryptomath import *
+from .rc4 import *
if pycryptoLoaded:
import Crypto.Cipher.ARC4
@@ -13,10 +16,13 @@ if pycryptoLoaded:
def __init__(self, key):
RC4.__init__(self, key, "pycrypto")
+ key = bytes(key)
self.context = Crypto.Cipher.ARC4.new(key)
def encrypt(self, plaintext):
- return self.context.encrypt(plaintext)
+ plaintext = bytes(plaintext)
+ return bytearray(self.context.encrypt(plaintext))
def decrypt(self, ciphertext):
- return self.context.decrypt(ciphertext)
+ ciphertext = bytes(ciphertext)
+ return bytearray(self.context.decrypt(ciphertext))
« no previous file with comments | « third_party/tlslite/tlslite/utils/pycrypto_aes.py ('k') | third_party/tlslite/tlslite/utils/pycrypto_rsakey.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698