FreeRDP
|
#include <freerdp/config.h>
#include <winpr/crt.h>
#include <winpr/crypto.h>
#include <winpr/shell.h>
#include <winpr/path.h>
#include <winpr/file.h>
#include <freerdp/log.h>
#include "redirection.h"
#include "certificate.h"
#include "license.h"
Macros | |
#define | TAG FREERDP_TAG("core.license") |
#define | PLATFORMID (CLIENT_OS_ID_WINNT_POST_52 | CLIENT_IMAGE_ID_MICROSOFT) |
Functions | |
static wStream * | license_send_stream_init (rdpLicense *license) |
static void | license_generate_randoms (rdpLicense *license) |
static BOOL | license_generate_keys (rdpLicense *license) |
static BOOL | license_generate_hwid (rdpLicense *license) |
static BOOL | license_encrypt_premaster_secret (rdpLicense *license) |
static LICENSE_PRODUCT_INFO * | license_new_product_info (void) |
static void | license_free_product_info (LICENSE_PRODUCT_INFO *productInfo) |
static BOOL | license_read_product_info (wStream *s, LICENSE_PRODUCT_INFO *productInfo) |
static LICENSE_BLOB * | license_new_binary_blob (UINT16 type) |
static void | license_free_binary_blob (LICENSE_BLOB *blob) |
static BOOL | license_read_binary_blob (wStream *s, LICENSE_BLOB *blob) |
static BOOL | license_write_binary_blob (wStream *s, const LICENSE_BLOB *blob) |
static SCOPE_LIST * | license_new_scope_list (void) |
static void | license_free_scope_list (SCOPE_LIST *scopeList) |
static BOOL | license_read_scope_list (wStream *s, SCOPE_LIST *scopeList) |
static BOOL | license_read_license_request_packet (rdpLicense *license, wStream *s) |
static BOOL | license_read_platform_challenge_packet (rdpLicense *license, wStream *s) |
static BOOL | license_read_new_or_upgrade_license_packet (rdpLicense *license, wStream *s) |
static BOOL | license_read_error_alert_packet (rdpLicense *license, wStream *s) |
static BOOL | license_write_new_license_request_packet (rdpLicense *license, wStream *s) |
static BOOL | license_answer_license_request (rdpLicense *license) |
static BOOL | license_write_platform_challenge_response_packet (rdpLicense *license, wStream *s, const BYTE *mac_data) |
static BOOL | license_send_platform_challenge_response_packet (rdpLicense *license) |
static BOOL | license_send_client_info (rdpLicense *license, const LICENSE_BLOB *calBlob, BYTE *signature) |
static BOOL | computeCalHash (const char *hostname, char *hashStr) |
static BOOL | saveCal (rdpSettings *settings, const BYTE *data, size_t length, const char *hostname) |
static BYTE * | loadCalFile (rdpSettings *settings, const char *hostname, size_t *dataLen) |
static BOOL | license_read_preamble (wStream *s, BYTE *bMsgType, BYTE *flags, UINT16 *wMsgSize) |
static BOOL | license_write_preamble (wStream *s, BYTE bMsgType, BYTE flags, UINT16 wMsgSize) |
static BOOL | license_send (rdpLicense *license, wStream *s, BYTE type) |
int | license_recv (rdpLicense *license, wStream *s) |
static BOOL | license_get_server_rsa_public_key (rdpLicense *license) |
static BOOL | license_rc4_with_licenseKey (const rdpLicense *license, const BYTE *input, size_t len, LICENSE_BLOB *target) |
static BOOL | license_encrypt_and_MAC (rdpLicense *license, const BYTE *input, size_t len, LICENSE_BLOB *target, BYTE *mac) |
static BOOL | license_decrypt_and_check_MAC (rdpLicense *license, const BYTE *input, size_t len, LICENSE_BLOB *target, const BYTE *packetMac) |
static BOOL | license_write_encrypted_premaster_secret_blob (wStream *s, const LICENSE_BLOB *blob, UINT32 ModulusLength) |
static BOOL | license_read_encrypted_blob (const rdpLicense *license, wStream *s, LICENSE_BLOB *target) |
BOOL | license_send_valid_client_error_packet (rdpRdp *rdp) |
rdpLicense * | license_new (rdpRdp *rdp) |
void | license_free (rdpLicense *license) |
Variables | |
static const char | licenseStore [] = "licenses" |
#define PLATFORMID (CLIENT_OS_ID_WINNT_POST_52 | CLIENT_IMAGE_ID_MICROSOFT) |
#define TAG FREERDP_TAG("core.license") |
FreeRDP: A Remote Desktop Protocol Implementation RDP Licensing
Copyright 2011-2013 Marc-Andre Moreau marca Copyright 2014 Norbert Federa ndre .more au@g mail. comnorbe Copyright 2018 David Fort rt.f edera @thi ncast .comconta ct@h arden ing- consu ltin g.com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
static |
|
static |
Send a NEW_LICENSE_REQUEST packet.
http://msdn.microsoft.com/en-us/library/cc241918/
license | license module |
|
static |
Decrypt the input using the license key and check the MAC
license | rdpLicense to get keys and salt from |
input | the input data to decrypt and MAC |
len | size of input |
target | a target LICENSE_BLOB where the decrypted input will be stored |
mac | the signature buffer (16 bytes) |
|
static |
Encrypt the input using the license key and MAC the input for a signature
license | rdpLicense to get keys and salt from |
input | the input data to encrypt and MAC |
len | size of input |
target | a target LICENSE_BLOB where the encrypted input will be stored |
mac | the signature buffer (16 bytes) |
|
static |
void license_free | ( | rdpLicense * | license | ) |
Free license module.
license | license module to be freed |
|
static |
Free License Binary Blob (LICENSE_BINARY_BLOB).
http://msdn.microsoft.com/en-us/library/cc240481/
blob | license binary blob |
|
static |
Free Product Information (LICENSE_PRODUCT_INFO).
http://msdn.microsoft.com/en-us/library/cc241915/
productInfo | product information |
|
static |
Free License Scope List (SCOPE_LIST).
http://msdn.microsoft.com/en-us/library/cc241916/
scopeList | scope list |
|
static |
Generate Unique Hardware Identifier (CLIENT_HARDWARE_ID).
license | license module |
|
static |
Generate License Cryptographic Keys.
license | license module |
|
static |
|
static |
rdpLicense* license_new | ( | rdpRdp * | rdp | ) |
Instantiate new license module.
rdp | RDP module |
|
static |
Allocate New License Binary Blob (LICENSE_BINARY_BLOB).
http://msdn.microsoft.com/en-us/library/cc240481/
|
static |
Allocate New Product Information (LICENSE_PRODUCT_INFO).
http://msdn.microsoft.com/en-us/library/cc241915/
|
static |
Allocate New License Scope List (SCOPE_LIST).
http://msdn.microsoft.com/en-us/library/cc241916/
|
static |
|
static |
Read License Binary Blob (LICENSE_BINARY_BLOB).
http://msdn.microsoft.com/en-us/library/cc240481/
s | stream |
blob | license binary blob |
|
static |
|
static |
Read an ERROR_ALERT packet.
http://msdn.microsoft.com/en-us/library/cc240482/
license | license module |
s | stream |
|
static |
Read a LICENSE_REQUEST packet.
http://msdn.microsoft.com/en-us/library/cc241914/
license | license module |
s | stream |
|
static |
Read a NEW_LICENSE packet.
http://msdn.microsoft.com/en-us/library/cc241926/
license | license module |
s | stream |
|
static |
|
static |
Read a licensing preamble.
http://msdn.microsoft.com/en-us/library/cc240480/
s | stream |
bMsgType | license message type |
flags | message flags |
wMsgSize | message size |
|
static |
Read Product Information (PRODUCT_INFO).
http://msdn.microsoft.com/en-us/library/cc241915/
s | stream |
productInfo | product information |
|
static |
Read License Scope List (SCOPE_LIST).
http://msdn.microsoft.com/en-us/library/cc241916/
s | stream |
scopeList | scope list |
int license_recv | ( | rdpLicense * | license, |
wStream * | s | ||
) |
Receive an RDP licensing packet.
http://msdn.microsoft.com/en-us/library/cc240479/
license | license module |
s | stream |
Send an RDP licensing packet.
http://msdn.microsoft.com/en-us/library/cc240479/
license | license module |
s | stream |
Using EXTENDED_ERROR_MSG_SUPPORTED here would cause mstsc to crash when running in server mode! This flag seems to be incorrectly documented.
|
static |
|
static |
Send Client Challenge Response Packet.
http://msdn.microsoft.com/en-us/library/cc241922/
license | license module |
|
static |
Initialize a license packet stream.
license | license module |
Encryption of licensing packets is optional even if the rdp security layer is used. If the peer has not indicated that it is capable of processing encrypted licensing packets (rdp->do_crypt_license) we turn off encryption (via rdp->do_crypt) before initializing the rdp stream and reenable it afterwards.
BOOL license_send_valid_client_error_packet | ( | rdpRdp * | rdp | ) |
Send Server License Error - Valid Client Packet.
http://msdn.microsoft.com/en-us/library/cc241922/
license | license module |
|
static |
Write License Binary Blob (LICENSE_BINARY_BLOB).
http://msdn.microsoft.com/en-us/library/cc240481/
s | stream |
blob | license binary blob |
|
static |
|
static |
Write a NEW_LICENSE_REQUEST packet.
http://msdn.microsoft.com/en-us/library/cc241918/
license | license module |
s | stream |
|
static |
Write Client Challenge Response Packet.
http://msdn.microsoft.com/en-us/library/cc241922/
license | license module |
s | stream |
mac_data | signature |
|
static |
Write a licensing preamble.
http://msdn.microsoft.com/en-us/library/cc240480/
s | stream |
bMsgType | license message type |
flags | message flags |
wMsgSize | message size |
|
static |
|
static |
|
static |