From f5c4671bfbad96bf346bd7e9a21fc4317b4959df Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 3 Dec 2022 17:00:20 +0530 Subject: Adds most of the tools --- v_windows/v/thirdparty/vschannel/vschannel.h | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 v_windows/v/thirdparty/vschannel/vschannel.h (limited to 'v_windows/v/thirdparty/vschannel/vschannel.h') diff --git a/v_windows/v/thirdparty/vschannel/vschannel.h b/v_windows/v/thirdparty/vschannel/vschannel.h new file mode 100644 index 0000000..0338645 --- /dev/null +++ b/v_windows/v/thirdparty/vschannel/vschannel.h @@ -0,0 +1,47 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#define SECURITY_WIN32 +#include +#include + +#define vsc_init_resp_buff_size 44000 + +#define IO_BUFFER_SIZE 0x10000 + +#define TLS_MAX_BUFSIZ 32768 + +// Define here to be sure +#define SP_PROT_TLS1_2_CLIENT 0x00000800 + +typedef struct TlsContext TlsContext; + +TlsContext new_tls_context(); + +static void vschannel_init(TlsContext *tls_ctx); + +static void vschannel_cleanup(TlsContext *tls_ctx); + +static INT request(TlsContext *tls_ctx, INT iport, LPWSTR host, CHAR *req, CHAR **out); + +static SECURITY_STATUS https_make_request(TlsContext *tls_ctx, CHAR *req, CHAR **out, int *length); + +static INT connect_to_server(TlsContext *tls_ctx, LPWSTR host, INT port_number); + +static LONG disconnect_from_server(TlsContext *tls_ctx); + +static SECURITY_STATUS perform_client_handshake(TlsContext *tls_ctx, LPWSTR host, SecBuffer *pExtraData); + +static SECURITY_STATUS client_handshake_loop(TlsContext *tls_ctx, BOOL fDoInitialRead, SecBuffer *pExtraData); + +static DWORD verify_server_certificate(PCCERT_CONTEXT pServerCert, LPWSTR host, DWORD dwCertFlags); + +static SECURITY_STATUS create_credentials(TlsContext *tls_ctx); + +static void get_new_client_credentials(TlsContext *tls_ctx); -- cgit v1.2.3