diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 00:27:57 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 00:27:57 +0000 |
commit | 765c3a76b335665565da7174ad309f651548f2dc (patch) | |
tree | 5d9c34fe26a3708e28ae1a54f694d9ad375fed42 /third_party/tlslite | |
parent | 198d45d62ccf710566c479536e8342efda52f966 (diff) | |
download | chromium_src-765c3a76b335665565da7174ad309f651548f2dc.zip chromium_src-765c3a76b335665565da7174ad309f651548f2dc.tar.gz chromium_src-765c3a76b335665565da7174ad309f651548f2dc.tar.bz2 |
Replaced sha, md5 module imports with hashlib.
TEST=make sure desktopui_BrowserTest autotest works on ChromeOS
BUG=chromium-os:4828
Review URL: http://codereview.chromium.org/2881026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/tlslite')
-rw-r--r-- | third_party/tlslite/tlslite/TLSRecordLayer.py | 15 | ||||
-rw-r--r-- | third_party/tlslite/tlslite/mathtls.py | 14 | ||||
-rw-r--r-- | third_party/tlslite/tlslite/messages.py | 13 | ||||
-rw-r--r-- | third_party/tlslite/tlslite/utils/cryptomath.py | 13 |
4 files changed, 48 insertions, 7 deletions
diff --git a/third_party/tlslite/tlslite/TLSRecordLayer.py b/third_party/tlslite/tlslite/TLSRecordLayer.py index 4a9042c..1bbd09d 100644 --- a/third_party/tlslite/tlslite/TLSRecordLayer.py +++ b/third_party/tlslite/tlslite/TLSRecordLayer.py @@ -12,8 +12,19 @@ from constants import * from utils.cryptomath import getRandomBytes from utils import hmac from FileObject import FileObject -import sha -import md5 + +# The sha module is deprecated in Python 2.6 +try: + import sha +except ImportError: + from hashlib import sha1 as sha + +# The md5 module is deprecated in Python 2.6 +try: + import md5 +except ImportError: + from hashlib import md5 + import socket import errno import traceback diff --git a/third_party/tlslite/tlslite/mathtls.py b/third_party/tlslite/tlslite/mathtls.py index 3b8ede6..7f75904 100644 --- a/third_party/tlslite/tlslite/mathtls.py +++ b/third_party/tlslite/tlslite/mathtls.py @@ -4,8 +4,18 @@ from utils.compat import * from utils.cryptomath import * import hmac -import md5 -import sha + +# The sha module is deprecated in Python 2.6 +try: + import sha +except ImportError: + from hashlib import sha1 as sha + +# The md5 module is deprecated in Python 2.6 +try: + import md5 +except ImportError: + from hashlib import md5 #1024, 1536, 2048, 3072, 4096, 6144, and 8192 bit groups] goodGroupParameters = [(2,0xEEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576D674DF7496EA81D3383B4813D692C6E0E0D5D8E250B98BE48E495C1D6089DAD15DC7D7B46154D6B6CE8EF4AD69B15D4982559B297BCF1885C529F566660E57EC68EDBC3C05726CC02FD4CBF4976EAA9AFD5138FE8376435B9FC61D2FC0EB06E3),\ diff --git a/third_party/tlslite/tlslite/messages.py b/third_party/tlslite/tlslite/messages.py index afccc79..06c46b9 100644 --- a/third_party/tlslite/tlslite/messages.py +++ b/third_party/tlslite/tlslite/messages.py @@ -8,8 +8,17 @@ from constants import * from X509 import X509 from X509CertChain import X509CertChain -import sha -import md5 +# The sha module is deprecated in Python 2.6 +try: + import sha +except ImportError: + from hashlib import sha1 as sha + +# The md5 module is deprecated in Python 2.6 +try: + import md5 +except ImportError: + from hashlib import md5 class RecordHeader3: def __init__(self): diff --git a/third_party/tlslite/tlslite/utils/cryptomath.py b/third_party/tlslite/tlslite/utils/cryptomath.py index 51d6dff..385095d 100644 --- a/third_party/tlslite/tlslite/utils/cryptomath.py +++ b/third_party/tlslite/tlslite/utils/cryptomath.py @@ -6,7 +6,18 @@ import os import math import base64 import binascii -import sha + +# The sha module is deprecated in Python 2.6 +try: + import sha +except ImportError: + from hashlib import sha1 as sha + +# The md5 module is deprecated in Python 2.6 +try: + import md5 +except ImportError: + from hashlib import md5 from compat import * |