From 4a421c824cd37a3b005f4d8c5ee58e05444b54f1 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Tue, 28 Oct 2008 20:00:22 -0400 Subject: [PATCH] In the web interface, get the VNC auth token over remctl svn path=/trunk/packages/invirt-web/; revision=1391 --- code/main.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/code/main.py b/code/main.py index e4727a8..cfcbd5d 100755 --- a/code/main.py +++ b/code/main.py @@ -245,18 +245,7 @@ def vnc(username, state, path, fields): """ machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine - TOKEN_KEY = "0M6W0U1IXexThi5idy8mnkqPKEq1LtEnlK/pZSn0cDrN" - - data = {} - data["user"] = username - data["machine"] = machine.name - data["expires"] = time.time()+(5*60) - pickled_data = cPickle.dumps(data) - m = hmac.new(TOKEN_KEY, digestmod=sha) - m.update(pickled_data) - token = {'data': pickled_data, 'digest': m.digest()} - token = cPickle.dumps(token) - token = base64.urlsafe_b64encode(token) + token = remctl('control', machine.name, 'vnctoken') host = controls.listHost(machine) if host: port = 10003 + [h.hostname for h in config.hosts].index(host) -- 1.7.9.5