Esempio n. 1
0
BOOL license_read_platform_challenge_packet(rdpLicense* license, wStream* s)
{
	BYTE MacData[16];
	UINT32 ConnectFlags = 0;

	DEBUG_LICENSE("Receiving Platform Challenge Packet");

	if (Stream_GetRemainingLength(s) < 4)
		return FALSE;

	Stream_Read_UINT32(s, ConnectFlags); /* ConnectFlags, Reserved (4 bytes) */
	/* EncryptedPlatformChallenge */
	license->EncryptedPlatformChallenge->type = BB_ANY_BLOB;
	license_read_binary_blob(s, license->EncryptedPlatformChallenge);
	license->EncryptedPlatformChallenge->type = BB_ENCRYPTED_DATA_BLOB;

	if (Stream_GetRemainingLength(s) < 16)
		return FALSE;

	Stream_Read(s, MacData, 16); /* MACData (16 bytes) */
	if (!license_decrypt_platform_challenge(license))
		return FALSE;
#ifdef WITH_DEBUG_LICENSE
	WLog_DBG(TAG, "ConnectFlags: 0x%08X", ConnectFlags);
	WLog_DBG(TAG, "EncryptedPlatformChallenge:");
	winpr_HexDump(TAG, WLOG_DEBUG, license->EncryptedPlatformChallenge->data, license->EncryptedPlatformChallenge->length);
	WLog_DBG(TAG, "PlatformChallenge:");
	winpr_HexDump(TAG, WLOG_DEBUG, license->PlatformChallenge->data, license->PlatformChallenge->length);
	WLog_DBG(TAG, "MacData:");
	winpr_HexDump(TAG, WLOG_DEBUG, MacData, 16);
#endif
	return TRUE;
}
Esempio n. 2
0
void license_read_platform_challenge_packet(rdpLicense* license, STREAM* s)
{
	DEBUG_LICENSE("Receiving Platform Challenge Packet");

	stream_seek(s, 4); /* ConnectFlags, Reserved (4 bytes) */

	/* EncryptedPlatformChallenge */
	license->encrypted_platform_challenge->type = BB_ANY_BLOB;
	license_read_binary_blob(s, license->encrypted_platform_challenge);
	license->encrypted_platform_challenge->type = BB_ENCRYPTED_DATA_BLOB;

	/* MACData (16 bytes) */
	stream_seek(s, 16);

	license_decrypt_platform_challenge(license);
}
Esempio n. 3
0
BOOL license_read_platform_challenge_packet(rdpLicense* license, STREAM* s)
{
	DEBUG_LICENSE("Receiving Platform Challenge Packet");
	if(stream_get_left(s) < 4)
		return FALSE;
	stream_seek(s, 4); /* ConnectFlags, Reserved (4 bytes) */

	/* EncryptedPlatformChallenge */
	license->encrypted_platform_challenge->type = BB_ANY_BLOB;
	license_read_binary_blob(s, license->encrypted_platform_challenge);
	license->encrypted_platform_challenge->type = BB_ENCRYPTED_DATA_BLOB;

	/* MACData (16 bytes) */
	if(!stream_skip(s, 16))
		return FALSE;

	license_decrypt_platform_challenge(license);
	return TRUE;
}
Esempio n. 4
0
void test_license_decrypt_platform_challenge(void)
{
	STREAM _s, *s;

	s = &_s;
	memcpy(license->licensing_encryption_key, test_licensing_encryption_key,
			sizeof(test_licensing_encryption_key));

	license->encrypted_platform_challenge->data =
			(uint8*) xmalloc(sizeof(test_encrypted_platform_challenge));
	license->encrypted_platform_challenge->length =
			sizeof(test_encrypted_platform_challenge);

	memcpy(license->encrypted_platform_challenge->data, test_encrypted_platform_challenge,
			sizeof(test_encrypted_platform_challenge));

	license_decrypt_platform_challenge(license);

	s->data = license->platform_challenge->data;
	s->p = s->data + sizeof(test_platform_challenge);

	ASSERT_STREAM(s, test_platform_challenge, sizeof(test_platform_challenge));
}