FreeRDP
license.c File Reference
#include <freerdp/config.h>
#include "settings.h"
#include <freerdp/license.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/crypto.h>
#include <winpr/shell.h>
#include <winpr/path.h>
#include <winpr/file.h>
#include <freerdp/log.h>
#include <freerdp/crypto/certificate.h>
#include "license.h"
#include "../crypto/crypto.h"
#include "../crypto/certificate.h"

Macros

#define TAG   FREERDP_TAG("core.license")
 
#define PLATFORM_CHALLENGE_RESPONSE_VERSION   0x0100
 
#define LICENSE_PKT_CS_MASK    (LICENSE_INFO | NEW_LICENSE_REQUEST | PLATFORM_CHALLENGE_RESPONSE | ERROR_ALERT)
 
#define LICENSE_PKT_SC_MASK    (LICENSE_REQUEST | PLATFORM_CHALLENGE | NEW_LICENSE | UPGRADE_LICENSE | ERROR_ALERT)
 
#define LICENSE_PKT_MASK   (LICENSE_PKT_CS_MASK | LICENSE_PKT_SC_MASK)
 
#define LICENSE_PREAMBLE_LENGTH   4
 
#define SERVER_RANDOM_LENGTH   32
 
#define MASTER_SECRET_LENGTH   48
 
#define PREMASTER_SECRET_LENGTH   48
 
#define SESSION_KEY_BLOB_LENGTH   48
 
#define MAC_SALT_KEY_LENGTH   16
 
#define LICENSING_ENCRYPTION_KEY_LENGTH   16
 
#define HWID_PLATFORM_ID_LENGTH   4
 
#define HWID_UNIQUE_DATA_LENGTH   16
 
#define HWID_LENGTH   20
 
#define LICENSING_PADDING_SIZE   8
 
#define PREAMBLE_VERSION_2_0   0x02
 
#define PREAMBLE_VERSION_3_0   0x03
 
#define LicenseProtocolVersionMask   0x0F
 
#define EXTENDED_ERROR_MSG_SUPPORTED   0x80
 
#define KEY_EXCHANGE_ALG_RSA   0x00000001
 
#define PLATFORMID   (CLIENT_OS_ID_WINNT_POST_52 | CLIENT_IMAGE_ID_MICROSOFT)
 

Enumerations

enum  LicenseRequestType {
  LICENSE_REQUEST = 0x01 , PLATFORM_CHALLENGE = 0x02 , NEW_LICENSE = 0x03 , UPGRADE_LICENSE = 0x04 ,
  LICENSE_INFO = 0x12 , NEW_LICENSE_REQUEST = 0x13 , PLATFORM_CHALLENGE_RESPONSE = 0x15 , ERROR_ALERT = 0xFF
}
 Licensing Packet Types. More...
 
enum  {
  BB_ANY_BLOB = 0x0000 , BB_DATA_BLOB = 0x0001 , BB_RANDOM_BLOB = 0x0002 , BB_CERTIFICATE_BLOB = 0x0003 ,
  BB_ERROR_BLOB = 0x0004 , BB_ENCRYPTED_DATA_BLOB = 0x0009 , BB_KEY_EXCHG_ALG_BLOB = 0x000D , BB_SCOPE_BLOB = 0x000E ,
  BB_CLIENT_USER_NAME_BLOB = 0x000F , BB_CLIENT_MACHINE_NAME_BLOB = 0x0010
}
 binary Blob Types More...
 
enum  {
  ERR_INVALID_SERVER_CERTIFICATE = 0x00000001 , ERR_NO_LICENSE = 0x00000002 , ERR_INVALID_MAC = 0x00000003 , ERR_INVALID_SCOPE = 0x00000004 ,
  ERR_NO_LICENSE_SERVER = 0x00000006 , STATUS_VALID_CLIENT = 0x00000007 , ERR_INVALID_CLIENT = 0x00000008 , ERR_INVALID_PRODUCT_ID = 0x0000000B ,
  ERR_INVALID_MESSAGE_LENGTH = 0x0000000C
}
 license Error Codes More...
 
