FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
nla.h
1
20#ifndef FREERDP_LIB_CORE_NLA_H
21#define FREERDP_LIB_CORE_NLA_H
22
23typedef struct rdp_nla rdpNla;
24
25#include <freerdp/api.h>
26#include <freerdp/freerdp.h>
27
28#include <winpr/sspi.h>
29#include <winpr/stream.h>
30#include <winpr/crypto.h>
31
32#include <freerdp/crypto/ber.h>
33#include <freerdp/crypto/der.h>
34#include <freerdp/crypto/crypto.h>
35
36#include "transport.h"
37
38typedef enum
39{
40 NLA_STATE_INITIAL,
41 NLA_STATE_NEGO_TOKEN,
42 NLA_STATE_PUB_KEY_AUTH,
43 NLA_STATE_EARLY_USER_AUTH,
44 NLA_STATE_AUTH_INFO,
45 NLA_STATE_POST_NEGO,
46 NLA_STATE_FINAL
47} NLA_STATE;
48
49FREERDP_LOCAL int nla_authenticate(rdpNla* nla);
50
51FREERDP_LOCAL int nla_client_begin(rdpNla* nla);
52FREERDP_LOCAL int nla_recv_pdu(rdpNla* nla, wStream* s);
53
54FREERDP_LOCAL SEC_WINNT_AUTH_IDENTITY* nla_get_identity(rdpNla* nla);
55
56FREERDP_LOCAL NLA_STATE nla_get_state(rdpNla* nla);
57FREERDP_LOCAL BOOL nla_set_state(rdpNla* nla, NLA_STATE state);
58FREERDP_LOCAL const char* nla_get_state_str(NLA_STATE state);
59
60FREERDP_LOCAL DWORD nla_get_error(rdpNla* nla);
61FREERDP_LOCAL INT32 nla_get_sspi_error(rdpNla* nla);
62
63FREERDP_LOCAL BOOL nla_set_service_principal(rdpNla* nla, const char* service,
64 const char* hostname);
65
66FREERDP_LOCAL BOOL nla_set_sspi_module(rdpNla* nla, const char* sspiModule);
67FREERDP_LOCAL BOOL nla_sspi_module_init(rdpNla* nla);
68
69FREERDP_LOCAL BOOL nla_impersonate(rdpNla* nla);
70FREERDP_LOCAL BOOL nla_revert_to_self(rdpNla* nla);
71
72FREERDP_LOCAL void nla_free(rdpNla* nla);
73
74WINPR_ATTR_MALLOC(nla_free, 1)
75FREERDP_LOCAL rdpNla* nla_new(rdpContext* context, rdpTransport* transport);
76
77FREERDP_LOCAL void nla_set_early_user_auth(rdpNla* nla, BOOL earlyUserAuth);
78FREERDP_LOCAL BOOL nla_encrypt(rdpNla* nla, const SecBuffer* inBuffer, SecBuffer* outBuffer);
79FREERDP_LOCAL BOOL nla_decrypt(rdpNla* nla, const SecBuffer* inBuffer, SecBuffer* outBuffer);
80FREERDP_LOCAL SECURITY_STATUS nla_QueryContextAttributes(rdpNla* nla, DWORD ulAttr, PVOID pBuffer);
81
82#endif /* FREERDP_LIB_CORE_NLA_H */