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.


 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: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6723 c046a42c-6fe2-441c-8c8c-71466251a162
3 files changed
tree: 671766bcf411add258a6deae8f2649fa368a7ba7
  1. audio/
  2. bsd-user/
  3. darwin-user/
  4. fpu/
  5. gdb-xml/
  6. hw/
  7. keymaps/
  8. linux-user/
  9. pc-bios/
  10. slirp/
  11. target-alpha/
  12. target-arm/
  13. target-cris/
  14. target-i386/
  15. target-m68k/
  16. target-mips/
  17. target-ppc/
  18. target-sh4/
  19. target-sparc/
  20. tcg/
  21. tests/
  22. .gitignore
  23. a.out.h
  24. aes.c
  25. aes.h
  26. aio.c
  27. alpha-dis.c
  28. alpha.ld
  29. arm-dis.c
  30. arm-semi.c
  31. arm.ld
  32. balloon.h
  33. block-bochs.c
  34. block-cloop.c
  35. block-cow.c
  36. block-dmg.c
  37. block-nbd.c
  38. block-parallels.c
  39. block-qcow.c
  40. block-qcow2.c
  41. block-raw-posix.c
  42. block-raw-win32.c
  43. block-vmdk.c
  44. block-vpc.c
  45. block-vvfat.c
  46. block.c
  47. block.h
  48. block_int.h
  49. bswap.h
  50. bt-host.c
  51. bt-vhci.c
  52. buffered_file.c
  53. buffered_file.h
  54. cache-utils.c
  55. cache-utils.h
  56. Changelog
  57. cocoa.m
  58. configure
  59. console.c
  60. console.h
  61. COPYING
  62. COPYING.LIB
  63. cpu-all.h
  64. cpu-defs.h
  65. cpu-exec.c
  66. cris-dis.c
  67. curses.c
  68. curses_keys.h
  69. cutils.c
  70. d3des.c
  71. d3des.h
  72. def-helper.h
  73. device_tree.c
  74. device_tree.h
  75. dis-asm.h
  76. disas.c
  77. disas.h
  78. dma-helpers.c
  79. dma.h
  80. dyngen-exec.h
  81. elf.h
  82. elf_ops.h
  83. exec-all.h
  84. exec.c
  85. feature_to_c.sh
  86. gdbstub.c
  87. gdbstub.h
  88. gen-icount.h
  89. host-utils.c
  90. host-utils.h
  91. hostregs_helper.h
  92. hpet.h
  93. hppa-dis.c
  94. hppa.ld
  95. i386-dis.c
  96. i386.ld
  97. ia64.ld
  98. keymaps.c
  99. kqemu.c
  100. kqemu.h
  101. kvm-all.c
  102. kvm.h
  103. libfdt_env.h
  104. LICENSE
  105. loader.c
  106. m68k-dis.c
  107. m68k-semi.c
  108. m68k.ld
  109. MAINTAINERS
  110. Makefile
  111. Makefile.target
  112. migration-exec.c
  113. migration-tcp.c
  114. migration.c
  115. migration.h
  116. mips-dis.c
  117. mips.ld
  118. mipsel.ld
  119. monitor.c
  120. monitor.h
  121. nbd.c
  122. nbd.h
  123. net-checksum.c
  124. net.c
  125. net.h
  126. osdep.c
  127. osdep.h
  128. pci-ids.txt
  129. posix-aio-compat.c
  130. posix-aio-compat.h
  131. ppc-dis.c
  132. ppc.ld
  133. ppc64.ld
  134. qemu-aio.h
  135. qemu-binfmt-conf.sh
  136. qemu-char.c
  137. qemu-char.h
  138. qemu-common.h
  139. qemu-doc.texi
  140. qemu-img.c
  141. qemu-img.texi
  142. qemu-lock.h
  143. qemu-log.h
  144. qemu-malloc.c
  145. qemu-nbd.c
  146. qemu-nbd.texi
  147. qemu-sockets.c
  148. qemu-tech.texi
  149. qemu-timer.h
  150. qemu-tool.c
  151. qemu_socket.h
  152. readline.c
  153. readline.h
  154. README
  155. rules.mak
  156. s390-dis.c
  157. s390.ld
  158. savevm.c
  159. sdl.c
  160. sdl_keysym.h
  161. sh4-dis.c
  162. softmmu-semi.h
  163. softmmu_defs.h
  164. softmmu_exec.h
  165. softmmu_header.h
  166. softmmu_template.h
  167. sparc-dis.c
  168. sparc.ld
  169. sparc64.ld
  170. sys-queue.h
  171. sysemu.h
  172. tap-win32.c
  173. texi2pod.pl
  174. thunk.c
  175. thunk.h
  176. TODO
  177. translate-all.c
  178. uboot_image.h
  179. usb-bsd.c
  180. usb-linux.c
  181. usb-stub.c
  182. VERSION
  183. vgafont.h
  184. vl.c
  185. vnc.c
  186. vnc.h
  187. vnc_keysym.h
  188. vnchextile.h
  189. x86_64.ld
  190. x_keymap.c
  191. x_keymap.h