Ejemplo n.º 1
0
int freerdp_client_settings_parse_assistance_file(rdpSettings* settings,
        const char* filename)
{
	int status;
	int ret = -1;
	rdpAssistanceFile* file;
	file = freerdp_assistance_file_new();

	if (!file)
		return -1;

	status = freerdp_assistance_parse_file(file, filename);

	if (status < 0)
		goto out;

	status = freerdp_client_populate_settings_from_assistance_file(file, settings);

	if (status < 0)
		goto out;

	ret = 0;
out:
	freerdp_assistance_file_free(file);
	return ret;
}
Ejemplo n.º 2
0
static BOOL test_msrsc_incident_file_type1(wLog* log)
{
	BOOL rc = FALSE;
	int status;
	char* pass = NULL;
	char* expertBlob = NULL;
	const char* EncryptedPassStub;
	size_t EncryptedPassStubLength;
	rdpAssistanceFile* file = freerdp_assistance_file_new();

	if (!file)
		return -1;

	status = freerdp_assistance_parse_file_buffer(file,
	         TEST_MSRC_INCIDENT_FILE_TYPE1, sizeof(TEST_MSRC_INCIDENT_FILE_TYPE1),
	         TEST_MSRC_INCIDENT_PASSWORD_TYPE1);
	WLog_Print(log, WLOG_INFO, "freerdp_assistance_parse_file_buffer: %d", status);

	if (status < 0)
		goto fail;

	freerdp_assistance_print_file(file, WLog_Get("foo"), WLOG_INFO);

	if (!freerdp_assistance_get_encrypted_pass_stub(file, &EncryptedPassStub, &EncryptedPassStubLength))
		goto fail;

	pass = freerdp_assistance_bin_to_hex_string(EncryptedPassStub, EncryptedPassStubLength);

	if (!pass)
		goto fail;

	WLog_Print(log, WLOG_INFO, "freerdp_assistance_decrypt: %d %s [%"PRIdz"]", status, pass,
	           EncryptedPassStubLength);
	expertBlob = freerdp_assistance_construct_expert_blob("Edgar Olougouna", pass);
	WLog_Print(log, WLOG_INFO, "expertBlob='%s'", expertBlob);
	rc = TRUE;
fail:
	freerdp_assistance_file_free(file);
	free(pass);
	free(expertBlob);
	return rc;
}