diff options
Diffstat (limited to 'uirdesktop/licence.c')
| -rwxr-xr-x | uirdesktop/licence.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/uirdesktop/licence.c b/uirdesktop/licence.c index 32918011..09cb4548 100755 --- a/uirdesktop/licence.c +++ b/uirdesktop/licence.c @@ -20,19 +20,19 @@ #include "rdesktop.h" //#include <openssl/rc4.h> -
-void *
-ssl_rc4_info_create(void);
-void
-ssl_rc4_info_delete(void * rc4_info);
-void
-ssl_rc4_set_key(void * rc4_info, char * key, int len);
-void
-ssl_rc4_crypt(void * rc4_info, char * in_data, char * out_data, int len);
-int
-ssl_mod_exp(char* out, int out_len, char* in, int in_len,
- char* mod, int mod_len, char* exp, int exp_len);
-
+ +void * +ssl_rc4_info_create(void); +void +ssl_rc4_info_delete(void * rc4_info); +void +ssl_rc4_set_key(void * rc4_info, char * key, int len); +void +ssl_rc4_crypt(void * rc4_info, char * in_data, char * out_data, int len); +int +ssl_mod_exp(char* out, int out_len, char* in, int in_len, + char* mod, int mod_len, char* exp, int exp_len); + extern char g_username[64]; extern char g_hostname[16]; @@ -172,11 +172,11 @@ licence_process_demand(STREAM s) licence_generate_hwid(hwid); sec_sign(signature, 16, g_licence_sign_key, 16, hwid, sizeof(hwid)); - /* Now encrypt the HWID */
- crypt_key = ssl_rc4_info_create();
- ssl_rc4_set_key(crypt_key, g_licence_key, 16);
- ssl_rc4_crypt(crypt_key, hwid, hwid, sizeof(hwid));
- ssl_rc4_info_delete(crypt_key);
+ /* Now encrypt the HWID */ + crypt_key = ssl_rc4_info_create(); + ssl_rc4_set_key(crypt_key, g_licence_key, 16); + ssl_rc4_crypt(crypt_key, hwid, hwid, sizeof(hwid)); + ssl_rc4_info_delete(crypt_key); licence_present(null_data, null_data, licence_data, licence_size, hwid, signature); xfree(licence_data); @@ -251,11 +251,11 @@ licence_process_authreq(STREAM s) memcpy(out_token, in_token, LICENCE_TOKEN_SIZE); /* Decrypt the token. It should read TEST in Unicode. */ - crypt_key = ssl_rc4_info_create();
- ssl_rc4_set_key(crypt_key, g_licence_key, 16);
- ssl_rc4_crypt(crypt_key, in_token, decrypt_token, LICENCE_TOKEN_SIZE);
- ssl_rc4_info_delete(crypt_key);
-
+ crypt_key = ssl_rc4_info_create(); + ssl_rc4_set_key(crypt_key, g_licence_key, 16); + ssl_rc4_crypt(crypt_key, in_token, decrypt_token, LICENCE_TOKEN_SIZE); + ssl_rc4_info_delete(crypt_key); + /* Generate a signature for a buffer of token and HWID */ licence_generate_hwid(hwid); memcpy(sealed_buffer, decrypt_token, LICENCE_TOKEN_SIZE); @@ -263,11 +263,11 @@ licence_process_authreq(STREAM s) sec_sign(out_sig, 16, g_licence_sign_key, 16, sealed_buffer, sizeof(sealed_buffer)); /* Now encrypt the HWID */ - crypt_key = ssl_rc4_info_create();
- ssl_rc4_set_key(crypt_key, g_licence_key, 16);
- ssl_rc4_crypt(crypt_key, hwid, crypt_hwid, LICENCE_HWID_SIZE);
- ssl_rc4_info_delete(crypt_key);
-
+ crypt_key = ssl_rc4_info_create(); + ssl_rc4_set_key(crypt_key, g_licence_key, 16); + ssl_rc4_crypt(crypt_key, hwid, crypt_hwid, LICENCE_HWID_SIZE); + ssl_rc4_info_delete(crypt_key); + licence_send_authresp(out_token, crypt_hwid, out_sig); } @@ -285,11 +285,11 @@ licence_process_issue(STREAM s) if (!s_check_rem(s, length)) return; - crypt_key = ssl_rc4_info_create();
- ssl_rc4_set_key(crypt_key, g_licence_key, 16);
- ssl_rc4_crypt(crypt_key, s->p, s->p, length);
- ssl_rc4_info_delete(crypt_key);
-
+ crypt_key = ssl_rc4_info_create(); + ssl_rc4_set_key(crypt_key, g_licence_key, 16); + ssl_rc4_crypt(crypt_key, s->p, s->p, length); + ssl_rc4_info_delete(crypt_key); + in_uint16(s, check); if (check != 0) return; |
