blob: ee6e9a720b285f03ca1be1a70fd59ff8fd9c50e7 [file] [log] [blame]
Don Newton379ae252019-04-01 12:17:06 -04001//+build gssapi,windows
2
3#ifndef SSPI_WRAPPER_H
4#define SSPI_WRAPPER_H
5
6#define SECURITY_WIN32 1 /* Required for SSPI */
7
8#include <windows.h>
9#include <sspi.h>
10
11#define SSPI_OK 0
12#define SSPI_CONTINUE 1
13#define SSPI_ERROR 2
14
15typedef struct {
16 CredHandle cred;
17 CtxtHandle ctx;
18
19 int has_ctx;
20
21 SECURITY_STATUS status;
22} sspi_client_state;
23
24int sspi_init();
25
26int sspi_client_init(
27 sspi_client_state *client,
28 char* username,
29 char* password
30);
31
32int sspi_client_username(
33 sspi_client_state *client,
34 char** username
35);
36
37int sspi_client_negotiate(
38 sspi_client_state *client,
39 char* spn,
40 PVOID input,
41 ULONG input_length,
42 PVOID* output,
43 ULONG* output_length
44);
45
46int sspi_client_wrap_msg(
47 sspi_client_state *client,
48 PVOID input,
49 ULONG input_length,
50 PVOID* output,
51 ULONG* output_length
52);
53
54int sspi_client_destroy(
55 sspi_client_state *client
56);
57
58#endif