Move TLS auth into separate file ("Daniel P. Berrange")
commit9d5f4a68ddb05d823ef1fde787ac027715fe1f95
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Fri, 6 Mar 2009 20:27:23 +0000 (6 20:27 +0000)
committerMark McLoughlin <markmc@redhat.com>
Wed, 24 Jun 2009 16:38:56 +0000 (24 17:38 +0100)
treeee0bf27e5ae5083247130d0b9c927fce8ee0a5cd
parentc1b31361bfecd3f67e8766d8df2510c801f536f4
Move TLS auth into separate file ("Daniel P. Berrange")

This patch refactors the existing TLS code to make the main VNC code
more managable. The code moves to two new files

 - vnc-tls.c: generic helpers for TLS handshake & credential setup
 - vnc-auth-vencrypt.c: the actual VNC TLS authentication mechanism.

The reason for this split is that there are other TLS based auth
mechanisms which we may like to use in the future. These can all
share the same vnc-tls.c routines. In addition this will facilitate
anyone who may want to port the vnc-tls.c file to allow for choice
of GNUTLS & NSS for impl.

The TLS state is moved out of the VncState struct, and into a separate
VncStateTLS struct, defined in vnc-tls.h. This is then referenced from
the main VncState. End size of the struct is the same, but it keeps
things a little more managable.

The vnc.h file gains a bunch more function prototypes, for functions
in vnc.c that were previously static, but now need to be accessed
from the separate auth code files.

The only TLS related code still in the main vl.c is the command line
argument handling / setup, and the low level I/O routines calling
gnutls_send/recv.

(cherry picked from commit 5fb6c7a8b26eab1a22207d24b4784bd2b39ab54b)

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Makefile
vnc-auth-vencrypt.c [new file with mode: 0644]
vnc-auth-vencrypt.h [new file with mode: 0644]
vnc-tls.c [new file with mode: 0644]
vnc-tls.h [new file with mode: 0644]
vnc.c
vnc.h