Changeset 118
- Timestamp:
- Oct 7, 2007, 5:17:25 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/vnc/vnc_server/vncexternalauth.py
r115 r118 66 66 return #FIXME 67 67 token = base64.urlsafe_b64decode(token) 68 token = cPickle.load (token)68 token = cPickle.loads(token) 69 69 m = hmac.new(TOKEN_KEY, digestmod=sha) 70 70 m.update(token['data']) 71 71 if (m.digest() == token['digest']): 72 data = cPickle.load (token['data'])72 data = cPickle.loads(token['data']) 73 73 expires = data["expires"] 74 74 if (time.time() < expires): -
trunk/web/templates/main.py
r113 r118 6 6 import string 7 7 import subprocess 8 import time 9 import cPickle 10 import base64 8 11 9 12 print 'Content-Type: text/html\n' … … 207 210 if machine is None: #gave error page already 208 211 return 209 token = 'quentin' 212 213 TOKEN_KEY = "0M6W0U1IXexThi5idy8mnkqPKEq1LtEnlK/pZSn0cDrN" 214 215 data = {} 216 data["user"] = user 217 data["machine"]=machine 218 data["expires"]=time.time()+(5*60) 219 pickledData = cPickle.dumps(data) 220 m = hmac.new(TOKEN_KEY, digestmod=sha) 221 m.update(pickledData) 222 token = {'data': pickledData, 'digest': m.digest()} 223 token = cPickle.dumps(token) 224 token = base64.urlsafe_b64encode(token) 225 210 226 d = dict(user=user, 211 227 machine=machine,
Note: See TracChangeset
for help on using the changeset viewer.