1 |
/* |
/* |
2 |
rdesktop: A Remote Desktop Protocol client. |
rdesktop: A Remote Desktop Protocol client. |
3 |
RDP licensing negotiation |
RDP licensing negotiation |
4 |
Copyright (C) Matthew Chapman 1999-2002 |
Copyright (C) Matthew Chapman 1999-2005 |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
7 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
19 |
*/ |
*/ |
20 |
|
|
21 |
#include "rdesktop.h" |
#include "rdesktop.h" |
|
|
|
|
#ifdef WITH_OPENSSL |
|
22 |
#include <openssl/rc4.h> |
#include <openssl/rc4.h> |
|
#else |
|
|
#include "crypto/rc4.h" |
|
|
#endif |
|
23 |
|
|
24 |
extern char g_username[16]; |
extern char g_username[16]; |
25 |
extern char hostname[16]; |
extern char g_hostname[16]; |
26 |
|
|
27 |
static uint8 g_licence_key[16]; |
static uint8 g_licence_key[16]; |
28 |
static uint8 g_licence_sign_key[16]; |
static uint8 g_licence_sign_key[16]; |
51 |
licence_generate_hwid(uint8 * hwid) |
licence_generate_hwid(uint8 * hwid) |
52 |
{ |
{ |
53 |
buf_out_uint32(hwid, 2); |
buf_out_uint32(hwid, 2); |
54 |
strncpy((char *) (hwid + 4), hostname, LICENCE_HWID_SIZE - 4); |
strncpy((char *) (hwid + 4), g_hostname, LICENCE_HWID_SIZE - 4); |
55 |
} |
} |
56 |
|
|
57 |
/* Present an existing licence to the server */ |
/* Present an existing licence to the server */ |
169 |
return; |
return; |
170 |
} |
} |
171 |
|
|
172 |
licence_send_request(null_data, null_data, g_username, hostname); |
licence_send_request(null_data, null_data, g_username, g_hostname); |
173 |
} |
} |
174 |
|
|
175 |
/* Send an authentication response packet */ |
/* Send an authentication response packet */ |