162 |
|
|
163 |
/* Generate a signature for the HWID buffer */ |
/* Generate a signature for the HWID buffer */ |
164 |
licence_generate_hwid(hwid); |
licence_generate_hwid(hwid); |
165 |
sec_sign(signature, licence_sign_key, 16, hwid, sizeof(hwid)); |
sec_sign(signature, 16, licence_sign_key, 16, hwid, sizeof(hwid)); |
166 |
|
|
167 |
/* Now encrypt the HWID */ |
/* Now encrypt the HWID */ |
168 |
RC4_set_key(&crypt_key, 16, licence_key); |
RC4_set_key(&crypt_key, 16, licence_key); |
245 |
licence_generate_hwid(hwid); |
licence_generate_hwid(hwid); |
246 |
memcpy(sealed_buffer, decrypt_token, LICENCE_TOKEN_SIZE); |
memcpy(sealed_buffer, decrypt_token, LICENCE_TOKEN_SIZE); |
247 |
memcpy(sealed_buffer + LICENCE_TOKEN_SIZE, hwid, LICENCE_HWID_SIZE); |
memcpy(sealed_buffer + LICENCE_TOKEN_SIZE, hwid, LICENCE_HWID_SIZE); |
248 |
sec_sign(out_sig, licence_sign_key, 16, |
sec_sign(out_sig, 16, licence_sign_key, 16, |
249 |
sealed_buffer, sizeof(sealed_buffer)); |
sealed_buffer, sizeof(sealed_buffer)); |
250 |
|
|
251 |
/* Deliberately break signature if licencing disabled */ |
/* Deliberately break signature if licencing disabled */ |