23 |
|
|
24 |
extern char username[16]; |
extern char username[16]; |
25 |
extern char hostname[16]; |
extern char hostname[16]; |
|
extern BOOL licence; |
|
26 |
|
|
27 |
static uint8 licence_key[16]; |
static uint8 licence_key[16]; |
28 |
static uint8 licence_sign_key[16]; |
static uint8 licence_sign_key[16]; |
249 |
memcpy(sealed_buffer + LICENCE_TOKEN_SIZE, hwid, LICENCE_HWID_SIZE); |
memcpy(sealed_buffer + LICENCE_TOKEN_SIZE, hwid, LICENCE_HWID_SIZE); |
250 |
sec_sign(out_sig, 16, licence_sign_key, 16, sealed_buffer, sizeof(sealed_buffer)); |
sec_sign(out_sig, 16, licence_sign_key, 16, sealed_buffer, sizeof(sealed_buffer)); |
251 |
|
|
|
/* Deliberately break signature if licencing disabled */ |
|
|
if (!licence) |
|
|
memset(out_sig, 0, sizeof(out_sig)); |
|
|
|
|
252 |
/* Now encrypt the HWID */ |
/* Now encrypt the HWID */ |
253 |
RC4_set_key(&crypt_key, 16, licence_key); |
RC4_set_key(&crypt_key, 16, licence_key); |
254 |
RC4(&crypt_key, LICENCE_HWID_SIZE, hwid, crypt_hwid); |
RC4(&crypt_key, LICENCE_HWID_SIZE, hwid, crypt_hwid); |