Go to the source code of this file.
|
void * | rdssl_rc4_info_create (void) |
|
void | rdssl_rc4_info_delete (void *rc4_info) |
|
void | rdssl_rc4_set_key (void *rc4_info, char *key, int len) |
|
void | rdssl_rc4_crypt (void *rc4_info, char *in_data, char *out_data, int len) |
|
int | rdssl_mod_exp (char *out, int out_len, char *in, int in_len, char *mod, int mod_len, char *exp, int exp_len) |
|
static void | licence_generate_keys (uint8 *client_random, uint8 *server_random, uint8 *pre_master_secret) |
|
static void | licence_generate_hwid (uint8 *hwid) |
|
static void | licence_info (uint8 *client_random, uint8 *rsa_data, uint8 *licence_data, int licence_size, uint8 *hwid, uint8 *signature) |
|
static void | licence_send_new_licence_request (uint8 *client_random, uint8 *rsa_data, char *user, char *host) |
|
static void | licence_process_request (STREAM s) |
|
static void | licence_send_platform_challenge_response (uint8 *token, uint8 *crypt_hwid, uint8 *signature) |
|
static RD_BOOL | licence_parse_platform_challenge (STREAM s, uint8 **token, uint8 **signature) |
|
static void | licence_process_platform_challenge (STREAM s) |
|
static void | licence_process_new_license (STREAM s) |
|
void | licence_process_error_alert (STREAM s) |
|
void | licence_process (STREAM s) |
|
◆ licence_generate_hwid()
static void licence_generate_hwid |
( |
uint8 * |
hwid | ) |
|
|
static |
◆ licence_generate_keys()
static void licence_generate_keys |
( |
uint8 * |
client_random, |
|
|
uint8 * |
server_random, |
|
|
uint8 * |
pre_master_secret |
|
) |
| |
|
static |
Definition at line 49 of file licence.c.
50{
51 uint8 master_secret[48];
53
54
55 sec_hash_48(master_secret, pre_master_secret, client_random, server_random,
'A');
56 sec_hash_48(key_block, master_secret, server_random, client_random,
'A');
57
58
60
61
63}
static uint8 g_licence_key[16]
static uint8 g_licence_sign_key[16]
void sec_hash_48(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2, uint8 salt)
void sec_hash_16(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2)
#define memcpy(s1, s2, n)
Referenced by licence_process_demand(), and licence_process_request().
◆ licence_info()
Definition at line 74 of file licence.c.
76{
82
84
88
92
98
102
106
108
111}
#define LICENCE_SIGNATURE_SIZE
#define LICENCE_TAG_LICENCE_INFO
RDP_VERSION g_rdp_version
#define out_uint32_le(s, v)
#define out_uint16_le(s, v)
#define out_uint8p(s, v, n)
void sec_send(STREAM s, uint32 flags)
STREAM sec_init(uint32 flags, int maxlen)
GLuint GLsizei GLsizei * length
Referenced by licence_process_request().
◆ licence_parse_platform_challenge()
Definition at line 232 of file licence.c.
233{
235
237
240 {
241 error(
"token len %d\n", tokenlen);
243 }
244
247
249}
#define LICENCE_TOKEN_SIZE
#define in_uint16_le(s, v)
#define in_uint8p(s, v, n)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Referenced by licence_process_platform_challenge().
◆ licence_process()
Definition at line 378 of file licence.c.
379{
381
384
385#if WITH_DEBUG
386 DEBUG((
"Received licensing PDU (message type 0x%02x)\n",
tag));
387#endif
388
390 {
393 break;
394
397 break;
398
401
403 break;
404
407 break;
408
409 default:
411 }
412}
#define LICENCE_TAG_ERROR_ALERT
#define LICENCE_TAG_UPGRADE_LICENCE
#define LICENCE_TAG_NEW_LICENCE
#define LICENCE_TAG_REQUEST
#define LICENCE_TAG_PLATFORM_CHALLANGE
void licence_process_error_alert(STREAM s)
static void licence_process_platform_challenge(STREAM s)
static void licence_process_request(STREAM s)
static void licence_process_new_license(STREAM s)
void unimpl(char *format,...)
Referenced by sec_recv().
◆ licence_process_error_alert()
Definition at line 324 of file licence.c.
325{
332
333
334
335
336
337
338
340 {
342 return;
343 }
344
345
347 {
348 case 0x6:
349 warning(
"License error alert from server: No license server\n");
350 break;
351
352 case 0x8:
353 warning(
"License error alert from server: Invalid client\n");
354 break;
355
356 case 0x4:
357 case 0xb:
358 case 0xc:
359 default:
360 warning(
"License error alert from server: code %u, state transition %u\n",
362 break;
363 }
364
365
366 switch (error_info)
367 {
368 default:
369 break;
370 }
371
373}
RD_BOOL g_licence_error_result
Referenced by licence_process().
◆ licence_process_new_license()
static void licence_process_new_license |
( |
STREAM |
s | ) |
|
|
static |
Definition at line 288 of file licence.c.
289{
290 void * crypt_key;
293
297 return;
298
303
304
306
307
308
310 for (
i = 0;
i < 4;
i++)
311 {
315 return;
316 }
317
320}
void rdssl_rc4_crypt(void *rc4_info, char *in_data, char *out_data, int len)
void * rdssl_rc4_info_create(void)
void rdssl_rc4_set_key(void *rc4_info, char *key, int len)
void rdssl_rc4_info_delete(void *rc4_info)
#define s_check_rem(s, n)
#define in_uint32_le(s, v)
void save_licence(unsigned char *data, int length)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by licence_process().
◆ licence_process_platform_challenge()
static void licence_process_platform_challenge |
( |
STREAM |
s | ) |
|
|
static |
Definition at line 253 of file licence.c.
254{
260 void * crypt_key;
261
262
265
266
271
272
277
278
282
284}
static RD_BOOL licence_parse_platform_challenge(STREAM s, uint8 **token, uint8 **signature)
static void licence_send_platform_challenge_response(uint8 *token, uint8 *crypt_hwid, uint8 *signature)
static void licence_generate_hwid(uint8 *hwid)
void sec_sign(uint8 *signature, int siglen, uint8 *session_key, int keylen, uint8 *data, int datalen)
Referenced by licence_process().
◆ licence_process_request()
Definition at line 156 of file licence.c.
157{
159 uint8 *server_random;
163 int licence_size;
164 void * crypt_key;
165
166
168
169
170
171 memset(null_data, 0,
sizeof(null_data));
173
175 if (licence_size > 0)
176 {
177
180
181
186
187#if WITH_DEBUG
189#endif
191
193 return;
194 }
195
196#if WITH_DEBUG
198#endif
200}
#define LICENCE_TAG_NEW_LICENCE_REQUEST
static void licence_info(uint8 *client_random, uint8 *rsa_data, uint8 *licence_data, int licence_size, uint8 *hwid, uint8 *signature)
static void licence_send_new_licence_request(uint8 *client_random, uint8 *rsa_data, char *user, char *host)
static void licence_generate_keys(uint8 *client_random, uint8 *server_random, uint8 *pre_master_secret)
int load_licence(unsigned char **data)
Referenced by licence_process().
◆ licence_send_new_licence_request()
static void licence_send_new_licence_request |
( |
uint8 * |
client_random, |
|
|
uint8 * |
rsa_data, |
|
|
char * |
user, |
|
|
char * |
host |
|
) |
| |
|
static |
Definition at line 115 of file licence.c.
116{
123
125
129
133
139
140
144
145
149
152}
ACPI_SIZE strlen(const char *String)
#define BB_CLIENT_USER_NAME_BLOB
#define BB_CLIENT_MACHINE_NAME_BLOB
void user(int argc, const char *argv[])
Referenced by licence_process_request().
◆ licence_send_platform_challenge_response()
static void licence_send_platform_challenge_response |
( |
uint8 * |
token, |
|
|
uint8 * |
crypt_hwid, |
|
|
uint8 * |
signature |
|
) |
| |
|
static |
◆ rdssl_mod_exp()
Definition at line 1485 of file ssl_calls.c.
1487{
1488
1489
1497 char* l_out;
1498 char* l_in;
1499 char* l_mod;
1500 char* l_exp;
1501
1502 if (in_len > out_len || in_len == 0 ||
1503 out_len == 0 || mod_len == 0 || exp_len == 0)
1504 {
1505 return 0;
1506 }
1509 {
1511 }
1513 {
1515 }
1517 {
1519 }
1531
1534 {
1536 {
1537 break;
1538 }
1539 }
1541
1543
1545 {
1548 {
1550 }
1551
1553 }
1559 return out_len;
1560}
std::map< E_MODULE, HMODULE > mod
static FN_RtlMultipleFreeHeap g_free
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
static void * g_malloc(int size, int zero)
#define mpNEXTBITMASK(mask, n)
static unsigned int mpSizeof(DIGIT_T *a, unsigned int ndigits)
static int mpModMult(DIGIT_T *a, DIGIT_T *x, DIGIT_T *y, DIGIT_T *m, unsigned int ndigits)
static void mpSetEqual(DIGIT_T *a, DIGIT_T *b, unsigned int ndigits)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
◆ rdssl_rc4_crypt()
Definition at line 173 of file ssl_calls.c.
174{
178 BYTE * intermediate_data;
180 if (!rc4_info || !in_data || !out_data || !
len || !
info->hKey)
181 {
182 error(
"rdssl_rc4_crypt %p %p %p %d\n", rc4_info, in_data, out_data,
len);
183 return;
184 }
186 if (!intermediate_data)
187 {
188 error(
"rdssl_rc4_set_key no memory\n");
189 return;
190 }
193 0,
195 0,
196 intermediate_data,
197 &dwLen,
198 dwLen);
200 {
202 g_free(intermediate_data);
203 error(
"CryptEncrypt failed with %lx\n",
dwErr);
204 return;
205 }
206 memcpy(out_data, intermediate_data,
len);
207 g_free(intermediate_data);
208}
BOOL WINAPI CryptEncrypt(HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final, DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen, DWORD dwBufLen)
DWORD WINAPI GetLastError(void)
Referenced by licence_process_new_license(), licence_process_platform_challenge(), and licence_process_request().
◆ rdssl_rc4_info_create()
◆ rdssl_rc4_info_delete()
void rdssl_rc4_info_delete |
( |
void * |
rc4_info | ) |
|
◆ rdssl_rc4_set_key()
Definition at line 123 of file ssl_calls.c.
124{
132 if (!rc4_info || !
key || !
len || !
info->hCryptProv)
133 {
134 error(
"rdssl_rc4_set_key %p %p %d\n", rc4_info,
key,
len);
135 return;
136 }
139 {
140 error(
"rdssl_rc4_set_key no memory\n");
141 return;
142 }
153 {
156 }
160 0,
165 {
167 error(
"CryptImportKey failed with %lx\n",
dwErr);
168 }
169}
BOOL WINAPI CryptImportKey(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, HCRYPTKEY hPubKey, DWORD dwFlags, HCRYPTKEY *phKey)
static const WCHAR desc[]
struct _PUBLICKEYSTRUC PUBLICKEYSTRUC
Referenced by licence_process_new_license(), licence_process_platform_challenge(), and licence_process_request().
◆ g_hostname
◆ g_licence_error_result
◆ g_licence_issued
◆ g_licence_key
◆ g_licence_sign_key
uint8 g_licence_sign_key[16] |
|
static |
◆ g_rdp_version
◆ g_username