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

Side by Side Diff: third_party/tlslite/tlslite/messages.py

Issue 2881026: Replaced sha, md5 module imports with hashlib (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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/tlslite/mathtls.py ('k') | third_party/tlslite/tlslite/utils/cryptomath.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """Classes representing TLS messages.""" 1 """Classes representing TLS messages."""
2 2
3 from utils.compat import * 3 from utils.compat import *
4 from utils.cryptomath import * 4 from utils.cryptomath import *
5 from errors import * 5 from errors import *
6 from utils.codec import * 6 from utils.codec import *
7 from constants import * 7 from constants import *
8 from X509 import X509 8 from X509 import X509
9 from X509CertChain import X509CertChain 9 from X509CertChain import X509CertChain
10 10
11 import sha 11 # The sha module is deprecated in Python 2.6
12 import md5 12 try:
13 import sha
14 except ImportError:
15 from hashlib import sha1 as sha
16
17 # The md5 module is deprecated in Python 2.6
18 try:
19 import md5
20 except ImportError:
21 from hashlib import md5
13 22
14 class RecordHeader3: 23 class RecordHeader3:
15 def __init__(self): 24 def __init__(self):
16 self.type = 0 25 self.type = 0
17 self.version = (0,0) 26 self.version = (0,0)
18 self.length = 0 27 self.length = 0
19 self.ssl2 = False 28 self.ssl2 = False
20 29
21 def create(self, version, type, length): 30 def create(self, version, type, length):
22 self.type = type 31 self.type = type
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 def create(self, bytes): 561 def create(self, bytes):
553 self.bytes = bytes 562 self.bytes = bytes
554 return self 563 return self
555 564
556 def parse(self, p): 565 def parse(self, p):
557 self.bytes = p.bytes 566 self.bytes = p.bytes
558 return self 567 return self
559 568
560 def write(self): 569 def write(self):
561 return self.bytes 570 return self.bytes
OLDNEW
« no previous file with comments | « third_party/tlslite/tlslite/mathtls.py ('k') | third_party/tlslite/tlslite/utils/cryptomath.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698