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;
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
uint16 channel;
STREAM s;
- while ((s = mcs_recv(&channel)) != NULL)
+ if ((s = mcs_recv(&channel)) != NULL)
{
if (/*g_encryption || !g_licence_issued*/ 1)
{
}
}
- continue;
+ return NULL;
}
if (sec_flags & SEC_LOGON_INFO)
sec_send(s, SEC_LICENCE_NEG);
}
- continue;
+ return NULL;
}
if (sec_flags & SEC_CLIENT_RANDOM) {
// now we can generate the keys
sec_generate_keys(inr + SEC_RANDOM_SIZE, cacert, 1);
- continue;
+ return NULL;
}
}
if (channel != MCS_GLOBAL_CHANNEL)
{
channel_process(s, channel);
- continue;
+ return NULL;
}
return s;