From: Steinar H. Gunderson Date: Sat, 5 Feb 2005 20:50:51 +0000 (+0000) Subject: Generate the encryption and decryption keys! X-Git-Url: https://git.sesse.net/?p=rdpsrv;a=commitdiff_plain;h=97533ab1c16cf7dc2ce2314579816bd1c620733e;hp=a521f01158c829ca8f5ce87f81b85f9aa50db4dd Generate the encryption and decryption keys! --- diff --git a/secure.c b/secure.c index 7c90ee2..47d5e80 100644 --- a/secure.c +++ b/secure.c @@ -156,6 +156,19 @@ sec_generate_keys(uint8 * client_key, uint8 * server_key, int rc4_key_size) /* Initialise RC4 state arrays */ RC4_set_key(&rc4_decrypt_key, rc4_key_len, sec_decrypt_key); RC4_set_key(&rc4_encrypt_key, rc4_key_len, sec_encrypt_key); + + { + int i; + printf("sec_decrypt_key: "); + for (i = 0; i < 16; ++i) + printf("0x%02x ", sec_decrypt_key[i]); + printf("\n"); + + printf("sec_encrypt_key: "); + for (i = 0; i < 16; ++i) + printf("0x%02x ", sec_encrypt_key[i]); + printf("\n"); + } } static uint8 pad_54[40] = { @@ -715,6 +728,8 @@ sec_process_mcs_data(STREAM s) } } +extern unsigned char cacert[]; + /* Receive secure transport packet */ STREAM sec_recv(void) @@ -777,6 +792,10 @@ sec_recv(void) printf("0x%x ", inr[i + SEC_RANDOM_SIZE]); } printf("\n"); + + // now we can generate the keys + sec_generate_keys(inr + SEC_RANDOM_SIZE, cacert, 8); + continue; } }