Individual passwords for guest VNC servers ?
Quoted 9 lines
Thanks all point about security, I'll do as follows. I thought that the point was the following two.
1. Storage place of encrypted password
Should I store it in/etc/xen/passwd?
Or, should I wait for DB of Xen that will be released in
the future?
The xend life cycle management patches were posted by Alistair a couple of months back. They'll go in early in the 3.0.4 cycle.
Quoted 3 lines
In the latter case, the release time and information, I want you to teach it.
Now, I think we have no choice but to use/etc/xen/passwd.
In the mean time, I'd just out them in the domain config file and change the default permissions and ownership.
Quoted 3 lines
2. Method of Xen VNC Server receiving stored password By way of xenstore. However, it is necessary to consider
xenstore-ls.
It can be passed transiently (i.e. it gets deleted from the store by qemu-dm)
You need to be root to run xenstore-ls so I'm comfortable with this.
Ian
Quoted 2 lines
In the mean time, I'd just out them in the domain config file and change the default permissions and ownership.
Yes, I'll do as follows.
I challenge the correction that uses xenstore. When the password is received, qemu-dm deletes it.
Masami Watanabe
Quoted 34 lines · Ian Pratt
Quoted 9 lines
Thanks all point about security, I'll do as follows. I thought that the point was the following two.
1. Storage place of encrypted password
Should I store it in/etc/xen/passwd?
Or, should I wait for DB of Xen that will be released in
the future?The xend life cycle management patches were posted by Alistair a couple of months back. They'll go in early in the 3.0.4 cycle.
Quoted 3 lines
In the latter case, the release time and information, I want you to teach it.
Now, I think we have no choice but to use/etc/xen/passwd.In the mean time, I'd just out them in the domain config file and change the default permissions and ownership.
Quoted 3 lines
2. Method of Xen VNC Server receiving stored password By way of xenstore. However, it is necessary to consider
xenstore-ls.It can be passed transiently (i.e. it gets deleted from the store by qemu-dm)
You need to be root to run xenstore-ls so I'm comfortable with this.Ian
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
PATCH 1/1 VNC authentification
In reply to Ian PrattHi,
This is take 2 on VNC authentification.
The specification is as mentioned at
http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00666.html
The difference is follows.
- correction that passes information through xenstore.
- after information is read, qemu deletes information on xenstore.
Best regards,
Watanabe
Quoted 28 lines · Ian Pratt
Quoted 9 lines
Thanks all point about security, I'll do as follows. I thought that the point was the following two.
1. Storage place of encrypted password
Should I store it in/etc/xen/passwd?
Or, should I wait for DB of Xen that will be released in
the future?The xend life cycle management patches were posted by Alistair a couple of months back. They'll go in early in the 3.0.4 cycle.
Quoted 3 lines
In the latter case, the release time and information, I want you to teach it.
Now, I think we have no choice but to use/etc/xen/passwd.In the mean time, I'd just out them in the domain config file and change the default permissions and ownership.
Quoted 3 lines
2. Method of Xen VNC Server receiving stored password By way of xenstore. However, it is necessary to consider
xenstore-ls.It can be passed transiently (i.e. it gets deleted from the store by qemu-dm)
You need to be root to run xenstore-ls so I'm comfortable with this.
Quoted 6 lines
Ian
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
tools/examples/xend-config.sxp +4 -0
@@ -130,3 +130,7 @@ # The tool used for initiating virtual TPM migration #(external-migration-tool '') + +# The default password for VNC console on HVM domain. +# Empty string is no authentication. +(vncpasswd '')
tools/examples/xmexample.hvm +5 -0
@@ -145,6 +145,11 @@ vnc=1 #vncconsole=0 #---------------------------------------------------------------------------- +# set password for domain's VNC console +# default is depents on vncpasswd in xend-config.sxp +vncpasswd='' + +#---------------------------------------------------------------------------- # no graphics, use serial port #nographic=0
tools/examples/xmexample.vti +5 -0
@@ -95,6 +95,11 @@ vnc=0 #vncconsole=0 #---------------------------------------------------------------------------- +# set password for domain's VNC console +# default is depents on vncpasswd in xend-config.sxp +vncpasswd='' + +#---------------------------------------------------------------------------- # no graphics, use serial port #nographic=0
tools/ioemu/Makefile.target +4 -0
@@ -398,6 +398,7 @@ VL_OBJS+=sdl.o VL_OBJS+=sdl.o endif VL_OBJS+=vnc.o +VL_OBJS+=d3des.o ifdef CONFIG_COCOA VL_OBJS+=cocoa.o COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
@@ -456,6 +457,9 @@ sdl.o: sdl.c keymaps.c sdl_keysym.h $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h + $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< + +d3des.o: d3des.c d3des.h $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< sdlaudio.o: sdlaudio.c
tools/ioemu/vl.c +8 -0
@@ -169,6 +169,9 @@ time_t timeoffset = 0;char domain_name[1024 ] = {'H' ,'V' ,'M' ,'X' ,'E' ,'N' ,'-' };extern int domid; + +char vncpasswd[64 ]; +unsigned char challenge[AUTHCHALLENGESIZE ];/***********************************************************/ /* x86 ISA bus support */
@@ -5901,6 +5904,7 @@ int main(int argc, char **argv) vncunused =0 ; kernel_filename =NULL ; kernel_cmdline ="" ; + *vncpasswd ='\0' ;#ifndef CONFIG_DM #ifdef TARGET_PPC cdrom_index =1 ;
@@ -6544,6 +6548,10 @@ int main(int argc, char **argv)init_ioports (); +/* read vncpasswd from xenstore */ +if (0 >xenstore_read_vncpasswd (domid)) +exit (1 ); +/* terminal init */ if (nographic) {dumb_display_init (ds);
tools/ioemu/vl.h +3 -0
@@ -1220,4 +1220,7 @@ extern char domain_name[];void destroy_hvm_domain (void ); +/* VNC Authentication */ +#define AUTHCHALLENGESIZE 16 +#endif /* VL_H */
tools/ioemu/vnc.c +144 -1
160 lines not on this page · raw message
tools/ioemu/xenstore.c +57 -0
60 lines not on this page · raw message
tools/python/xen/xend/XendDomainInfo.py +3 -0
@@ -391,6 +391,9 @@ def parseConfig(config): else: log.warn("Ignoring malformed and deprecated config option " "restart = %s", restart) + + result['image'].append( + ['vncpasswd_default', xroot.get_vncpasswd_default()]) log.debug("parseConfig: result is %s", result) return result
tools/python/xen/xend/XendRoot.py +6 -0
@@ -95,6 +95,8 @@ class XendRoot: dom0_min_mem_default = '0' dom0_vcpus_default = '0' + + vncpasswd_default = '#None#' components = {}
@@ -272,6 +274,10 @@ class XendRoot: def get_console_limit(self): return self.get_config_int('console-limit', 1024) + def get_vncpasswd_default(self): + return self.get_config_value('vncpasswd', + self.vncpasswd_default) + def instance(): """Get an instance of XendRoot. Use this instead of the constructor.
tools/python/xen/xend/image.py +25 -0
@@ -348,8 +348,20 @@ class HVMImageHandler(ImageHandler): sdl = sxp.child_value(config, 'sdl') ret = [] nographic = sxp.child_value(config, 'nographic') + + # get password from xend-config(if password omitted, '#None#') + vncpasswd_default = sxp.child_value(config, + 'vncpasswd_default') + # get password from VM config(if password omitted, None) + vncpasswd_vmconfig = sxp.child_value(config, 'vncpasswd') + vncpasswd = vncpasswd_vmconfig + if nographic: ret.append('-nographic') + # remove password + if vncpasswd_vmconfig: + config.remove(['vncpasswd', vncpasswd_vmconfig]) + del config[config.index(['vncpasswd_default', vncpasswd_default])] return ret if vnc: vncdisplay = sxp.child_value(config, 'vncdisplay',
@@ -358,6 +370,19 @@ class HVMImageHandler(ImageHandler): vncunused = sxp.child_value(config, 'vncunused') if vncunused: ret += ['-vncunused'] + # password check + if vncpasswd is None: + if vncpasswd_default=='#None#': + raise VmError('vncpasswd is not setuped in VMconfig and xend-config.') + else: + vncpasswd = vncpasswd_default + if vncpasswd!='': + self.vm.storeVm("vncpasswd", vncpasswd) + + # remove password + config.remove(['vncpasswd', vncpasswd_vmconfig]) + del config[config.index(['vncpasswd_default', vncpasswd_default])] + return ret def createDeviceModel(self):
tools/python/xen/xm/create.py +5 -0
@@ -103,6 +103,10 @@ gopts.opt('console_autoconnect', short=' gopts.opt('console_autoconnect', short='c', fn=set_true, default=0, use="Connect to the console after the domain is created.") + +gopts.var('vncpasswd', val='NAME', + fn=set_value, default=None, + use="Password for VNC console on HVM domain.") gopts.var('vncviewer', val='no|yes', fn=set_bool, default=None,
@@ -638,6 +642,7 @@ def configure_hvm(config_image, vals): for a in args: if (vals.__dict__[a]): config_image.append([a, vals.__dict__[a]]) + config_image.append(['vncpasswd', vals.vncpasswd]) def run_bootloader(vals, config_image): if not os.access(vals.bootloader, os.X_OK):
tools/ioemu/d3des.c new file +434 -0
434 lines not on this page · raw message
tools/ioemu/d3des.h new file +51 -0
51 lines not on this page · raw message
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH][Take 2] VNC authentification
A couple comments:
Does this code actually work? You call vnc_read_when twice in the same function. The first one should never get called (it can only be called from the main loop and there can only ever be one outstanding read function).
There are a couple weird bits in the code too that I cannot reply to (your mailer is sending the attachment as a octet-stream, please inline too next time you send the patch).
Otherwise, it looks really promising!
Regards,
Anthony Liguori
Quoted 56 lines · Masami Watanabe
Hi,
This is take 2 on VNC authentification.
The specification is as mentioned at
http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00666.html
The difference is follows.
- correction that passes information through xenstore.
- after information is read, qemu deletes information on xenstore.Signed-off-by Masami Watanabe <[email protected]>Best regards,
WatanabeQuoted 37 lines · Ian Pratt
Quoted 11 lines
Thanks all point about security, I'll do as follows. I thought that the point was the following two.
1. Storage place of encrypted password
Should I store it in/etc/xen/passwd?
Or, should I wait for DB of Xen that will be released in
the future?The xend life cycle management patches were posted by Alistair a couple of months back. They'll go in early in the 3.0.4 cycle.
Quoted 4 lines
In the latter case, the release time and information, I want you to teach it.
Now, I think we have no choice but to use/etc/xen/passwd.In the mean time, I'd just out them in the domain config file and change the default permissions and ownership.
Quoted 4 lines
2. Method of Xen VNC Server receiving stored password By way of xenstore. However, it is necessary to consider
xenstore-ls.It can be passed transiently (i.e. it gets deleted from the store by qemu-dm)
You need to be root to run xenstore-ls so I'm comfortable with this.Ian
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH][Take 2] VNC authentification
Hi Anthony,
Quoted 1 line
Does this code actually work?
It operates certainly...
Quoted 4 lines
You call
vnc_read_whentwice in the same
function. The first one should never get called (it can only be called from the main loop and there can only ever be one outstanding read function).
Original structure in vnc.c(CS11635) is,vnc_display_init()
vnc_listen_read()
vnc_read_when()->protocol_version()
vnc_read_when()->protocol_client_init()Patch's structure is,vnc_display_init()
vnc_listen_read()
vnc_read_when()->protocol_version()
vnc_auth()
vnc_read_when()->protocol_authtype()
vnc_read_when()->protocol_response()
vnc_read_when()->protocol_client_init()Is your point above-mentioned vnc_auth?
Quoted 3 lines
There are a couple weird bits in the code too that I cannot reply to (your mailer is sending the attachment as a octet-stream, please inline too next time you send the patch).
My mailer is sending the attachment as a application/octet-stream,
It cannot be changed to another Content-Type.
Yes, I send next patch by inline.
Regards,
Masami Watanabe
Quoted 74 lines · Anthony Liguori
A couple comments:
Does this code actually work? You call
vnc_read_whentwice in the same function. The first one should never get called (it can only be called from the main loop and there can only ever be one outstanding read function).There are a couple weird bits in the code too that I cannot reply to (your mailer is sending the attachment as a octet-stream, please inline too next time you send the patch).
Otherwise, it looks really promising!
Regards,
Anthony Liguori
Quoted 56 lines · Masami Watanabe
Hi,
This is take 2 on VNC authentification.
The specification is as mentioned at
http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00666.html
The difference is follows.
- correction that passes information through xenstore.
- after information is read, qemu deletes information on xenstore.Signed-off-by Masami Watanabe <[email protected]>Best regards,
WatanabeQuoted 37 lines · Ian Pratt
Quoted 11 lines
Thanks all point about security, I'll do as follows. I thought that the point was the following two.
1. Storage place of encrypted password
Should I store it in/etc/xen/passwd?
Or, should I wait for DB of Xen that will be released in
the future?The xend life cycle management patches were posted by Alistair a couple of months back. They'll go in early in the 3.0.4 cycle.
Quoted 4 lines
In the latter case, the release time and information, I want you to teach it.
Now, I think we have no choice but to use/etc/xen/passwd.In the mean time, I'd just out them in the domain config file and change the default permissions and ownership.
Quoted 4 lines
2. Method of Xen VNC Server receiving stored password By way of xenstore. However, it is necessary to consider
xenstore-ls.It can be passed transiently (i.e. it gets deleted from the store by qemu-dm)
You need to be root to run xenstore-ls so I'm comfortable with this.Ian
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH][Take 2] VNC authentification
In reply to Masami WatanabeQuoted 9 lines · Masami Watanabe
Hi,
This is take 2 on VNC authentification.
The specification is as mentioned at
http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00666.html
The difference is follows.
- correction that passes information through xenstore.
- after information is read, qemu deletes information on xenstore.
This patch doesn't compile because it is calling functions before they are even defined & the implicit definition this results in does not match the actual definition later
xen-3.0.3-testing-11633/tools/ioemu/vnc.c: In function 'protocol_version':xen-3.0.3-testing-11633/tools/ioemu/vnc.c:1225: warning: implicit declaration of function 'vnc_auth' xen-3.0.3-testing-11633/tools/ioemu/vnc.c: In function 'protocol_response':xen-3.0.3-testing-11633/tools/ioemu/vnc.c:1250: warning: implicit declaration of function 'base64decode' xen-3.0.3-testing-11633/tools/ioemu/vnc.c: At top level:xen-3.0.3-testing-11633/tools/ioemu/vnc.c:1399: error: static declaration of 'vnc_auth' follows non-static declaration xen-3.0.3-testing-11633/tools/ioemu/vnc.c:1225: error: previous implicit declaration of 'vnc_auth' was here xen-3.0.3-testing-11633/tools/ioemu/vnc.c: In function 'vnc_auth':xen-3.0.3-testing-11633/tools/ioemu/vnc.c:1417: warning: implicit declaration of function 'make_challenge' xen-3.0.3-testing-11633/tools/ioemu/vnc.c: At top level:xen-3.0.3-testing-11633/tools/ioemu/vnc.c:1429: error: static declaration of 'make_challenge' follows non-static declaration xen-3.0.3-testing-11633/tools/ioemu/vnc.c:1417: error: previous implicit declaration of 'make_challenge' was here xen-3.0.3-testing-11633/tools/ioemu/vnc.c:1461: error: static declaration of 'base64decode' follows non-static declaration xen-3.0.3-testing-11633/tools/ioemu/vnc.c:1250: error: previous implicit declaration of 'base64decode' was here
tools/python/xen/xend/XendRoot.py Fri Sep 29 15:46:03 2006 +0900 class XendRoot: · line 99
Quoted 9 lines
diff -r
1d0e75523636tools/python/xen/xend/XendRoot.pytools/python/xen/xend/XendRoot.py Fri Sep 29 15:46:03 2006 +0900 renamed from tools/python/xen/xend/XendRoot.py Wed Sep 27 17:49:22 2006 +0100 +2
-0@@ -95,6 +95,8 @@ class XendRoot: dom0_min_mem_default = '0' dom0_vcpus_default = '0' + + vncpasswd_default = '#None#'
Why not just use the proper Python None value ?
tools/python/xen/xend/XendDomainInfo.py Fri Sep 29 15:46:03 2006 +0900 def parseConfig(config): · line 396
Quoted 10 lines
diff -r
1d0e75523636tools/python/xen/xend/XendDomainInfo.pytools/python/xen/xend/XendDomainInfo.py Fri Sep 29 15:46:03 2006 +0900 renamed from tools/python/xen/xend/XendDomainInfo.py Wed Sep 27 17:49:22 2006 +0100 +3
-0@@ -391,6 +391,9 @@ def parseConfig(config): else: log.warn("Ignoring malformed and deprecated config option " "restart = %s", restart) + + result['image'].append( + ['vncpasswd_default', xroot.get_vncpasswd_default()])
Why put the system default password into the guest's config record here, only to remove it again later on. The XendRoot object is a singleton, so better to just call 'get_vncpasswd_default' when you need it later....
tools/python/xen/xend/image.py Fri Sep 29 15:46:03 2006 +0900 class HVMImageHandler(ImageHandler): · line 354
Quoted 11 lines
diff -r
1d0e75523636tools/python/xen/xend/image.pytools/python/xen/xend/image.py Fri Sep 29 15:46:03 2006 +0900 renamed from tools/python/xen/xend/image.py Wed Sep 27 17:49:22 2006 +0100 +4
-0@@ -348,8 +348,20 @@ class HVMImageHandler(ImageHandler): sdl = sxp.child_value(config, 'sdl') ret = [] nographic = sxp.child_value(config, 'nographic') + + # get password from xend-config(if password omitted, '#None#') + vncpasswd_default = sxp.child_value(config, + 'vncpasswd_default')
Just call
vncpassword_default = xen.xend.XendRoot.instance().get_vncpasswd_default()
Then there is no need to keep 'vncpasswd_default' in the guest's sxp at all.
Quoted 14 lines
tools/python/xen/xend/image.py Fri Sep 29 15:46:03 2006 +0900 renamed from tools/python/xen/xend/image.py Wed Sep 27 17:49:22 2006 +0100 +8
-0+ # get password from VM config(if password omitted, None) + vncpasswd_vmconfig = sxp.child_value(config, 'vncpasswd') + vncpasswd = vncpasswd_vmconfig + if nographic: ret.append('-nographic') + # remove password + if vncpasswd_vmconfig: + config.remove(['vncpasswd', vncpasswd_vmconfig]) + del config[config.index(['vncpasswd_default', vncpasswd_default])] return ret if vnc: vncdisplay = sxp.child_value(config, 'vncdisplay',
tools/python/xen/xend/image.py Fri Sep 29 15:46:03 2006 +0900 class HVMImageHandler(ImageHandler): · line 378
Quoted 9 lines
tools/python/xen/xend/image.py Fri Sep 29 15:46:03 2006 +0900 renamed from tools/python/xen/xend/image.py Wed Sep 27 17:49:22 2006 +0100 +6
-0@@ -358,6 +370,19 @@ class HVMImageHandler(ImageHandler): vncunused = sxp.child_value(config, 'vncunused') if vncunused: ret += ['-vncunused'] + # password check + if vncpasswd is None: + if vncpasswd_default=='#None#': + raise VmError('vncpasswd is not setuped in VMconfig and xend-config.') + else: + vncpasswd = vncpasswd_default
This should just do 'if vncpasswd_default is None', rather than use some magic string value '#None#'
tools/python/xen/xend/image.py Fri Sep 29 15:46:03 2006 +0900 class HVMImageHandler(ImageHandler): · line 388
Quoted 10 lines
tools/python/xen/xend/image.py Fri Sep 29 15:46:03 2006 +0900 renamed from tools/python/xen/xend/image.py Wed Sep 27 17:49:22 2006 +0100 +7
-0+ if vncpasswd!='': + self.vm.storeVm("vncpasswd", vncpasswd) + + # remove password + config.remove(['vncpasswd', vncpasswd_vmconfig]) + del config[config.index(['vncpasswd_default', vncpasswd_default])] + return ret def createDeviceModel(self):
See comment above about not storing 'vncpasswd_default' in this object at all.
Regards,
Dan.
Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
Re: [PATCH][Take 2] VNC authentification
Hi Dan,
I post patch that reflects your point.
However, Now, I can not use standard VNC clients to server. therefore, I cannot do final test. It becomes possible on next Tuesday. Please forgive my post, it is current update.
Quoted 3 lines
This patch doesn't compile because it is calling functions before they are even defined & the implicit definition this results in does not match the actual definition later
It is my mistake when take 1 patch was changed to take 2 patch.
Quoted 5 lines
Review
Quoted 3 lines
dom0_vcpus_default = '0'(quoted diff) +2
-0+ + vncpasswd_default = '#None#'Why not just use the proper Python None value ?
Thanks.
I stopped using magic string.
"if vncpasswd_default:" cannot distinguish the null string and undefined. I thought that "is Not" was also the same. However, it was possible.
Quoted 5 lines
Just call
vncpassword_default= xen.xend.XendRoot.instance().get_vncpasswd_default()Then there is no need to keep '
vncpasswd_default' in the guest's sxp at all.
Thanks.
Quoted 9 lines
Quoted 9 lines
(quoted diff) +7
-0+ if vncpasswd!='': + self.vm.storeVm("vncpasswd", vncpasswd) + + # remove password + config.remove(['vncpasswd', vncpasswd_vmconfig]) + del config[config.index(['vncpasswd_default', vncpasswd_default])] + return ret
Quoted 4 lines
Quoted 1 line
def createDeviceModel(self):
See comment above about not storing '
vncpasswd_default' in this object at all.
Thanks.
Best regards,
Watanabe
---
tools/examples/xend-config.sxp +4 -0
@@ -130,3 +130,7 @@ # The tool used for initiating virtual TPM migration #(external-migration-tool '') + +# The default password for VNC console on HVM domain. +# Empty string is no authentication. +(vncpasswd '')
tools/examples/xmexample.hvm +5 -0
@@ -145,6 +145,11 @@ vnc=1 #vncconsole=0 #---------------------------------------------------------------------------- +# set password for domain's VNC console +# default is depents on vncpasswd in xend-config.sxp +vncpasswd='' + +#---------------------------------------------------------------------------- # no graphics, use serial port #nographic=0
tools/examples/xmexample.vti +5 -0
@@ -95,6 +95,11 @@ vnc=0 #vncconsole=0 #---------------------------------------------------------------------------- +# set password for domain's VNC console +# default is depents on vncpasswd in xend-config.sxp +vncpasswd='' + +#---------------------------------------------------------------------------- # no graphics, use serial port #nographic=0
tools/ioemu/Makefile.target +4 -0
@@ -398,6 +398,7 @@ VL_OBJS+=sdl.o VL_OBJS+=sdl.o endif VL_OBJS+=vnc.o +VL_OBJS+=d3des.o ifdef CONFIG_COCOA VL_OBJS+=cocoa.o COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
@@ -456,6 +457,9 @@ sdl.o: sdl.c keymaps.c sdl_keysym.h $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h + $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< + +d3des.o: d3des.c d3des.h $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< sdlaudio.o: sdlaudio.c
tools/ioemu/vl.c +8 -0
@@ -169,6 +169,9 @@ time_t timeoffset = 0;char domain_name[1024 ] = {'H' ,'V' ,'M' ,'X' ,'E' ,'N' ,'-' };extern int domid; + +char vncpasswd[64 ]; +unsigned char challenge[AUTHCHALLENGESIZE ];/***********************************************************/ /* x86 ISA bus support */
@@ -5901,6 +5904,7 @@ int main(int argc, char **argv) vncunused =0 ; kernel_filename =NULL ; kernel_cmdline ="" ; + *vncpasswd ='\0' ;#ifndef CONFIG_DM #ifdef TARGET_PPC cdrom_index =1 ;
@@ -6544,6 +6548,10 @@ int main(int argc, char **argv)init_ioports (); +/* read vncpasswd from xenstore */ +if (0 >xenstore_read_vncpasswd (domid)) +exit (1 ); +/* terminal init */ if (nographic) {dumb_display_init (ds);
tools/ioemu/vl.h +4 -0
@@ -1209,6 +1209,7 @@ void xenstore_process_event(void *opaquevoid xenstore_process_event (void *opaque);void xenstore_check_new_media_present (int timeout);void xenstore_write_vncport (int vnc_display); +int xenstore_read_vncpasswd (int domid);/* xen_platform.c */ void pci_xen_platform_init (PCIBus *bus);
@@ -1220,4 +1221,7 @@ extern char domain_name[];void destroy_hvm_domain (void ); +/* VNC Authentication */ +#define AUTHCHALLENGESIZE 16 +#endif /* VL_H */
tools/ioemu/vnc.c +148 -1
170 lines not on this page · raw message
tools/ioemu/xenstore.c +57 -0
60 lines not on this page · raw message
tools/python/xen/xend/XendRoot.py +6 -0
@@ -95,6 +95,8 @@ class XendRoot: dom0_min_mem_default = '0' dom0_vcpus_default = '0' + + vncpasswd_default = None components = {}
@@ -272,6 +274,10 @@ class XendRoot: def get_console_limit(self): return self.get_config_int('console-limit', 1024) + def get_vncpasswd_default(self): + return self.get_config_value('vncpasswd', + self.vncpasswd_default) + def instance(): """Get an instance of XendRoot. Use this instead of the constructor.
tools/python/xen/xend/image.py +22 -0
@@ -348,8 +348,16 @@ class HVMImageHandler(ImageHandler): sdl = sxp.child_value(config, 'sdl') ret = [] nographic = sxp.child_value(config, 'nographic') + + # get password from VM config(if password omitted, None) + vncpasswd_vmconfig = sxp.child_value(config, 'vncpasswd') + vncpasswd = vncpasswd_vmconfig + if nographic: ret.append('-nographic') + # remove password + if vncpasswd_vmconfig: + config.remove(['vncpasswd', vncpasswd_vmconfig]) return ret if vnc: vncdisplay = sxp.child_value(config, 'vncdisplay',
@@ -358,6 +366,20 @@ class HVMImageHandler(ImageHandler): vncunused = sxp.child_value(config, 'vncunused') if vncunused: ret += ['-vncunused'] + # get password from xend-config(if password omitted, None) + vncpasswd_default = xen.xend.XendRoot.instance().get_vncpasswd_default() + # password check + if vncpasswd is None: + if vncpasswd_default is None: + raise VmError('vncpasswd is not setuped in VMconfig and xend-config.') + else: + vncpasswd = vncpasswd_default + if vncpasswd!='': + self.vm.storeVm("vncpasswd", vncpasswd) + + # remove password + config.remove(['vncpasswd', vncpasswd_vmconfig]) + return ret def createDeviceModel(self):
tools/python/xen/xm/create.py +5 -0
@@ -103,6 +103,10 @@ gopts.opt('console_autoconnect', short=' gopts.opt('console_autoconnect', short='c', fn=set_true, default=0, use="Connect to the console after the domain is created.") + +gopts.var('vncpasswd', val='NAME', + fn=set_value, default=None, + use="Password for VNC console on HVM domain.") gopts.var('vncviewer', val='no|yes', fn=set_bool, default=None,
@@ -638,6 +642,7 @@ def configure_hvm(config_image, vals): for a in args: if (vals.__dict__[a]): config_image.append([a, vals.__dict__[a]]) + config_image.append(['vncpasswd', vals.vncpasswd]) def run_bootloader(vals, config_image): if not os.access(vals.bootloader, os.X_OK):
tools/ioemu/d3des.c new file +434 -0
434 lines not on this page · raw message
tools/ioemu/d3des.h new file +51 -0
51 lines not on this page · raw message
Re: [PATCH][Take 2] VNC authentification
Quoted 6 lines · Masami Watanabe
Hi Dan,
I post patch that reflects your point.
However, Now, I can not use standard VNC clients to server. therefore, I cannot do final test. It becomes possible on next Tuesday. Please forgive my post, it is current update.
The Python XenD bits of your latest patch all look good to me now - thanks for taking time to address the issues.
I've compiled the patches against latest Xen going into Fedora Core 6, and the password authentication does appear to be working as expected. Only issue was that I forgot the password in the VM config file needed to be the base64 encoded, DES-encrypted format - once I sorted that out it worked fine.
tools/examples/xend-config.sxp line 136
Quoted 10 lines
tools/examples/xend-config.sxp +4
-0@@ -130,3 +130,7 @@ # The tool used for initiating virtual TPM migration #(external-migration-tool '') + +# The default password for VNC console on HVM domain. +# Empty string is no authentication. +(vncpasswd '')
We should add a note about this needing to be the base-64 encoded, DES encrypted password, rather than plain text.
tools/examples/xmexample.hvm vnc=1 · line 150
Quoted 10 lines
diff -r
1d0e75523636tools/examples/xmexample.hvmtools/examples/xmexample.hvm +3
-0@@ -145,6 +145,11 @@ vnc=1 #vncconsole=0 #---------------------------------------------------------------------------- +# set password for domain's VNC console +# default is depents on vncpasswd in xend-config.sxp +vncpasswd=''
Again add a comment about the format.
Quoted 5 lines
tools/examples/xmexample.hvm +5
-0+static int make_challenge(char *random, int size) +{ + FILE *fp; + int readsize; +
tools/examples/xmexample.hvm vnc=1
Quoted 10 lines
tools/examples/xmexample.hvm +10
-0+ fp = fopen("/dev/random", "r"); + if (!fp) { + fprintf(stderr, "make_challenge: no OS supplied /dev/random\n"); + exit(1); + } + readsize = fread(random, size, 1, fp); + fclose(fp); + + return 0; +}
Using /dev/random for this is rather overkill for VNC. I very quickly exhausted my machine's entropy pool after connecting & disconnecting a couple of times over. The regular VNC server sources just call the standard C 'random()' function CHALLENGESIZE times over to get some random bytes (and seed the random pool at startup based on time & pid).
Quoted 28 lines
tools/examples/xmexample.hvm +28
-0+ +int xenstore_read_vncpasswd(int domid) +{ + extern char vncpasswd[64]; + char *buf = NULL, *path, *uuid = NULL, *passwd = NULL; + unsigned int i, len, rc = 0; + + if (xsh == NULL) { + return -1; + } + + path = xs_get_domain_path(xsh, domid); + if (path == NULL) { + fprintf(logfile, "xs_get_domain_path() error\n"); + return -1; + } + + pasprintf(&buf, "%s/vm", path); + uuid = xs_read(xsh, XBT_NULL, buf, &len); + if (uuid == NULL) { + fprintf(logfile, "xs_read(): uuid get error\n"); + free(path); + return -1; + } + + pasprintf(&buf, "%s/vncpasswd", uuid); + passwd = xs_read(xsh, XBT_NULL, buf, &len); + if (passwd == NULL) {
tools/examples/xmexample.hvm
Quoted 10 lines
tools/examples/xmexample.hvm +10
-0+ free(uuid); + free(path); + return rc; + } + + for (i=0; i<len; i++) { + vncpasswd[i] = passwd[i]; + passwd[i] = '\0'; + } + vncpasswd[len] = '\0';
Should check for buffer overflow since 'vncpasswd' is only 64 bytes long.
Regards,
Dan.
Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
Re: [PATCH][Take 2] VNC authentification
Quoted 22 lines · Daniel P. Berrange
Quoted 7 lines · Masami Watanabe
Hi Dan,
I post patch that reflects your point.
However, Now, I can not use standard VNC clients to server. therefore, I cannot do final test. It becomes possible on next Tuesday. Please forgive my post, it is current update.The Python XenD bits of your latest patch all look good to me now - thanks for taking time to address the issues.
I've compiled the patches against latest Xen going into Fedora Core 6, and the password authentication does appear to be working as expected. Only issue was that I forgot the password in the VM config file needed
to be the base64 encoded, DES-encrypted format - once I sorted that
out it worked fine.Quoted 4 lines
tools/examples/xend-config.sxp +0
-0@@ -130,3 +130,7 @@
Quoted 10 lines
tools/examples/xend-config.sxp line 136
Quoted 7 lines
tools/examples/xend-config.sxp +4
-0# The tool used for initiating virtual TPM migration #(external-migration-tool '') + +# The default password for VNC console on HVM domain. +# Empty string is no authentication. +(vncpasswd '')We should add a note about this needing to be the base-64 encoded, DES encrypted password, rather than plain text.
Why even bother encrypting the password? We're using a well known DES key so there is no security here. A user must still take appropriate precautions to protect the config files. In fact, I think munging the password like this gives a false sense of security.
Regards,
Anthony Liguori
Re: [PATCH][Take 2] VNC authentification
Quoted 18 lines · Anthony Liguori
Quoted 5 lines · Daniel P. Berrange
Quoted 5 lines
tools/examples/xend-config.sxp +0
-0@@ -130,3 +130,7 @@Quoted 11 lines
tools/examples/xend-config.sxp line 136
Quoted 7 lines
tools/examples/xend-config.sxp +4
-0# The tool used for initiating virtual TPM migration #(external-migration-tool '') + +# The default password for VNC console on HVM domain. +# Empty string is no authentication. +(vncpasswd '')We should add a note about this needing to be the base-64 encoded, DES encrypted password, rather than plain text.
Quoted 4 lines
Why even bother encrypting the password? We're using a well known DES key so there is no security here. A user must still take appropriate precautions to protect the config files. In fact, I think munging the password like this gives a false sense of security.
Yeah, we really need to chmod 700 the /etc/xen directory to protect the passwords. Once this is done, there isn't much to be gained from encryption in the file itself except for obfuscating it from the benign casual observer. Using plain text in the config file would make life easier to tools too, because they won't have to carry about this VNC-specific DES encryption routine just to create passwds in the guest config
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
RE: [PATCH][Take 2] VNC authentification
Quoted 1 line
Quoted 1 line
Why even bother encrypting the password? We're using a well known
DES
Quoted 1 line
Quoted 1 line
key so there is no security here. A user must still take
appropriate
Quoted 1 line
Quoted 1 line
precautions to protect the config files. In fact, I think munging
the
Quoted 9 lines
Quoted 1 line
password like this gives a false sense of security.
Yeah, we really need to chmod 700 the
/etc/xendirectory to protect the passwords. Once this is done, there isn't much to be gained from encryption in the file itself except for obfuscating it from the benign casual observer. Using plain text in the config file would make life easier to tools too, because they won't have to carry about this VNC-specific DES encryption routine just to create passwds in the guest config
Yep, let's change the permissions and use plain text passwords. No point giving people a false sense of security.
Ian
RE: [PATCH][Take 2] VNC authentification
Hi,
Thanks all,
I will marshal code about the password from config file. (It doesn't use base64 decode and DES decrypt to the password of
config file)
And, I think that chmod 600 is necessary also for /var/log/xend.log.
Regards,
Masami Watanabe
Quoted 20 lines · Ian Pratt
Quoted 1 line
Quoted 1 line
Why even bother encrypting the password? We're using a well known
DES
Quoted 1 line
Quoted 1 line
key so there is no security here. A user must still take
appropriate
Quoted 1 line
Quoted 1 line
precautions to protect the config files. In fact, I think munging
the
Quoted 9 lines
Quoted 1 line
password like this gives a false sense of security.
Yeah, we really need to chmod 700 the
/etc/xendirectory to protect the passwords. Once this is done, there isn't much to be gained from encryption in the file itself except for obfuscating it from the benign casual observer. Using plain text in the config file would make life easier to tools too, because they won't have to carry about this VNC-specific DES encryption routine just to create passwds in the guest configYep, let's change the permissions and use plain text passwords. No point giving people a false sense of security.
Ian
PATCH 1/1 VNC authentification
In reply to Ian PrattHi,
This is take 3 on VNC authentification.
The specification is as mentioned at
http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00666.html
The difference is follows.
- Correction corresponding to plain VNC password
base64 decode and DES decrypt was not used.
- /dev/random was not used.
Perhaps, in the source code that I had seen, standard C 'random()' was used with Win32.
However, exhausted entropy pool is certainly no good.
Thanks all.
Best regards,
Watanabe
-----
tools/examples/xend-config.sxp +4 -0
@@ -130,3 +130,7 @@ # The tool used for initiating virtual TPM migration #(external-migration-tool '') + +# The default password for VNC console on HVM domain. +# Empty string is no authentication. +(vncpasswd '')
tools/examples/xmexample.hvm +5 -0
@@ -145,6 +145,11 @@ vnc=1 #vncconsole=0 #---------------------------------------------------------------------------- +# set password for domain's VNC console +# default is depents on vncpasswd in xend-config.sxp +vncpasswd='' + +#---------------------------------------------------------------------------- # no graphics, use serial port #nographic=0
tools/examples/xmexample.vti +5 -0
@@ -95,6 +95,11 @@ vnc=0 #vncconsole=0 #---------------------------------------------------------------------------- +# set password for domain's VNC console +# default is depents on vncpasswd in xend-config.sxp +vncpasswd='' + +#---------------------------------------------------------------------------- # no graphics, use serial port #nographic=0
tools/ioemu/Makefile.target +4 -0
@@ -398,6 +398,7 @@ VL_OBJS+=sdl.o VL_OBJS+=sdl.o endif VL_OBJS+=vnc.o +VL_OBJS+=d3des.o ifdef CONFIG_COCOA VL_OBJS+=cocoa.o COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
@@ -456,6 +457,9 @@ sdl.o: sdl.c keymaps.c sdl_keysym.h $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h + $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< + +d3des.o: d3des.c d3des.h $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< sdlaudio.o: sdlaudio.c
tools/ioemu/vl.c +8 -0
@@ -169,6 +169,9 @@ time_t timeoffset = 0;char domain_name[1024 ] = {'H' ,'V' ,'M' ,'X' ,'E' ,'N' ,'-' };extern int domid; + +char vncpasswd[64 ]; +unsigned char challenge[AUTHCHALLENGESIZE ];/***********************************************************/ /* x86 ISA bus support */
@@ -5901,6 +5904,7 @@ int main(int argc, char **argv) vncunused =0 ; kernel_filename =NULL ; kernel_cmdline ="" ; + *vncpasswd ='\0' ;#ifndef CONFIG_DM #ifdef TARGET_PPC cdrom_index =1 ;
@@ -6544,6 +6548,10 @@ int main(int argc, char **argv)init_ioports (); +/* read vncpasswd from xenstore */ +if (0 >xenstore_read_vncpasswd (domid)) +exit (1 ); +/* terminal init */ if (nographic) {dumb_display_init (ds);
tools/ioemu/vl.h +4 -0
@@ -1209,6 +1209,7 @@ void xenstore_process_event(void *opaquevoid xenstore_process_event (void *opaque);void xenstore_check_new_media_present (int timeout);void xenstore_write_vncport (int vnc_display); +int xenstore_read_vncpasswd (int domid);/* xen_platform.c */ void pci_xen_platform_init (PCIBus *bus);
@@ -1220,4 +1221,7 @@ extern char domain_name[];void destroy_hvm_domain (void ); +/* VNC Authentication */ +#define AUTHCHALLENGESIZE 16 +#endif /* VL_H */
tools/ioemu/vnc.c +106 -1
128 lines not on this page · raw message
tools/ioemu/xenstore.c +57 -0
60 lines not on this page · raw message
tools/python/xen/xend/XendRoot.py +6 -0
@@ -95,6 +95,8 @@ class XendRoot: dom0_min_mem_default = '0' dom0_vcpus_default = '0' + + vncpasswd_default = None components = {}
@@ -272,6 +274,10 @@ class XendRoot: def get_console_limit(self): return self.get_config_int('console-limit', 1024) + def get_vncpasswd_default(self): + return self.get_config_value('vncpasswd', + self.vncpasswd_default) + def instance(): """Get an instance of XendRoot. Use this instead of the constructor.
tools/python/xen/xend/image.py +22 -0
@@ -349,8 +349,16 @@ class HVMImageHandler(ImageHandler): sdl = sxp.child_value(config, 'sdl') ret = [] nographic = sxp.child_value(config, 'nographic') + + # get password from VM config(if password omitted, None) + vncpasswd_vmconfig = sxp.child_value(config, 'vncpasswd') + vncpasswd = vncpasswd_vmconfig + if nographic: ret.append('-nographic') + # remove password + if vncpasswd_vmconfig: + config.remove(['vncpasswd', vncpasswd_vmconfig]) return ret if vnc: vncdisplay = sxp.child_value(config, 'vncdisplay',
@@ -359,6 +367,20 @@ class HVMImageHandler(ImageHandler): vncunused = sxp.child_value(config, 'vncunused') if vncunused: ret += ['-vncunused'] + # get password from xend-config(if password omitted, None) + vncpasswd_default = xen.xend.XendRoot.instance().get_vncpasswd_default() + # password check + if vncpasswd is None: + if vncpasswd_default is None: + raise VmError('vncpasswd is not setuped in VMconfig and xend-config.') + else: + vncpasswd = vncpasswd_default + if vncpasswd!='': + self.vm.storeVm("vncpasswd", vncpasswd) + + # remove password + config.remove(['vncpasswd', vncpasswd_vmconfig]) + return ret def createDeviceModel(self):
tools/python/xen/xm/create.py +5 -0
@@ -103,6 +103,10 @@ gopts.opt('console_autoconnect', short=' gopts.opt('console_autoconnect', short='c', fn=set_true, default=0, use="Connect to the console after the domain is created.") + +gopts.var('vncpasswd', val='NAME', + fn=set_value, default=None, + use="Password for VNC console on HVM domain.") gopts.var('vncviewer', val='no|yes', fn=set_bool, default=None,
@@ -638,6 +642,7 @@ def configure_hvm(config_image, vals): for a in args: if (vals.__dict__[a]): config_image.append([a, vals.__dict__[a]]) + config_image.append(['vncpasswd', vals.vncpasswd]) def run_bootloader(vals, config_image): if not os.access(vals.bootloader, os.X_OK):
tools/ioemu/d3des.c new file +434 -0
434 lines not on this page · raw message
tools/ioemu/d3des.h new file +51 -0
51 lines not on this page · raw message
Re: [PATCH][Take 3] VNC authentification
Quoted 8 lines · Masami Watanabe
tools/ioemu/vnc.c +7
-0+static int vnc_auth (VncState *vs) +{ +extern char vncpasswd[64 ]; +extern unsigned char challenge[AUTHCHALLENGESIZE ]; + +if (*vncpasswd =='\0' ) { +/* AuthType is None */
tools/ioemu/vnc.c int vnc_start_viewer(int port) · line 1409
Quoted 10 lines
tools/ioemu/vnc.c +10
-0+vnc_write_u32 (vs,1 ); +vnc_flush (vs); +vnc_read_when (vs, protocol_client_init,1 ); + }else { +/* AuthType is VncAuth */ +vnc_write_u32 (vs,2 ); +vnc_flush (vs); + +/* Read AuthType */ +vnc_read_when (vs, protocol_authtype,1 );
As I mentioned before, you cannot have to vnc_read_when()'s execution path without returning the the mainloop.
protocol_authtype() cannot possibly be invoked. If the code is working now, it's pure luck.
There was just a very high profile RealVNC vulnerability that was due to improper authtype handling. It's very important we do this right so we don't duplicate this bug.
Regards,
Anthony Liguori
Quoted 20 lines
tools/ioemu/vnc.c +11
-0+/* Send Challenge */ +make_challenge (challenge,AUTHCHALLENGESIZE ); +vnc_write (vs, challenge,AUTHCHALLENGESIZE ); +vnc_flush (vs); + +/* Read Responce */ +vnc_read_when (vs, protocol_response,AUTHCHALLENGESIZE ); + } + +return 0 ; +}_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH][Take 3] VNC authentification
Quoted 23 lines · Anthony Liguori
Quoted 8 lines · Masami Watanabe
tools/ioemu/vnc.c +7
-0+static int vnc_auth (VncState *vs) +{ +extern char vncpasswd[64 ]; +extern unsigned char challenge[AUTHCHALLENGESIZE ]; + +if (*vncpasswd =='\0' ) { +/* AuthType is None */ tools/ioemu/vnc.c int vnc_start_viewer(int port) · line 1409
Quoted 10 lines
tools/ioemu/vnc.c +10
-0+vnc_write_u32 (vs,1 ); +vnc_flush (vs); +vnc_read_when (vs, protocol_client_init,1 ); + }else { +/* AuthType is VncAuth */ +vnc_write_u32 (vs,2 ); +vnc_flush (vs); + +/* Read AuthType */ +vnc_read_when (vs, protocol_authtype,1 );As I mentioned before, you cannot have to vnc_read_when()'s execution path without returning the the mainloop.
Quoted 2 lines
protocol_authtype()cannot possibly be invoked. If the code is working now, it's pure luck.
Yeah, the impl of protocol_authtype() in there is a no-op too - it should be rejecting auth types which aren't supported, even if it was being invoked. With the code as it is, protocol_authtype never runs & the server starts doing VNCAuth regardless of what the client says it wants to do, which is clearly not correct.
Dan.
Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
Re: [PATCH][Take 3] VNC authentification
Quoted 25 lines · Daniel P. Berrange
Quoted 23 lines · Anthony Liguori
Quoted 9 lines · Masami Watanabe
tools/ioemu/vnc.c +7
-0+static int vnc_auth (VncState *vs) +{ +extern char vncpasswd[64 ]; +extern unsigned char challenge[AUTHCHALLENGESIZE ]; + +if (*vncpasswd =='\0' ) { +/* AuthType is None */ tools/ioemu/vnc.c int vnc_start_viewer(int port) · line 1409
Quoted 10 lines
tools/ioemu/vnc.c +10
-0+vnc_write_u32 (vs,1 ); +vnc_flush (vs); +vnc_read_when (vs, protocol_client_init,1 ); + }else { +/* AuthType is VncAuth */ +vnc_write_u32 (vs,2 ); +vnc_flush (vs); + +/* Read AuthType */ +vnc_read_when (vs, protocol_authtype,1 );As I mentioned before, you cannot have to vnc_read_when()'s execution path without returning the the mainloop.
Quoted 9 lines
Quoted 2 lines
protocol_authtype()cannot possibly be invoked. If the code is working now, it's pure luck.Yeah, the impl of
protocol_authtype()in there is a no-op too - it should be rejecting auth types which aren't supported, even if it was being invoked. With the code as it is,protocol_authtypenever runs & the server starts doing VNCAuth regardless of what the client says it wants to do, which is clearly not correct.
Another thing to keep in mind, is that the reason I did 3.3 instead of 3.8 is that I knew there was only one auth type we would be supporting. If we do support multiple auth types, we really ought to move to using the 3.8 protocol since that provides a negotiation mechanism.
Regards,
Anthony Liguori
Quoted 2 lines
Dan.