• A
    Move TLS auth into separate file ("Daniel P. Berrange") · 5fb6c7a8
    aliguori 提交于
    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.
    
    
     Makefile              |   11 
     b/vnc-auth-vencrypt.c |  167 ++++++++++++++
     b/vnc-auth-vencrypt.h |   33 ++
     b/vnc-tls.c           |  414 +++++++++++++++++++++++++++++++++++
     b/vnc-tls.h           |   70 ++++++
     vnc.c                 |  581 +++-----------------------------------------------
     vnc.h                 |   76 ++++--
     7 files changed, 780 insertions(+), 572 deletions(-)
    Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
    Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6723 c046a42c-6fe2-441c-8c8c-71466251a162
    5fb6c7a8
vnc.h 8.4 KB