vnc: remove rfbDes calls

This commit is contained in:
Jay Sorg 2015-08-18 18:05:45 -07:00
parent d91de3c1cc
commit bfe69badc3
2 changed files with 10 additions and 6 deletions

View File

@ -21,6 +21,7 @@
#include "vnc.h" #include "vnc.h"
#include "log.h" #include "log.h"
#include "trans.h" #include "trans.h"
#include "ssl_calls.h"
#define LLOG_LEVEL 1 #define LLOG_LEVEL 1
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
@ -51,14 +52,18 @@ lib_send_copy(struct vnc *v, struct stream *s)
void DEFAULT_CC void DEFAULT_CC
rfbEncryptBytes(char *bytes, char *passwd) rfbEncryptBytes(char *bytes, char *passwd)
{ {
char key[12]; char key[24];
void *des;
/* key is simply password padded with nulls */ /* key is simply password padded with nulls */
g_memset(key, 0, sizeof(key)); g_memset(key, 0, sizeof(key));
g_strncpy(key, passwd, 8); g_mirror_memcpy(key, passwd, g_strlen(passwd));
rfbDesKey((unsigned char *)key, EN0); /* 0, encrypt */ des = ssl_des3_encrypt_info_create(key, 0);
rfbDes((unsigned char *)bytes, (unsigned char *)bytes); ssl_des3_encrypt(des, 8, bytes, bytes);
rfbDes((unsigned char *)(bytes + 8), (unsigned char *)(bytes + 8)); 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);
} }
/******************************************************************************/ /******************************************************************************/

View File

@ -22,7 +22,6 @@
#include "arch.h" #include "arch.h"
#include "parse.h" #include "parse.h"
#include "os_calls.h" #include "os_calls.h"
#include "d3des.h"
#include "defines.h" #include "defines.h"
#define CURRENT_MOD_VER 3 #define CURRENT_MOD_VER 3