Changeset 1388
- Timestamp:
- Oct 28, 2008, 8:00:19 PM (16 years ago)
- Location:
- trunk/packages/invirt-vnc-server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-vnc-server/debian/changelog
r1386 r1388 2 2 3 3 * sipb-xen-vnc-server -> invirt-vnc-server 4 * Generate the VNC token key at install-time instead of hard-coding 4 5 5 -- Evan Broder <broder@mit.edu> Tue, 28 Oct 2008 1 5:18:42-04006 -- Evan Broder <broder@mit.edu> Tue, 28 Oct 2008 19:44:04 -0400 6 7 7 8 sipb-xen-vnc-server (1.2) unstable; urgency=low -
trunk/packages/invirt-vnc-server/debian/invirt-vnc-server.postinst
- Property svn:executable set to *
r1386 r1388 24 24 echo "Please be sure to copy vncproxy.crt and vncproxykey.pem into /usr/share/invirt-vnc-server/" 25 25 fi 26 mkdir -p /etc/invirt/secrets 27 if ! [ -e /etc/invirt/secrets/vnc-key ]; then 28 openssl rand -base64 33 >/etc/invirt/secrets/vnc-key 29 fi 26 30 ;; 27 31 -
trunk/packages/invirt-vnc-server/python/vnc/extauth.py
r1386 r1388 19 19 import socket 20 20 import time 21 import get_port 22 23 TOKEN_KEY = "0M6W0U1IXexThi5idy8mnkqPKEq1LtEnlK/pZSn0cDrN" 21 22 def getTokenKey(): 23 token_key = file('/etc/invirt/secrets/vnc-key').read().strip() 24 while True: 25 yield token_key 26 getTokenKey = getTokenKey().next 24 27 25 28 def getPort(name, auth_data): 29 import get_port 26 30 if (auth_data["machine"] == name): 27 31 port = get_port.findPort(name) … … 63 67 64 68 def validateToken(self, token): 65 global TOKEN_KEY66 69 self.auth_error = "Invalid token" 67 70 try: 68 71 token = base64.urlsafe_b64decode(token) 69 72 token = cPickle.loads(token) 70 m = hmac.new( TOKEN_KEY, digestmod=sha)73 m = hmac.new(getTokenKey(), digestmod=sha) 71 74 m.update(token['data']) 72 75 if (m.digest() == token['digest']):
Note: See TracChangeset
for help on using the changeset viewer.