enum  { ST_TOTAL_ABORT = 0x00000001 , ST_NO_TRANSITION = 0x00000002 , ST_RESET_PHASE_TO_START = 0x00000003 , ST_RESEND_LAST_MESSAGE = 0x00000004 }
 state Transition Codes More...
 
enum  { WIN32_PLATFORM_CHALLENGE_TYPE = 0x0100 , WIN16_PLATFORM_CHALLENGE_TYPE = 0x0200 , WINCE_PLATFORM_CHALLENGE_TYPE = 0x0300 , OTHER_PLATFORM_CHALLENGE_TYPE = 0xFF00 }
 Platform Challenge Types. More...
 
enum  { LICENSE_DETAIL_SIMPLE = 0x0001 , LICENSE_DETAIL_MODERATE = 0x0002 , LICENSE_DETAIL_DETAIL = 0x0003 }
 License Detail Levels. More...
 
enum  {
  CLIENT_OS_ID_WINNT_351 = 0x01000000 , CLIENT_OS_ID_WINNT_40 = 0x02000000 , CLIENT_OS_ID_WINNT_50 = 0x03000000 , CLIENT_OS_ID_WINNT_POST_52 = 0x04000000 ,
  CLIENT_IMAGE_ID_MICROSOFT = 0x00010000 , CLIENT_IMAGE_ID_CITRIX = 0x00020000
}
 

Functions

static BOOL license_send_error_alert (rdpLicense *license, UINT32 dwErrorCode, UINT32 dwStateTransition, const LICENSE_BLOB *info)
 
static BOOL license_set_state (rdpLicense *license, LICENSE_STATE state)
 
static const char * license_get_state_string (LICENSE_STATE state)
 
static const char * license_preferred_key_exchange_alg_string (UINT32 alg, char *buffer, size_t size)
 
static const char * license_request_type_string (UINT32 type)
 
static const char * licencse_blob_type_string (UINT16 type)
 
static wStreamlicense_send_stream_init (rdpLicense *license)
 Initialize a license packet stream. More...
 
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_INFOlicense_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_BLOBlicense_new_binary_blob (UINT16 type)
 
static void license_free_binary_blob (LICENSE_BLOB *blob)
 
static BOOL license_read_binary_blob_data (LICENSE_BLOB *blob, UINT16 type, const void *data, size_t length)
 
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_LISTlicense_new_scope_list (void)
 
static BOOL license_scope_list_resize (SCOPE_LIST *scopeList, UINT32 count)
 
static void license_free_scope_list (SCOPE_LIST *scopeList)
 
static BOOL license_read_scope_list (wStream *s, SCOPE_LIST *scopeList)
 
static BOOL license_write_scope_list (wStream *s, const SCOPE_LIST *scopeList)
 
static BOOL license_read_license_request_packet (rdpLicense *license, wStream *s)
 
static BOOL license_write_license_request_packet (const rdpLicense *license, wStream *s)
 
static BOOL license_read_platform_challenge_packet (rdpLicense *license, wStream *s)
 
static BOOL license_send_platform_challenge_packet (rdpLicense *license)
 
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 (const rdpLicense *license, wStream *s)
 
static BOOL license_read_new_license_request_packet (rdpLicense *license, wStream *s)
 
static BOOL license_answer_license_request (rdpLicense *license)
 
static BOOL license_send_platform_challenge_response (rdpLicense *license)
 
static BOOL license_read_platform_challenge_response (rdpLicense *license, wStream *s)
 
static BOOL license_read_client_platform_challenge_response (rdpLicense *license, wStream *s)
 
static BOOL license_write_client_platform_challenge_response (rdpLicense *license, wStream *s)
 
static BOOL license_read_server_upgrade_license (rdpLicense *license, wStream *s)
 
static BOOL license_write_server_upgrade_license (const rdpLicense *license, wStream *s)
 
static BOOL license_send_license_info (rdpLicense *license, const LICENSE_BLOB *calBlob, const BYTE *signature, size_t signature_length)
 
