[pve-devel] r5419 - vncterm/pve2

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Jan 24 10:40:08 CET 2011


Author: dietmar
Date: 2011-01-24 10:40:07 +0100 (Mon, 24 Jan 2011)
New Revision: 5419

Modified:
   vncterm/pve2/vncterm.c
Log:
more cleanups


Modified: vncterm/pve2/vncterm.c
===================================================================
--- vncterm/pve2/vncterm.c	2011-01-24 08:49:41 UTC (rev 5418)
+++ vncterm/pve2/vncterm.c	2011-01-24 09:40:07 UTC (rev 5419)
@@ -40,6 +40,9 @@
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
 
+/* define this for debugging */
+//#define DEBUG
+
 char *auth_path = "/";
 char *auth_perm = "VM.Console";
 
@@ -159,7 +162,6 @@
 
 ssize_t vnc_tls_read(rfbClientPtr cl, void *buf, size_t count)
 {
-	rfbLog("my_tls_read\n");
 	tls_client_t *sd = (tls_client_t *)cl->clientData;
 
         int ret = gnutls_read(sd->session, buf, count);
@@ -175,7 +177,6 @@
 }
 ssize_t vnc_tls_write(rfbClientPtr cl, void *buf, size_t count)
 {
-	rfbLog("my_tls_write\n");
 	tls_client_t *sd = (tls_client_t *)cl->clientData;
 
         int ret = gnutls_write(sd->session, buf, count);
@@ -217,7 +218,6 @@
 	char *x509cert = "/etc/pve/local/pve-ssl.pem";
 	char *x509key = "/etc/pve/local/pve-ssl.key";
 
-
 	if ((ret = gnutls_certificate_allocate_credentials(&x509_cred)) < 0) {
 		rfbLog("can't allocate credentials: %s\n", gnutls_strerror(ret));
 		return NULL;
@@ -242,16 +242,13 @@
 	return x509_cred;
 }
 
-/* define this for debugging */
-//#define DEBUG
-
 /* rfb tls security handler */
 
 #define rfbSecTypeVencrypt  19
 #define rfbVencryptTlsPlain 259
 #define rfbVencryptX509Plain 262
 
-int rfbEncodeU32(char *buf, uint32_t value)
+void rfbEncodeU32(char *buf, uint32_t value)
 {
     buf[0] = (value >> 24) & 0xFF;
     buf[1] = (value >> 16) & 0xFF;
@@ -259,7 +256,7 @@
     buf[3] = value & 0xFF;
 }
 
-uint32_t rfbDecodeU32(uint8_t *data, size_t offset)
+uint32_t rfbDecodeU32(char *data, size_t offset)
 {
 	return ((data[offset] << 24) | (data[offset + 1] << 16) |
 		(data[offset + 2] << 8) | data[offset + 3]);
@@ -339,7 +336,6 @@
 static void
 rfbVncAuthVencrypt(rfbClientPtr cl)
 {
-	vncTerm *vt =(vncTerm *)cl->screen->screenData;
 	int ret;
 
 	/* Send VeNCrypt version 0.2 */




More information about the pve-devel mailing list