FreeRDP
wst.c File Reference
#include <freerdp/config.h>
#include <freerdp/version.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 "../settings.h"
#include <freerdp/log.h>
#include <freerdp/error.h>
#include <freerdp/utils/ringbuffer.h>
#include <freerdp/utils/smartcardlogon.h>
#include "wst.h"
#include "websocket.h"
#include "http.h"
#include "../credssp_auth.h"
#include "../proxy.h"
#include "../rdp.h"
#include "../../crypto/opensslcompat.h"
#include "rpc_fault.h"
#include "../utils.h"

Macros

#define TAG   FREERDP_TAG("core.gateway.wst")
 
#define AUTH_PKG   NEGO_SSP_NAME
 

Functions

static BOOL wst_get_gateway_credentials (rdpContext *context, rdp_auth_reason reason)
 
static BOOL wst_auth_init (rdpWst *wst, rdpTls *tls, TCHAR *authPkg)
 
static BOOL wst_set_auth_header (rdpCredsspAuth *auth, HttpRequest *request)
 
static BOOL wst_recv_auth_token (rdpCredsspAuth *auth, HttpResponse *response)
 
static BOOL wst_tls_connect (rdpWst *wst, rdpTls *tls, int timeout)
 
static wStreamwst_build_http_request (rdpWst *wst)
 
static BOOL wst_send_http_request (rdpWst *wst, rdpTls *tls)
 
static BOOL wst_handle_ok_or_forbidden (rdpWst *wst, HttpResponse **ppresponse, DWORD timeout, long *pStatusCode)
 
static BOOL wst_handle_denied (rdpWst *wst, HttpResponse **ppresponse, long *pStatusCode)
 
BOOL wst_connect (rdpWst *wst, DWORD timeout)
 
DWORD wst_get_event_handles (rdpWst *wst, HANDLE *events, DWORD count)
 
static int wst_bio_write (BIO *bio, const char *buf, int num)
 
static int wst_bio_read (BIO *bio, char *buf, int size)
 
static int wst_bio_puts (BIO *bio, const char *str)
 
static int wst_bio_gets (BIO *bio, char *str, int size)
 
static long wst_bio_ctrl (BIO *bio, int cmd, long arg1, void *arg2)
 
static int wst_bio_new (BIO *bio)
 
static int wst_bio_free (BIO *bio)
 
static BIO_METHOD * BIO_s_wst (void)
 
static BOOL wst_parse_url (rdpWst *wst, const char *url)
 
rdpWst * wst_new (rdpContext *context)
 
void wst_free (rdpWst *wst)
 
BIO * wst_get_front_bio_and_take_ownership (rdpWst *wst)
 

Variables

static const char arm_query_param [] = "%s%cClmTk=Bearer%%20%s&X-MS-User-Agent=FreeRDP%%2F3.0"
 

Macro Definition Documentation

◆ AUTH_PKG

#define AUTH_PKG   NEGO_SSP_NAME

◆ TAG

#define TAG   FREERDP_TAG("core.gateway.wst")

FreeRDP: A Remote Desktop Protocol Implementation Websocket Transport

Copyright 2023 Michael Saxl mike@.nosp@m.mwsy.nosp@m.s.min.nosp@m.e.bz

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.

Function Documentation

◆ BIO_s_wst()

static BIO_METHOD* BIO_s_wst ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_auth_init()

static BOOL wst_auth_init ( rdpWst *  wst,
rdpTls *  tls,
TCHAR authPkg 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_bio_ctrl()

static long wst_bio_ctrl ( BIO *  bio,
int  cmd,
long  arg1,
void *  arg2 
)
static
Here is the caller graph for this function:

◆ wst_bio_free()

static int wst_bio_free ( BIO *  bio)
static
Here is the caller graph for this function:

◆ wst_bio_gets()

static int wst_bio_gets ( BIO *  bio,
char *  str,
int  size 
)
static
Here is the caller graph for this function:

◆ wst_bio_new()

static int wst_bio_new ( BIO *  bio)
static
Here is the caller graph for this function:

◆ wst_bio_puts()

static int wst_bio_puts ( BIO *  bio,
const char *  str 
)
static
Here is the caller graph for this function:

◆ wst_bio_read()

static int wst_bio_read ( BIO *  bio,
char *  buf,
int  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_bio_write()

static int wst_bio_write ( BIO *  bio,
const char *  buf,
int  num 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_build_http_request()

static wStream* wst_build_http_request ( rdpWst *  wst)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_connect()

BOOL wst_connect ( rdpWst *  wst,
DWORD  timeout 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_free()

void wst_free ( rdpWst *  wst)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_get_event_handles()

DWORD wst_get_event_handles ( rdpWst *  wst,
HANDLE *  events,
DWORD  count 
)
Here is the caller graph for this function:

◆ wst_get_front_bio_and_take_ownership()

BIO* wst_get_front_bio_and_take_ownership ( rdpWst *  wst)
Here is the caller graph for this function:

◆ wst_get_gateway_credentials()

static BOOL wst_get_gateway_credentials ( rdpContext *  context,
rdp_auth_reason  reason 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_handle_denied()

static BOOL wst_handle_denied ( rdpWst *  wst,
HttpResponse **  ppresponse,
long *  pStatusCode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_handle_ok_or_forbidden()

static BOOL wst_handle_ok_or_forbidden ( rdpWst *  wst,
HttpResponse **  ppresponse,
DWORD  timeout,
long *  pStatusCode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_new()

rdpWst* wst_new ( rdpContext *  context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_parse_url()

static BOOL wst_parse_url ( rdpWst *  wst,
const char *  url 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_recv_auth_token()

static BOOL wst_recv_auth_token ( rdpCredsspAuth *  auth,
HttpResponse *  response 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_send_http_request()

static BOOL wst_send_http_request ( rdpWst *  wst,
rdpTls *  tls 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_set_auth_header()

static BOOL wst_set_auth_header ( rdpCredsspAuth *  auth,
HttpRequest *  request 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wst_tls_connect()

static BOOL wst_tls_connect ( rdpWst *  wst,
rdpTls *  tls,
int  timeout 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ arm_query_param

const char arm_query_param[] = "%s%cClmTk=Bearer%%20%s&X-MS-User-Agent=FreeRDP%%2F3.0"
static