static BOOL license_read_license_info (rdpLicense *license, wStream *s)
 
static state_run_t license_client_recv (rdpLicense *license, wStream *s)
 
static state_run_t license_server_recv (rdpLicense *license, wStream *s)
 
static BOOL license_ensure_state (rdpLicense *license, LICENSE_STATE state, UINT32 msg)
 
state_run_t license_recv (rdpLicense *license, wStream *s)
 
static BOOL license_check_stream_length (wStream *s, SSIZE_T expect, const char *where)
 
static BOOL license_check_stream_capacity (wStream *s, size_t expect, const char *where)
 
static BOOL computeCalHash (const char *hostname, char *hashStr, size_t len)
 
static BOOL saveCal (const rdpSettings *settings, const BYTE *data, size_t length, const char *hostname)
 
static BYTEloadCalFile (const 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)
 
static BOOL license_server_send_new_or_upgrade_license (rdpLicense *license, BOOL upgrade)
 
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, size_t mac_length)
 
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_product_info (wStream *s, const LICENSE_PRODUCT_INFO *productInfo)
 
static BOOL license_write_encrypted_premaster_secret_blob (wStream *s, const LICENSE_BLOB *blob, UINT32 ModulusLength)
 
static BOOL license_read_encrypted_premaster_secret_blob (wStream *s, LICENSE_BLOB *blob, UINT32 *ModulusLength)
 
static BOOL license_check_preferred_alg (rdpLicense *license, UINT32 PreferredKeyExchangeAlg, const char *where)
 
static BOOL license_send_license_request_packet (rdpLicense *license)
 
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)
 
LICENSE_STATE license_get_state (const rdpLicense *license)
 
LICENSE_TYPE license_get_type (const rdpLicense *license)
 
BOOL license_server_send_request (rdpLicense *license)
 
static BOOL license_set_string (const char *what, const char *value, BYTE **bdst, UINT32 *dstLen)
 
BOOL license_server_configure (rdpLicense *license)
 
rdpLicense * license_get (rdpContext *context)
 

Variables

static const char licenseStore [] = "licenses"
 

Macro Definition Documentation

◆ EXTENDED_ERROR_MSG_SUPPORTED

#define EXTENDED_ERROR_MSG_SUPPORTED   0x80

◆ HWID_LENGTH

#define HWID_LENGTH   20

◆ HWID_PLATFORM_ID_LENGTH

#define HWID_PLATFORM_ID_LENGTH   4

◆ HWID_UNIQUE_DATA_LENGTH

#define HWID_UNIQUE_DATA_LENGTH   16

◆ KEY_EXCHANGE_ALG_RSA

#define KEY_EXCHANGE_ALG_RSA   0x00000001

◆ LICENSE_PKT_CS_MASK

#define LICENSE_PKT_CS_MASK    (LICENSE_INFO | NEW_LICENSE_REQUEST | PLATFORM_CHALLENGE_RESPONSE | ERROR_ALERT)

◆ LICENSE_PKT_MASK

#define LICENSE_PKT_MASK   (LICENSE_PKT_CS_MASK | LICENSE_PKT_SC_MASK)

◆ LICENSE_PKT_SC_MASK

#define LICENSE_PKT_SC_MASK    (LICENSE_REQUEST | PLATFORM_CHALLENGE | NEW_LICENSE | UPGRADE_LICENSE | ERROR_ALERT)

◆ LICENSE_PREAMBLE_LENGTH

#define LICENSE_PREAMBLE_LENGTH   4

◆ LicenseProtocolVersionMask

#define LicenseProtocolVersionMask   0x0F

◆ LICENSING_ENCRYPTION_KEY_LENGTH

#define LICENSING_ENCRYPTION_KEY_LENGTH   16

◆ LICENSING_PADDING_SIZE

#define LICENSING_PADDING_SIZE   8

◆ MAC_SALT_KEY_LENGTH

#define MAC_SALT_KEY_LENGTH   16

◆ MASTER_SECRET_LENGTH

#define MASTER_SECRET_LENGTH   48

