FreeRDP
|
#include <freerdp/config.h>
#include "../settings.h"
#include <winpr/assert.h>
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/print.h>
#include <winpr/stream.h>
#include <winpr/winsock.h>
#include <winpr/cred.h>
#include <freerdp/log.h>
#include <freerdp/error.h>
#include <freerdp/utils/ringbuffer.h>
#include <freerdp/utils/smartcardlogon.h>
#include "rdg.h"
#include "websocket.h"
#include "../credssp_auth.h"
#include "../proxy.h"
#include "../rdp.h"
#include "../../crypto/opensslcompat.h"
#include "rpc_fault.h"
#include "../utils.h"
Functions | |
static const char * | flags_to_string (UINT32 flags, const t_flag_mapping *map, size_t elements) |
static const char * | channel_response_fields_present_to_string (UINT16 fieldsPresent) |
static const char * | tunnel_response_fields_present_to_string (UINT16 fieldsPresent) |
static const char * | tunnel_authorization_response_fields_present_to_string (UINT16 fieldsPresent) |
static const char * | extended_auth_to_string (UINT16 auth) |
static const char * | capabilities_enum_to_string (UINT32 capabilities) |
static BOOL | rdg_read_http_unicode_string (wLog *log, wStream *s, const WCHAR **string, UINT16 *lengthInBytes) |
static BOOL | rdg_write_chunked (BIO *bio, wStream *sPacket) |
static BOOL | rdg_write_packet (rdpRdg *rdg, wStream *sPacket) |
static int | rdg_socket_read (BIO *bio, BYTE *pBuffer, size_t size, rdg_http_encoding_context *encodingContext) |
static BOOL | rdg_shall_abort (rdpRdg *rdg) |
static BOOL | rdg_read_all (rdpContext *context, rdpTls *tls, BYTE *buffer, size_t size, rdg_http_encoding_context *transferEncoding) |
static wStream * | rdg_receive_packet (rdpRdg *rdg) |
static BOOL | rdg_send_handshake (rdpRdg *rdg) |
static BOOL | rdg_send_extauth_sspi (rdpRdg *rdg) |
static BOOL | rdg_send_tunnel_request (rdpRdg *rdg) |
static BOOL | rdg_send_tunnel_authorization (rdpRdg *rdg) |
static BOOL | rdg_send_channel_create (rdpRdg *rdg) |
static BOOL | rdg_set_auth_header (rdpCredsspAuth *auth, HttpRequest *request) |
static wStream * | rdg_build_http_request (rdpRdg *rdg, const char *method, TRANSFER_ENCODING transferEncoding) |
static BOOL | rdg_recv_auth_token (wLog *log, rdpCredsspAuth *auth, HttpResponse *response) |
static BOOL | rdg_skip_seed_payload (rdpContext *context, rdpTls *tls, size_t lastResponseLength, rdg_http_encoding_context *transferEncoding) |
static BOOL | rdg_process_handshake_response (rdpRdg *rdg, wStream *s) |
static BOOL | rdg_process_tunnel_response_optional (rdpRdg *rdg, wStream *s, UINT16 fieldsPresent) |
static BOOL | rdg_process_tunnel_response (rdpRdg *rdg, wStream *s) |
static BOOL | rdg_process_tunnel_authorization_response (rdpRdg *rdg, wStream *s) |
static BOOL | rdg_process_extauth_sspi (rdpRdg *rdg, wStream *s) |
static BOOL | rdg_process_channel_response (rdpRdg *rdg, wStream *s) |
static BOOL | rdg_process_packet (rdpRdg *rdg, wStream *s) |
DWORD | rdg_get_event_handles (rdpRdg *rdg, HANDLE *events, DWORD count) |
static BOOL | rdg_get_gateway_credentials (rdpContext *context, rdp_auth_reason reason) |
static BOOL | rdg_auth_init (rdpRdg *rdg, rdpTls *tls, TCHAR *authPkg) |
static BOOL | rdg_send_http_request (rdpRdg *rdg, rdpTls *tls, const char *method, TRANSFER_ENCODING transferEncoding) |
static BOOL | rdg_tls_connect (rdpRdg *rdg, rdpTls *tls, const char *peerAddress, int timeout) |
static BOOL | rdg_establish_data_connection (rdpRdg *rdg, rdpTls *tls, const char *method, const char *peerAddress, int timeout, BOOL *rpcFallback) |
static BOOL | rdg_tunnel_connect (rdpRdg *rdg) |
BOOL | rdg_connect (rdpRdg *rdg, DWORD timeout, BOOL *rpcFallback) |
static int | rdg_write_websocket_data_packet (rdpRdg *rdg, const BYTE *buf, int isize) |
static int | rdg_write_chunked_data_packet (rdpRdg *rdg, const BYTE *buf, int isize) |
static int | rdg_write_data_packet (rdpRdg *rdg, const BYTE *buf, int isize) |
static BOOL | rdg_process_close_packet (rdpRdg *rdg, wStream *s) |
static BOOL | rdg_process_keep_alive_packet (rdpRdg *rdg) |
static BOOL | rdg_process_service_message (rdpRdg *rdg, wStream *s) |
static BOOL | rdg_process_unknown_packet (rdpRdg *rdg, int type) |
static BOOL | rdg_process_control_packet (rdpRdg *rdg, int type, size_t packetLength) |
static int | rdg_read_data_packet (rdpRdg *rdg, BYTE *buffer, int size) |
static int | rdg_bio_write (BIO *bio, const char *buf, int num) |
static int | rdg_bio_read (BIO *bio, char *buf, int size) |
static int | rdg_bio_puts (BIO *bio, const char *str) |
static int | rdg_bio_gets (BIO *bio, char *str, int size) |
static long | rdg_bio_ctrl (BIO *in_bio, int cmd, long arg1, void *arg2) |
static int | rdg_bio_new (BIO *bio) |
static int | rdg_bio_free (BIO *bio) |
static BIO_METHOD * | BIO_s_rdg (void) |
rdpRdg * | rdg_new (rdpContext *context) |
void | rdg_free (rdpRdg *rdg) |
BIO * | rdg_get_front_bio_and_take_ownership (rdpRdg *rdg) |
Variables | |
static const t_flag_mapping | tunnel_response_fields_present [] |
static const t_flag_mapping | channel_response_fields_present [] |
static const t_flag_mapping | tunnel_authorization_response_fields_present [] |
static const t_flag_mapping | extended_auth [] |
static const t_flag_mapping | capabilities_enum [] |
#define AUTH_PKG NEGO_SSP_NAME |
#define HTTP_CAPABILITY_IDLE_TIMEOUT 0x2 |
#define HTTP_CAPABILITY_MESSAGING_CONSENT_SIGN 0x4 |
#define HTTP_CAPABILITY_MESSAGING_SERVICE_MSG 0x8 |
#define HTTP_CAPABILITY_REAUTH 0x10 |
#define HTTP_CAPABILITY_TYPE_QUAR_SOH 0x1 |
#define HTTP_CAPABILITY_UDP_TRANSPORT 0x20 |
#define HTTP_CHANNEL_RESPONSE_FIELD_CHANNELID 0x1 |
#define HTTP_CHANNEL_RESPONSE_FIELD_UDPPORT 0x4 |
#define HTTP_CHANNEL_RESPONSE_OPTIONAL 0x2 |
#define HTTP_EXTENDED_AUTH_BEARER 0x08 /* HTTP Bearer authentication. */ |
#define HTTP_EXTENDED_AUTH_NONE 0x0 |
#define HTTP_EXTENDED_AUTH_PAA 0x02 /* Pluggable authentication. */ |
#define HTTP_EXTENDED_AUTH_SC 0x1 /* Smart card authentication. */ |
#define HTTP_EXTENDED_AUTH_SSPI_NTLM 0x04 /* NTLM extended authentication. */ |
#define HTTP_TUNNEL_AUTH_FIELD_SOH 0x1 |
#define HTTP_TUNNEL_AUTH_RESPONSE_FIELD_IDLE_TIMEOUT 0x2 |
#define HTTP_TUNNEL_AUTH_RESPONSE_FIELD_REDIR_FLAGS 0x1 |
#define HTTP_TUNNEL_AUTH_RESPONSE_FIELD_SOH_RESPONSE 0x4 |
#define HTTP_TUNNEL_PACKET_FIELD_PAA_COOKIE 0x1 |
#define HTTP_TUNNEL_PACKET_FIELD_REAUTH 0x2 |
#define HTTP_TUNNEL_RESPONSE_FIELD_CAPS 0x2 |
#define HTTP_TUNNEL_RESPONSE_FIELD_CONSENT_MSG 0x10 |
#define HTTP_TUNNEL_RESPONSE_FIELD_SOH_REQ 0x4 |
#define HTTP_TUNNEL_RESPONSE_FIELD_TUNNEL_ID 0x1 |
#define PKT_TYPE_CHANNEL_CREATE 0x8 |
#define PKT_TYPE_CHANNEL_RESPONSE 0x9 |
#define PKT_TYPE_CLOSE_CHANNEL 0x10 |
#define PKT_TYPE_CLOSE_CHANNEL_RESPONSE 0x11 |
#define PKT_TYPE_DATA 0xA |
#define PKT_TYPE_EXTENDED_AUTH_MSG 0x3 |
#define PKT_TYPE_HANDSHAKE_REQUEST 0x1 |
#define PKT_TYPE_HANDSHAKE_RESPONSE 0x2 |
#define PKT_TYPE_KEEPALIVE 0xD |
#define PKT_TYPE_REAUTH_MESSAGE 0xC |
#define PKT_TYPE_SERVICE_MESSAGE 0xB |
#define PKT_TYPE_TUNNEL_AUTH 0x6 |
#define PKT_TYPE_TUNNEL_AUTH_RESPONSE 0x7 |
#define PKT_TYPE_TUNNEL_CREATE 0x4 |
#define PKT_TYPE_TUNNEL_RESPONSE 0x5 |
#define TAG FREERDP_TAG("core.gateway.rdg") |
FreeRDP: A Remote Desktop Protocol Implementation Remote Desktop Gateway (RDG)
Copyright 2015 Denis Vincent dvinc ent@ devol utio ns.ne t
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
anonymous enum |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
BOOL rdg_connect | ( | rdpRdg * | rdg, |
DWORD | timeout, | ||
BOOL * | rpcFallback | ||
) |
|
static |
void rdg_free | ( | rdpRdg * | rdg | ) |
DWORD rdg_get_event_handles | ( | rdpRdg * | rdg, |
HANDLE * | events, | ||
DWORD | count | ||
) |
BIO* rdg_get_front_bio_and_take_ownership | ( | rdpRdg * | rdg | ) |
|
static |
rdpRdg* rdg_new | ( | rdpContext * | context | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |