extern VCHANNEL g_channels[];
extern unsigned int g_num_channels;
-static int rc4_key_len;
+int rc4_key_len;
static RC4_KEY rc4_decrypt_key;
static RC4_KEY rc4_encrypt_key;
static RSA *server_public_key;
-static uint8 sec_sign_key[16];
+uint8 sec_sign_key[16];
static uint8 sec_decrypt_key[16];
static uint8 sec_encrypt_key[16];
static uint8 sec_decrypt_update_key[16];
}
/* Encrypt data using RC4 */
-static void
+void
sec_encrypt(uint8 * data, int length)
{
static int use_count;
use_count = 0;
}
- printf("RC4-ing %u bytes with DECRYPT, uc=%u\n", length, use_count);
-
RC4(&rc4_decrypt_key, length, data, data);
use_count++;
}
flags &= ~SEC_ENCRYPT;
datalen = s->end - s->p - 8;
-#if WITH_DEBUG
+#if WITH_DEBUG && 0
DEBUG(("Sending encrypted packet:\n"));
hexdump(s->p + 8, datalen);
#endif
if (/*g_encryption || !g_licence_issued*/ 1)
{
in_uint32_le(s, sec_flags);
- printf("sec_flags=%x\n", sec_flags);
if (sec_flags & SEC_ENCRYPT)
{
- printf("encrypt\n");
in_uint8s(s, 8); /* signature */
sec_decrypt(s->p, s->end - s->p);
}
{
uint8 tag;
in_uint8(s, tag);
- printf("SEC_LICENSE_NEG tag %x\n", tag);
if (tag == LICENCE_TAG_PRESENT) {
process_presented_license(s);
{
STREAM s;
- printf("Sending DEMAND_ACTIVE (0x%x bytes)\n", sizeof(demand_active));
s = sec_init(SEC_ENCRYPT, sizeof(demand_active));
out_uint8p(s, demand_active, sizeof(demand_active));
s_mark_end(s);
if (sec_flags & SEC_LOGON_INFO)
{
- printf("Received logon packet!\n");
rdp_get_logon_info(s);
// demand a license
uint8 inr[SEC_MODULUS_SIZE];
int i;
- printf("Receiving the client random!\n");
in_uint32_le(s, length);
if (length != SEC_MODULUS_SIZE + SEC_PADDING_SIZE) {
error("Client random was wrong size, %u bytes\n", length);