qemu vnc auth 3/4: Add VNC auth support from upstream QEMU

This patch adds in the upstream QEMU VNC authentication code. This
spports the previous VNC password auth scheme, as well as the VeNCrypt
protocol extension. The latter allows for performing a TLS handshake,
and client verification of the server identify using x509
certificates. It is also possible for the server to request a client
certificate and validate that as a simple auth scheme. The code
depends on GNU TLS for SSL APIs, and the configure script will
auto-detect this.

The image.py code is changed to  deal with the new syntax for the -vnc
option.  In particular password authentication is now enabled by
giving the 'password' flag,

eg -vnc 0.0.0:1,password

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Keir Fraser committed 2007-10-30 09:30:49 +00:00
1 parent 7891d8064f
commit 02b1dc06bf
10 files changed
+1559 -63

No files matched your search

+15 -14
View File
@@ -31,6 +31,7 @@ from xen.xend.XendOptions import instance as xenopts
from xen.xend.xenstore.xstransact import xstransact
from xen.xend.xenstore.xswatch import xswatch
from xen.xend import arch
from xen.xend import XendOptions
xc = xen.lowlevel.xc.xc()
@@ -214,27 +215,27 @@ class ImageHandler:
'vncpasswd'):
if key in vmConfig['platform']:
vnc_config[key] = vmConfig['platform'][key]
if vnc_config.has_key("vncpasswd"):
passwd = vnc_config["vncpasswd"]
else:
passwd = XendOptions.instance().get_vncpasswd_default()
vncopts = ""
if passwd:
self.vm.storeVm("vncpasswd", passwd)
vncopts = vncopts + ",password"
log.debug("Stored a VNC password for vfb access")
else:
log.debug("No VNC passwd configured for vfb access")
vnclisten = vnc_config.get('vnclisten',
xenopts().get_vnclisten_address())
XendOptions.instance().get_vnclisten_address())
vncdisplay = vnc_config.get('vncdisplay', 0)
ret.append('-vnc')
ret.append("%s:%s" % (vnclisten, vncdisplay))
ret.append("%s:%s%s" % (vnclisten, vncdisplay, vncopts))
if vnc_config.get('vncunused', 0):
ret.append('-vncunused')
# Store vncpassword in xenstore
vncpasswd = vnc_config.get('vncpasswd')
if not vncpasswd:
vncpasswd = xenopts().get_vncpasswd_default()
if vncpasswd is None:
raise VmError('vncpasswd is not setup in vmconfig or '
'xend-config.sxp')
if vncpasswd != '':
self.vm.storeVm('vncpasswd', vncpasswd)
elif has_sdl:
# SDL is default in QEMU.
pass
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.