22#include <openssl/rc4.h>
28 uint8 master_secret[48];
32 sec_hash_48(master_secret, pre_master_secret, client_random, server_random,
'A');
33 sec_hash_48(key_block, master_secret, server_random, client_random,
'A');
39 sec_hash_16(
This->licence.key, &key_block[16], client_random, server_random);
139 uint8 *server_random;
151 memset(null_data, 0,
sizeof(null_data));
155 if (licence_size > 0)
162 RC4_set_key(&crypt_key, 16,
This->licence.key);
163 RC4(&crypt_key,
sizeof(hwid), hwid, hwid);
217 error(
"token len %d\n", tokenlen);
231 uint8 *in_token, *in_sig;
243 RC4_set_key(&crypt_key, 16,
This->licence.key);
250 sec_sign(out_sig, 16,
This->licence.sign_key, 16, sealed_buffer,
sizeof(sealed_buffer));
253 RC4_set_key(&crypt_key, 16,
This->licence.key);
273 RC4_set_key(&crypt_key, 16,
This->licence.key);
274 RC4(&crypt_key,
length,
s->p,
s->p);
286 for (
i = 0;
i < 4;
i++)
ACPI_SIZE strlen(const char *String)
#define LICENCE_HWID_SIZE
#define LICENCE_SIGNATURE_SIZE
#define LICENCE_TAG_REQUEST
#define LICENCE_TOKEN_SIZE
void licence_process(STREAM s)
static void licence_generate_hwid(uint8 *hwid)
static void licence_generate_keys(uint8 *client_random, uint8 *server_random, uint8 *pre_master_secret)
#define out_uint32_le(s, v)
#define in_uint16_le(s, v)
#define in_uint8p(s, v, n)
#define out_uint16_le(s, v)
#define s_check_rem(s, n)
#define out_uint8p(s, v, n)
#define in_uint32_le(s, v)
int load_licence(unsigned char **data)
void sec_hash_48(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2, uint8 salt)
void buf_out_uint32(uint8 *buffer, uint32 value)
void sec_send(STREAM s, uint32 flags)
void unimpl(char *format,...)
void save_licence(unsigned char *data, int length)
void sec_hash_16(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2)
STREAM sec_init(uint32 flags, int maxlen)
void sec_sign(uint8 *signature, int siglen, uint8 *session_key, int keylen, uint8 *data, int datalen)
void user(int argc, const char *argv[])
#define check(expected, result)
GLuint GLsizei GLsizei * 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
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
#define memcpy(s1, s2, n)
#define LICENCE_TAG_DEMAND
#define LICENCE_TAG_PRESENT
#define LICENCE_TAG_AUTHRESP
#define LICENCE_TAG_AUTHREQ
#define LICENCE_TAG_ISSUE
#define LICENCE_TAG_REISSUE
#define LICENCE_TAG_RESULT
static void licence_process_issue(RDPCLIENT *This, STREAM s)
static BOOL licence_parse_authreq(STREAM s, uint8 **token, uint8 **signature)
static BOOL licence_process_demand(RDPCLIENT *This, STREAM s)
static BOOL licence_send_authresp(RDPCLIENT *This, uint8 *token, uint8 *crypt_hwid, uint8 *signature)
static void licence_process_authreq(RDPCLIENT *This, STREAM s)
static BOOL licence_present(RDPCLIENT *This, uint8 *client_random, uint8 *rsa_data, uint8 *licence_data, int licence_size, uint8 *hwid, uint8 *signature)
static BOOL licence_send_request(RDPCLIENT *This, uint8 *client_random, uint8 *rsa_data, char *user, char *host)