コード例 #1
0
ファイル: ncacn_http.c プロジェクト: orosam/FreeRDP
int rpc_http_send_replacement_out_channel_request(rdpRpc* rpc)
{
	wStream* s;
	int content_length;

	content_length = 120;

	s = rpc_ntlm_http_request(rpc, NULL, content_length, TSG_CHANNEL_OUT);

	WLog_DBG(TAG, "\n%s", Stream_Buffer(s));
	rpc_out_write(rpc, Stream_Buffer(s), Stream_Length(s));
	Stream_Free(s, TRUE);

	return 0;
}
コード例 #2
0
ファイル: rts.c プロジェクト: 5m3ntarios/FreeRDP
BOOL rts_send_CONN_A1_pdu(rdpRpc* rpc)
{
	STREAM* s;
	RTS_PDU_HEADER header;
	UINT32 ReceiveWindowSize;
	BYTE* OUTChannelCookie;
	BYTE* VirtualConnectionCookie;

	header.rpc_vers = 5;
	header.rpc_vers_minor = 0;
	header.ptype = PTYPE_RTS;
	header.pfc_flags = PFC_FIRST_FRAG | PFC_LAST_FRAG;
	header.packed_drep[0] = 0x10;
	header.packed_drep[1] = 0x00;
	header.packed_drep[2] = 0x00;
	header.packed_drep[3] = 0x00;
	header.frag_length = 76;
	header.auth_length = 0;
	header.call_id = 0;
	header.flags = 0;
	header.numberOfCommands = 4;

	DEBUG_RPC("Sending CONN_A1 RTS PDU");

	s = stream_new(header.frag_length);

	rpc_generate_cookie((BYTE*) &(rpc->VirtualConnection->Cookie));
	rpc_generate_cookie((BYTE*) &(rpc->VirtualConnection->DefaultOutChannelCookie));

	VirtualConnectionCookie = (BYTE*) &(rpc->VirtualConnection->Cookie);
	OUTChannelCookie = (BYTE*) &(rpc->VirtualConnection->DefaultOutChannelCookie);
	ReceiveWindowSize = rpc->VirtualConnection->DefaultOutChannel->ReceiveWindow;

	rts_pdu_header_write(s, &header); /* RTS Header (20 bytes) */
	rts_version_command_write(s); /* Version (8 bytes) */
	rts_cookie_command_write(s, VirtualConnectionCookie); /* VirtualConnectionCookie (20 bytes) */
	rts_cookie_command_write(s, OUTChannelCookie); /* OUTChannelCookie (20 bytes) */
	rts_receive_window_size_command_write(s, ReceiveWindowSize); /* ReceiveWindowSize (8 bytes) */
	stream_seal(s);

	rpc_out_write(rpc, s->data, s->size);

	stream_free(s);

	return TRUE;
}
コード例 #3
0
ファイル: ncacn_http.c プロジェクト: vworkspace/FreeRDP
int rpc_http_send_replacement_out_channel_request(rdpRpc* rpc)
{
	int status;
	wStream* s;

	s = rpc_ntlm_http_request(rpc, NULL, 120, TSG_CHANNEL_OUT);

	if (!s)
		return -1;

	WLog_DBG(TAG, "\n%s", Stream_Buffer(s));

	status = rpc_out_write(rpc, Stream_Buffer(s), Stream_Length(s));

	Stream_Free(s, TRUE);

	return (status > 0) ? 1 : -1;
}
コード例 #4
0
ファイル: ncacn_http.c プロジェクト: orosam/FreeRDP
int rpc_ncacn_http_send_out_channel_request(rdpRpc* rpc)
{
	wStream* s;
	int content_length;
	BOOL continue_needed;
	rdpNtlm* ntlm = rpc->NtlmHttpOut->ntlm;

	continue_needed = ntlm_authenticate(ntlm);

	content_length = (continue_needed) ? 0 : 76;

	s = rpc_ntlm_http_request(rpc, &ntlm->outputBuffer[0], content_length, TSG_CHANNEL_OUT);

	WLog_DBG(TAG, "\n%s", Stream_Buffer(s));
	rpc_out_write(rpc, Stream_Buffer(s), Stream_Length(s));
	Stream_Free(s, TRUE);

	return 0;
}
コード例 #5
0
ファイル: ncacn_http.c プロジェクト: d0rian/FreeRDP
int rpc_ncacn_http_send_out_channel_request(rdpRpc* rpc)
{
	STREAM* s;
	int content_length;
	BOOL continue_needed;
	rdpNtlm* ntlm = rpc->NtlmHttpOut->ntlm;

	continue_needed = ntlm_authenticate(ntlm);

	content_length = (continue_needed) ? 0 : 76;

	s = rpc_ntlm_http_request(rpc, &ntlm->outputBuffer, content_length, TSG_CHANNEL_OUT);

	DEBUG_RPC("\n%s", s->data);
	rpc_out_write(rpc, s->data, s->size);
	stream_free(s);

	return 0;
}
コード例 #6
0
ファイル: rts.c プロジェクト: orosam/FreeRDP
int rts_send_OUT_R1_A3_pdu(rdpRpc* rpc)
{
	BYTE* buffer;
	rpcconn_rts_hdr_t header;
	UINT32 ReceiveWindowSize;
	BYTE* VirtualConnectionCookie;
	BYTE* PredecessorChannelCookie;
	BYTE* SuccessorChannelCookie;

	rts_pdu_header_init(&header);
	header.frag_length = 96;
	header.Flags = RTS_FLAG_RECYCLE_CHANNEL;
	header.NumberOfCommands = 5;

	WLog_DBG(TAG, "Sending OUT R1/A3 RTS PDU");

	rts_generate_cookie((BYTE*) &(rpc->VirtualConnection->NonDefaultOutChannelCookie));

	VirtualConnectionCookie = (BYTE*) &(rpc->VirtualConnection->Cookie);
	PredecessorChannelCookie = (BYTE*) &(rpc->VirtualConnection->DefaultOutChannelCookie);
	SuccessorChannelCookie = (BYTE*) &(rpc->VirtualConnection->NonDefaultOutChannelCookie);
	ReceiveWindowSize = rpc->VirtualConnection->DefaultOutChannel->ReceiveWindow;

	buffer = (BYTE*) malloc(header.frag_length);

	if (!buffer)
		return -1;

	CopyMemory(buffer, ((BYTE*) &header), 20); /* RTS Header (20 bytes) */
	rts_version_command_write(&buffer[20]); /* Version (8 bytes) */
	rts_cookie_command_write(&buffer[28], VirtualConnectionCookie); /* VirtualConnectionCookie (20 bytes) */
	rts_cookie_command_write(&buffer[48], PredecessorChannelCookie); /* PredecessorChannelCookie (20 bytes) */
	rts_cookie_command_write(&buffer[68], SuccessorChannelCookie); /* SuccessorChannelCookie (20 bytes) */
	rts_receive_window_size_command_write(&buffer[88], ReceiveWindowSize); /* ReceiveWindowSize (8 bytes) */

	rpc_out_write(rpc, buffer, header.frag_length);

	free(buffer);

	return 0;
}
コード例 #7
0
ファイル: rts.c プロジェクト: orosam/FreeRDP
int rts_send_CONN_A1_pdu(rdpRpc* rpc)
{
	BYTE* buffer;
	rpcconn_rts_hdr_t header;
	UINT32 ReceiveWindowSize;
	BYTE* OUTChannelCookie;
	BYTE* VirtualConnectionCookie;

	rts_pdu_header_init(&header);
	header.frag_length = 76;
	header.Flags = RTS_FLAG_NONE;
	header.NumberOfCommands = 4;

	WLog_DBG(TAG, "Sending CONN_A1 RTS PDU");

	rts_generate_cookie((BYTE*) &(rpc->VirtualConnection->Cookie));
	rts_generate_cookie((BYTE*) &(rpc->VirtualConnection->DefaultOutChannelCookie));

	VirtualConnectionCookie = (BYTE*) &(rpc->VirtualConnection->Cookie);
	OUTChannelCookie = (BYTE*) &(rpc->VirtualConnection->DefaultOutChannelCookie);
	ReceiveWindowSize = rpc->VirtualConnection->DefaultOutChannel->ReceiveWindow;

	buffer = (BYTE*) malloc(header.frag_length);
	if (!buffer)
		return -1;

	CopyMemory(buffer, ((BYTE*) &header), 20); /* RTS Header (20 bytes) */
	rts_version_command_write(&buffer[20]); /* Version (8 bytes) */
	rts_cookie_command_write(&buffer[28], VirtualConnectionCookie); /* VirtualConnectionCookie (20 bytes) */
	rts_cookie_command_write(&buffer[48], OUTChannelCookie); /* OUTChannelCookie (20 bytes) */
	rts_receive_window_size_command_write(&buffer[68], ReceiveWindowSize); /* ReceiveWindowSize (8 bytes) */

	rpc_out_write(rpc, buffer, header.frag_length);

	free(buffer);

	return 0;
}
コード例 #8
0
ファイル: ncacn_http.c プロジェクト: vworkspace/FreeRDP
int rpc_ncacn_http_send_out_channel_request(rdpRpc* rpc)
{
	wStream* s;
	int status;
	int contentLength;
	BOOL continueNeeded;
	rdpNtlm* ntlm = rpc->NtlmHttpOut->ntlm;

	continueNeeded = ntlm_authenticate(ntlm);

	contentLength = (continueNeeded) ? 0 : 76;

	s = rpc_ntlm_http_request(rpc, &ntlm->outputBuffer[0], contentLength, TSG_CHANNEL_OUT);

	if (!s)
		return -1;

	status = rpc_out_write(rpc, Stream_Buffer(s), Stream_Length(s));

	Stream_Free(s, TRUE);

	return (status > 0) ? 1 : -1;
}