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

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

Issue 211173006: Perform tlslite 0.3.8 -> 0.4.6 renames ahead of time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop the -B 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 """Class for storing shared keys.""" 1 """Class for storing shared keys."""
2 2
3 from utils.cryptomath import * 3 from utils.cryptomath import *
4 from utils.compat import * 4 from utils.compat import *
5 from mathtls import * 5 from mathtls import *
6 from Session import Session 6 from session import Session
7 from BaseDB import BaseDB 7 from basedb import BaseDB
8 8
9 class SharedKeyDB(BaseDB): 9 class SharedKeyDB(BaseDB):
10 """This class represent an in-memory or on-disk database of shared 10 """This class represent an in-memory or on-disk database of shared
11 keys. 11 keys.
12 12
13 A SharedKeyDB can be passed to a server handshake function to 13 A SharedKeyDB can be passed to a server handshake function to
14 authenticate a client based on one of the shared keys. 14 authenticate a client based on one of the shared keys.
15 15
16 This class is thread-safe. 16 This class is thread-safe.
17 """ 17 """
(...skipping 30 matching lines...) Expand all
48 48
49 def _setItem(self, username, value): 49 def _setItem(self, username, value):
50 if len(username)>16: 50 if len(username)>16:
51 raise ValueError("username too long") 51 raise ValueError("username too long")
52 if len(value)>=48: 52 if len(value)>=48:
53 raise ValueError("shared key too long") 53 raise ValueError("shared key too long")
54 return value 54 return value
55 55
56 def _checkItem(self, value, username, param): 56 def _checkItem(self, value, username, param):
57 newSession = self._getItem(username, param) 57 newSession = self._getItem(username, param)
58 return value.masterSecret == newSession.masterSecret 58 return value.masterSecret == newSession.masterSecret
OLDNEW
« no previous file with comments | « third_party/tlslite/tlslite/sessioncache.py ('k') | third_party/tlslite/tlslite/tlsconnection.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698