void license_generate_keys(rdpLicense* license) { security_master_secret(license->PremasterSecret, license->ClientRandom, license->ServerRandom, license->MasterSecret); /* MasterSecret */ security_session_key_blob(license->MasterSecret, license->ClientRandom, license->ServerRandom, license->SessionKeyBlob); /* SessionKeyBlob */ security_mac_salt_key(license->SessionKeyBlob, license->ClientRandom, license->ServerRandom, license->MacSaltKey); /* MacSaltKey */ security_licensing_encryption_key(license->SessionKeyBlob, license->ClientRandom, license->ServerRandom, license->LicensingEncryptionKey); /* LicensingEncryptionKey */ #ifdef WITH_DEBUG_LICENSE WLog_DBG(TAG, "ClientRandom:"); winpr_HexDump(TAG, WLOG_DEBUG, license->ClientRandom, CLIENT_RANDOM_LENGTH); WLog_DBG(TAG, "ServerRandom:"); winpr_HexDump(TAG, WLOG_DEBUG, license->ServerRandom, SERVER_RANDOM_LENGTH); WLog_DBG(TAG, "PremasterSecret:"); winpr_HexDump(TAG, WLOG_DEBUG, license->PremasterSecret, PREMASTER_SECRET_LENGTH); WLog_DBG(TAG, "MasterSecret:"); winpr_HexDump(TAG, WLOG_DEBUG, license->MasterSecret, MASTER_SECRET_LENGTH); WLog_DBG(TAG, "SessionKeyBlob:"); winpr_HexDump(TAG, WLOG_DEBUG, license->SessionKeyBlob, SESSION_KEY_BLOB_LENGTH); WLog_DBG(TAG, "MacSaltKey:"); winpr_HexDump(TAG, WLOG_DEBUG, license->MacSaltKey, MAC_SALT_KEY_LENGTH); WLog_DBG(TAG, "LicensingEncryptionKey:"); winpr_HexDump(TAG, WLOG_DEBUG, license->LicensingEncryptionKey, LICENSING_ENCRYPTION_KEY_LENGTH); #endif }
void license_generate_keys(rdpLicense* license) { security_master_secret(license->premaster_secret, license->client_random, license->server_random, license->master_secret); /* MasterSecret */ security_session_key_blob(license->master_secret, license->client_random, license->server_random, license->session_key_blob); /* SessionKeyBlob */ security_mac_salt_key(license->session_key_blob, license->client_random, license->server_random, license->mac_salt_key); /* MacSaltKey */ security_licensing_encryption_key(license->session_key_blob, license->client_random, license->server_random, license->licensing_encryption_key); /* LicensingEncryptionKey */ #ifdef WITH_DEBUG_LICENSE printf("ClientRandom:\n"); freerdp_hexdump(license->client_random, CLIENT_RANDOM_LENGTH); printf("ServerRandom:\n"); freerdp_hexdump(license->server_random, SERVER_RANDOM_LENGTH); printf("PremasterSecret:\n"); freerdp_hexdump(license->premaster_secret, PREMASTER_SECRET_LENGTH); printf("MasterSecret:\n"); freerdp_hexdump(license->master_secret, MASTER_SECRET_LENGTH); printf("SessionKeyBlob:\n"); freerdp_hexdump(license->session_key_blob, SESSION_KEY_BLOB_LENGTH); printf("MacSaltKey:\n"); freerdp_hexdump(license->mac_salt_key, MAC_SALT_KEY_LENGTH); printf("LicensingEncryptionKey:\n"); freerdp_hexdump(license->licensing_encryption_key, LICENSING_ENCRYPTION_KEY_LENGTH); #endif }