summaryrefslogtreecommitdiffstats
path: root/vnc
diff options
context:
space:
mode:
Diffstat (limited to 'vnc')
-rw-r--r--vnc/vnc.c15
-rw-r--r--vnc/vnc.h1
2 files changed, 10 insertions, 6 deletions
diff --git a/vnc/vnc.c b/vnc/vnc.c
index ae9b192c..66e70225 100644
--- a/vnc/vnc.c
+++ b/vnc/vnc.c
@@ -21,6 +21,7 @@
#include "vnc.h"
#include "log.h"
#include "trans.h"
+#include "ssl_calls.h"
#define LLOG_LEVEL 1
#define LLOGLN(_level, _args) \
@@ -51,14 +52,18 @@ lib_send_copy(struct vnc *v, struct stream *s)
void DEFAULT_CC
rfbEncryptBytes(char *bytes, char *passwd)
{
- char key[12];
+ char key[24];
+ void *des;
/* key is simply password padded with nulls */
g_memset(key, 0, sizeof(key));
- g_strncpy(key, passwd, 8);
- rfbDesKey((unsigned char *)key, EN0); /* 0, encrypt */
- rfbDes((unsigned char *)bytes, (unsigned char *)bytes);
- rfbDes((unsigned char *)(bytes + 8), (unsigned char *)(bytes + 8));
+ g_mirror_memcpy(key, passwd, g_strlen(passwd));
+ des = ssl_des3_encrypt_info_create(key, 0);
+ ssl_des3_encrypt(des, 8, bytes, bytes);
+ ssl_des3_info_delete(des);
+ des = ssl_des3_encrypt_info_create(key, 0);
+ ssl_des3_encrypt(des, 8, bytes + 8, bytes + 8);
+ ssl_des3_info_delete(des);
}
/******************************************************************************/
diff --git a/vnc/vnc.h b/vnc/vnc.h
index 6cd74b0d..d7249f3d 100644
--- a/vnc/vnc.h
+++ b/vnc/vnc.h
@@ -22,7 +22,6 @@
#include "arch.h"
#include "parse.h"
#include "os_calls.h"
-#include "d3des.h"
#include "defines.h"
#define CURRENT_MOD_VER 3