--- sourceforge.net/trunk/rdesktop/secure.c 2004/06/15 22:17:08 710 +++ sourceforge.net/trunk/rdesktop/secure.c 2004/07/31 13:07:41 740 @@ -20,18 +20,11 @@ #include "rdesktop.h" -#ifdef WITH_OPENSSL #include #include #include #include #include -#else -#include "crypto/rc4.h" -#include "crypto/md5.h" -#include "crypto/sha.h" -#include "crypto/bn.h" -#endif extern char g_hostname[16]; extern int g_width; @@ -820,14 +813,26 @@ /* Receive secure transport packet */ STREAM -sec_recv(void) +sec_recv(uint8 * rdpver) { uint32 sec_flags; uint16 channel; STREAM s; - while ((s = mcs_recv(&channel)) != NULL) + while ((s = mcs_recv(&channel, rdpver)) != NULL) { + if (rdpver != NULL) + { + if (*rdpver != 3) + { + if (*rdpver & 0x80) + { + in_uint8s(s, 8); /* signature */ + sec_decrypt(s->p, s->end - s->p); + } + return s; + } + } if (g_encryption || !g_licence_issued) { in_uint32_le(s, sec_flags);