◆ PLATFORM_CHALLENGE_RESPONSE_VERSION

#define PLATFORM_CHALLENGE_RESPONSE_VERSION   0x0100

◆ PLATFORMID

◆ PREAMBLE_VERSION_2_0

#define PREAMBLE_VERSION_2_0   0x02

◆ PREAMBLE_VERSION_3_0

#define PREAMBLE_VERSION_3_0   0x03

◆ PREMASTER_SECRET_LENGTH

#define PREMASTER_SECRET_LENGTH   48

◆ SERVER_RANDOM_LENGTH

#define SERVER_RANDOM_LENGTH   32

◆ SESSION_KEY_BLOB_LENGTH

#define SESSION_KEY_BLOB_LENGTH   48

◆ TAG

#define TAG   FREERDP_TAG("core.license")

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

binary Blob Types

Enumerator
BB_ANY_BLOB 
BB_DATA_BLOB 
BB_RANDOM_BLOB 
BB_CERTIFICATE_BLOB 
BB_ERROR_BLOB 
BB_ENCRYPTED_DATA_BLOB 
BB_KEY_EXCHG_ALG_BLOB 
BB_SCOPE_BLOB 
BB_CLIENT_USER_NAME_BLOB 
BB_CLIENT_MACHINE_NAME_BLOB 

◆ anonymous enum

anonymous enum

license Error Codes

Enumerator
ERR_INVALID_SERVER_CERTIFICATE 
ERR_NO_LICENSE 
ERR_INVALID_MAC 
ERR_INVALID_SCOPE 
ERR_NO_LICENSE_SERVER 
STATUS_VALID_CLIENT 
ERR_INVALID_CLIENT 
ERR_INVALID_PRODUCT_ID 
ERR_INVALID_MESSAGE_LENGTH 

◆ anonymous enum

anonymous enum

state Transition Codes

Enumerator
ST_TOTAL_ABORT 
ST_NO_TRANSITION 
ST_RESET_PHASE_TO_START 
ST_RESEND_LAST_MESSAGE 

◆ anonymous enum

anonymous enum

Platform Challenge Types.

Enumerator
WIN32_PLATFORM_CHALLENGE_TYPE 
WIN16_PLATFORM_CHALLENGE_TYPE 
WINCE_PLATFORM_CHALLENGE_TYPE 
OTHER_PLATFORM_CHALLENGE_TYPE 

◆ anonymous enum

anonymous enum

License Detail Levels.

Enumerator
LICENSE_DETAIL_SIMPLE 
LICENSE_DETAIL_MODERATE 
LICENSE_DETAIL_DETAIL 

◆ anonymous enum

anonymous enum
Enumerator
CLIENT_OS_ID_WINNT_351 
CLIENT_OS_ID_WINNT_40 
CLIENT_OS_ID_WINNT_50 
CLIENT_OS_ID_WINNT_POST_52 
CLIENT_IMAGE_ID_MICROSOFT 
CLIENT_IMAGE_ID_CITRIX 

◆ LicenseRequestType

Licensing Packet Types.

Enumerator
LICENSE_REQUEST 
PLATFORM_CHALLENGE 
NEW_LICENSE 
UPGRADE_LICENSE 
LICENSE_INFO 
NEW_LICENSE_REQUEST 
PLATFORM_CHALLENGE_RESPONSE 
ERROR_ALERT 

Function Documentation

◆ computeCalHash()

