BOOL license_write_new_license_request_packet(rdpLicense* license, wStream* s) { UINT32 PlatformId; UINT32 PreferredKeyExchangeAlg = KEY_EXCHANGE_ALG_RSA; PlatformId = CLIENT_OS_ID_WINNT_POST_52 | CLIENT_IMAGE_ID_MICROSOFT; Stream_Write_UINT32(s, PreferredKeyExchangeAlg); /* PreferredKeyExchangeAlg (4 bytes) */ Stream_Write_UINT32(s, PlatformId); /* PlatformId (4 bytes) */ Stream_Write(s, license->ClientRandom, 32); /* ClientRandom (32 bytes) */ /* EncryptedPremasterSecret */ if (!license_write_encrypted_premaster_secret_blob(s, license->EncryptedPremasterSecret, license->ModulusLength) || /* ClientUserName */ !license_write_binary_blob(s, license->ClientUserName) || /* ClientMachineName */ !license_write_binary_blob(s, license->ClientMachineName)) { return FALSE; } #ifdef WITH_DEBUG_LICENSE WLog_DBG(TAG, "PreferredKeyExchangeAlg: 0x%08X", PreferredKeyExchangeAlg); WLog_DBG(TAG, "ClientRandom:"); winpr_HexDump(TAG, WLOG_DEBUG, license->ClientRandom, 32); WLog_DBG(TAG, "EncryptedPremasterSecret"); winpr_HexDump(TAG, WLOG_DEBUG, license->EncryptedPremasterSecret->data, license->EncryptedPremasterSecret->length); WLog_DBG(TAG, "ClientUserName (%d): %s", license->ClientUserName->length, (char*) license->ClientUserName->data); WLog_DBG(TAG, "ClientMachineName (%d): %s", license->ClientMachineName->length, (char*) license->ClientMachineName->data); #endif return TRUE; }
void license_write_new_license_request_packet(rdpLicense* license, wStream* s) { UINT32 PlatformId; UINT32 PreferredKeyExchangeAlg = KEY_EXCHANGE_ALG_RSA; PlatformId = CLIENT_OS_ID_WINNT_POST_52 | CLIENT_IMAGE_ID_MICROSOFT; Stream_Write_UINT32(s, PreferredKeyExchangeAlg); /* PreferredKeyExchangeAlg (4 bytes) */ Stream_Write_UINT32(s, PlatformId); /* PlatformId (4 bytes) */ Stream_Write(s, license->ClientRandom, 32); /* ClientRandom (32 bytes) */ license_write_encrypted_premaster_secret_blob(s, license->EncryptedPremasterSecret, license->ModulusLength); /* EncryptedPremasterSecret */ license_write_binary_blob(s, license->ClientUserName); /* ClientUserName */ license_write_binary_blob(s, license->ClientMachineName); /* ClientMachineName */ #ifdef WITH_DEBUG_LICENSE fprintf(stderr, "PreferredKeyExchangeAlg: 0x%08X\n", PreferredKeyExchangeAlg); fprintf(stderr, "\n"); fprintf(stderr, "ClientRandom:\n"); winpr_HexDump(license->ClientRandom, 32); fprintf(stderr, "\n"); fprintf(stderr, "EncryptedPremasterSecret\n"); winpr_HexDump(license->EncryptedPremasterSecret->data, license->EncryptedPremasterSecret->length); fprintf(stderr, "\n"); fprintf(stderr, "ClientUserName (%d): %s\n", license->ClientUserName->length, (char*) license->ClientUserName->data); fprintf(stderr, "\n"); fprintf(stderr, "ClientMachineName (%d): %s\n", license->ClientMachineName->length, (char*) license->ClientMachineName->data); fprintf(stderr, "\n"); #endif }
void license_write_platform_challenge_response_packet(rdpLicense* license, wStream* s, BYTE* macData) { license_write_binary_blob(s, license->EncryptedPlatformChallenge); /* EncryptedPlatformChallengeResponse */ license_write_binary_blob(s, license->EncryptedHardwareId); /* EncryptedHWID */ Stream_EnsureRemainingCapacity(s, 16); Stream_Write(s, macData, 16); /* MACData */ }
void license_write_new_license_request_packet(rdpLicense* license, STREAM* s) { stream_write_uint32(s, KEY_EXCHANGE_ALG_RSA); /* PreferredKeyExchangeAlg (4 bytes) */ license_write_platform_id(license, s); /* PlatformId (4 bytes) */ stream_write(s, license->client_random, 32); /* ClientRandom (32 bytes) */ license_write_padded_binary_blob(s, license->encrypted_premaster_secret); /* EncryptedPremasterSecret */ license_write_binary_blob(s, license->client_user_name); /* ClientUserName */ license_write_binary_blob(s, license->client_machine_name); /* ClientMachineName */ }
void license_write_platform_challenge_response_packet(rdpLicense* license, STREAM* s, uint8* mac_data) { /* EncryptedPlatformChallengeResponse */ license_write_binary_blob(s, license->encrypted_platform_challenge); /* EncryptedHWID */ license_write_binary_blob(s, license->encrypted_hwid); /* MACData */ stream_write(s, mac_data, 16); }
BOOL license_write_platform_challenge_response_packet(rdpLicense* license, wStream* s, BYTE* macData) { if (!license_write_binary_blob(s, license->EncryptedPlatformChallenge) || /* EncryptedPlatformChallengeResponse */ !license_write_binary_blob(s, license->EncryptedHardwareId) || /* EncryptedHWID */ !Stream_EnsureRemainingCapacity(s, 16)) { return FALSE; } Stream_Write(s, macData, 16); /* MACData */ return TRUE; }
BOOL license_send_valid_client_error_packet(rdpLicense* license) { wStream* s; s = license_send_stream_init(license); DEBUG_LICENSE("Sending Error Alert Packet"); Stream_Write_UINT32(s, STATUS_VALID_CLIENT); /* dwErrorCode */ Stream_Write_UINT32(s, ST_NO_TRANSITION); /* dwStateTransition */ license_write_binary_blob(s, license->ErrorInfo); return license_send(license, s, ERROR_ALERT); }
BOOL license_send_valid_client_error_packet(rdpLicense* license) { STREAM* s; s = license_send_stream_init(license); stream_write_UINT32(s, STATUS_VALID_CLIENT); /* dwErrorCode */ stream_write_UINT32(s, ST_NO_TRANSITION); /* dwStateTransition */ license_write_binary_blob(s, license->error_info); return license_send(license, s, ERROR_ALERT); }