static BOOL computeCalHash ( const char *  hostname,
char *  hashStr,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ licencse_blob_type_string()

static const char* licencse_blob_type_string ( UINT16  type)
static
Here is the caller graph for this function:

◆ license_answer_license_request()

BOOL license_answer_license_request ( rdpLicense *  license)
static

Send a NEW_LICENSE_REQUEST packet. msdn{cc241918}

Parameters
licenselicense module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_check_preferred_alg()

static BOOL license_check_preferred_alg ( rdpLicense *  license,
UINT32  PreferredKeyExchangeAlg,
const char *  where 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_check_stream_capacity()

static BOOL license_check_stream_capacity ( wStream s,
size_t  expect,
const char *  where 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_check_stream_length()

static BOOL license_check_stream_length ( wStream s,
SSIZE_T  expect,
const char *  where 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_client_recv()

state_run_t license_client_recv ( rdpLicense *  license,
wStream s 
)
static

Receive an RDP licensing packet. msdn{cc240479}

Parameters
licenselicense module
sstream
Returns
if the operation completed successfully
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_decrypt_and_check_MAC()

static BOOL license_decrypt_and_check_MAC ( rdpLicense *  license,
const BYTE input,
size_t  len,
LICENSE_BLOB target,
const BYTE packetMac 
)
static

Decrypt the input using the license key and check the MAC

Parameters
licenserdpLicense to get keys and salt from
inputthe input data to decrypt and MAC
lensize of input
targeta target LICENSE_BLOB where the decrypted input will be stored
packetMacthe signature buffer (16 bytes)
Returns
if the operation completed successfully
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_encrypt_and_MAC()

static BOOL license_encrypt_and_MAC ( rdpLicense *  license,
const BYTE input,
size_t  len,
LICENSE_BLOB target,
BYTE mac,
size_t  mac_length 
)
static

Encrypt the input using the license key and MAC the input for a signature

Parameters
licenserdpLicense to get keys and salt from
inputthe input data to encrypt and MAC
lensize of input
targeta target LICENSE_BLOB where the encrypted input will be stored
macthe signature buffer (16 bytes)
Returns
if the operation completed successfully
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_encrypt_premaster_secret()

BOOL license_encrypt_premaster_secret ( rdpLicense *  license)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_ensure_state()

static BOOL license_ensure_state ( rdpLicense *  license,
LICENSE_STATE  state,
UINT32  msg 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_free()

void license_free ( rdpLicense *  license)

Free license module.

Parameters
licenselicense module to be freed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_free_binary_blob()

void license_free_binary_blob ( LICENSE_BLOB blob)
static

Free License Binary Blob (LICENSE_BINARY_BLOB). msdn{cc240481}

Parameters
bloblicense binary blob
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_free_product_info()

void license_free_product_info ( LICENSE_PRODUCT_INFO productInfo)
static

Free Product Information (LICENSE_PRODUCT_INFO). msdn{cc241915}

Parameters
productInfoproduct information
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_free_scope_list()

void license_free_scope_list ( SCOPE_LIST scopeList)
static

Free License Scope List (SCOPE_LIST). msdn{cc241916}

Parameters
scopeListscope list
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_generate_hwid()

BOOL license_generate_hwid ( rdpLicense *  license)
static

Generate Unique Hardware Identifier (CLIENT_HARDWARE_ID).

Parameters
licenselicense module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_generate_keys()

static BOOL license_generate_keys ( rdpLicense *  license)
static

Generate License Cryptographic Keys.

Parameters
licenselicense module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_generate_randoms()

void license_generate_randoms ( rdpLicense *  license)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_get()

rdpLicense* license_get ( rdpContext *  context)

◆ license_get_server_rsa_public_key()

static BOOL license_get_server_rsa_public_key ( rdpLicense *  license)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_get_state()

LICENSE_STATE license_get_state ( const rdpLicense *  license)
Here is the caller graph for this function:

◆ license_get_state_string()

const char * license_get_state_string ( LICENSE_STATE  state)
static
Here is the caller graph for this function:

◆ license_get_type()

LICENSE_TYPE license_get_type ( const rdpLicense *  license)

◆ license_new()

rdpLicense* license_new ( rdpRdp *  rdp)

Instantiate new license module.

Parameters
rdpRDP module
Returns
new license module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_new_binary_blob()

LICENSE_BLOB * license_new_binary_blob ( UINT16  type)
static

Allocate New License Binary Blob (LICENSE_BINARY_BLOB). msdn{cc240481}

Returns
new license binary blob
Here is the caller graph for this function:

◆ license_new_product_info()

LICENSE_PRODUCT_INFO * license_new_product_info ( void  )
static

Allocate New Product Information (LICENSE_PRODUCT_INFO). msdn{cc241915}

Returns
new product information
Here is the caller graph for this function:

◆ license_new_scope_list()

SCOPE_LIST * license_new_scope_list ( void  )
static

Allocate New License Scope List (SCOPE_LIST). msdn{cc241916}

Returns
new scope list
Here is the caller graph for this function:

◆ license_preferred_key_exchange_alg_string()

static const char* license_preferred_key_exchange_alg_string ( UINT32  alg,
char *  buffer,
size_t  size 
)
static
Here is the caller graph for this function:

◆ license_rc4_with_licenseKey()

static BOOL license_rc4_with_licenseKey ( const rdpLicense *  license,
const BYTE input,
size_t  len,
LICENSE_BLOB target 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_binary_blob()

BOOL license_read_binary_blob ( wStream s,
LICENSE_BLOB blob 
)
static

Read License Binary Blob (LICENSE_BINARY_BLOB). msdn{cc240481}

Parameters
sstream
bloblicense binary blob
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_binary_blob_data()

BOOL license_read_binary_blob_data ( LICENSE_BLOB blob,
UINT16  type,
const void *  data,
size_t  length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_client_platform_challenge_response()

BOOL license_read_client_platform_challenge_response ( rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_encrypted_blob()

static BOOL license_read_encrypted_blob ( const rdpLicense *  license,
wStream s,
LICENSE_BLOB target 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_encrypted_premaster_secret_blob()

static BOOL license_read_encrypted_premaster_secret_blob ( wStream s,
LICENSE_BLOB blob,
UINT32 *  ModulusLength 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_error_alert_packet()

BOOL license_read_error_alert_packet ( rdpLicense *  license,
wStream s 
)
static

Read an ERROR_ALERT packet. msdn{cc240482}

Parameters
licenselicense module
sstream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_license_info()

BOOL license_read_license_info ( rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_license_request_packet()

BOOL license_read_license_request_packet ( rdpLicense *  license,
wStream s 
)
static

Read a LICENSE_REQUEST packet. msdn{cc241914}

Parameters
licenselicense module
sstream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_new_license_request_packet()

BOOL license_read_new_license_request_packet ( rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_new_or_upgrade_license_packet()

BOOL license_read_new_or_upgrade_license_packet ( rdpLicense *  license,
wStream s 
)
static

Read a NEW_LICENSE packet. msdn{cc241926}

Parameters
licenselicense module
sstream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_platform_challenge_packet()

BOOL license_read_platform_challenge_packet ( rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_platform_challenge_response()

BOOL license_read_platform_challenge_response ( rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:

◆ license_read_preamble()

static BOOL license_read_preamble ( wStream s,
BYTE bMsgType,
BYTE flags,
UINT16 wMsgSize 
)
static

Read a licensing preamble. msdn{cc240480}

Parameters
sstream
bMsgTypelicense message type
flagsmessage flags
wMsgSizemessage size
Returns
if the operation completed successfully
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_product_info()

BOOL license_read_product_info ( wStream s,
LICENSE_PRODUCT_INFO productInfo 
)
static

Read Product Information (PRODUCT_INFO). msdn{cc241915}

Parameters
sstream
productInfoproduct information
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_scope_list()

BOOL license_read_scope_list ( wStream s,
SCOPE_LIST scopeList 
)
static

Read License Scope List (SCOPE_LIST). msdn{cc241916}

Parameters
sstream
scopeListscope list
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_read_server_upgrade_license()

BOOL license_read_server_upgrade_license ( rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:

◆ license_recv()

state_run_t license_recv ( rdpLicense *  license,
wStream s 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_request_type_string()

static const char* license_request_type_string ( UINT32  type)
static
Here is the caller graph for this function:

◆ license_scope_list_resize()

BOOL license_scope_list_resize ( SCOPE_LIST scopeList,
UINT32  count 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_send()

static BOOL license_send ( rdpLicense *  license,
wStream s,
BYTE  type 
)
static

Send an RDP licensing packet. msdn{cc240479}

Parameters
licenselicense module
sstream

Using EXTENDED_ERROR_MSG_SUPPORTED here would cause mstsc to crash when running in server mode! This flag seems to be incorrectly documented.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_send_error_alert()

BOOL license_send_error_alert ( rdpLicense *  license,
UINT32  dwErrorCode,
UINT32  dwStateTransition,
const LICENSE_BLOB info 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_send_license_info()

BOOL license_send_license_info ( rdpLicense *  license,
const LICENSE_BLOB calBlob,
const BYTE signature,
size_t  signature_length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_send_license_request_packet()

static BOOL license_send_license_request_packet ( rdpLicense *  license)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_send_platform_challenge_packet()

BOOL license_send_platform_challenge_packet ( rdpLicense *  license)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_send_platform_challenge_response()

BOOL license_send_platform_challenge_response ( rdpLicense *  license)
static

Send Client Challenge Response Packet. msdn{cc241922}

Parameters
licenselicense module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_send_stream_init()

wStream * license_send_stream_init ( rdpLicense *  license)
static

Initialize a license packet stream.

Parameters
licenselicense module
Returns
stream or NULL
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_send_valid_client_error_packet()

BOOL license_send_valid_client_error_packet ( rdpRdp *  rdp)

Send Server License Error - Valid Client Packet. msdn{cc241922}

Parameters
rdpA pointer to the context to use
Returns
TRUE for success, FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_server_configure()

BOOL license_server_configure ( rdpLicense *  license)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_server_recv()

state_run_t license_server_recv ( rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_server_send_new_or_upgrade_license()

static BOOL license_server_send_new_or_upgrade_license ( rdpLicense *  license,
BOOL  upgrade 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_server_send_request()

BOOL license_server_send_request ( rdpLicense *  license)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_set_state()

BOOL license_set_state ( rdpLicense *  license,
LICENSE_STATE  state 
)
static
Here is the caller graph for this function:

◆ license_set_string()

static BOOL license_set_string ( const char *  what,
const char *  value,
BYTE **  bdst,
UINT32 *  dstLen 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_write_binary_blob()

BOOL license_write_binary_blob ( wStream s,
const LICENSE_BLOB blob 
)
static

Write License Binary Blob (LICENSE_BINARY_BLOB). msdn{cc240481}

Parameters
sstream
bloblicense binary blob
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_write_client_platform_challenge_response()

BOOL license_write_client_platform_challenge_response ( rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_write_encrypted_premaster_secret_blob()

static BOOL license_write_encrypted_premaster_secret_blob ( wStream s,
const LICENSE_BLOB blob,
UINT32  ModulusLength 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_write_license_request_packet()

BOOL license_write_license_request_packet ( const rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_write_new_license_request_packet()

BOOL license_write_new_license_request_packet ( const rdpLicense *  license,
wStream s 
)
static

Write a NEW_LICENSE_REQUEST packet. msdn{cc241918}

Parameters
licenselicense module
sstream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_write_preamble()

static BOOL license_write_preamble ( wStream s,
BYTE  bMsgType,
BYTE  flags,
UINT16  wMsgSize 
)
static

Write a licensing preamble. msdn{cc240480}

Parameters
sstream
bMsgTypelicense message type
flagsmessage flags
wMsgSizemessage size
Returns
if the operation completed successfully
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_write_product_info()

static BOOL license_write_product_info ( wStream s,
const LICENSE_PRODUCT_INFO productInfo 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_write_scope_list()

BOOL license_write_scope_list ( wStream s,
const SCOPE_LIST scopeList 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license_write_server_upgrade_license()

BOOL license_write_server_upgrade_license ( const rdpLicense *  license,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadCalFile()

static BYTE* loadCalFile ( const rdpSettings *  settings,
const char *  hostname,
size_t *  dataLen 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveCal()

static BOOL saveCal ( const rdpSettings *  settings,
const BYTE data,
size_t  length,
const char *  hostname 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ licenseStore

const char licenseStore[] = "licenses"
static