windows.storage.applicationdata: Implement IApplicationDataStatics::get_Current().
[wine.git] / dlls / secur32 / secur32_priv.h
blob0b410c9970cb31e90961a381cc81cb49f138e8b7
1 /*
2 * secur32 private definitions.
4 * Copyright (C) 2004 Juan Lang
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __SECUR32_PRIV_H__
22 #define __SECUR32_PRIV_H__
24 #include <sys/types.h>
25 #include <limits.h>
26 #include "schannel.h"
27 #include "ntsecapi.h"
28 #include "ntsecpkg.h"
29 #include "wine/list.h"
31 typedef struct _SecureProvider
33 struct list entry;
34 BOOL loaded;
35 PWSTR moduleName;
36 HMODULE lib;
37 SecurityFunctionTableA fnTableA;
38 SecurityFunctionTableW fnTableW;
39 } SecureProvider;
41 typedef struct _SecurePackage
43 struct list entry;
44 SecPkgInfoW infoW;
45 SecureProvider *provider;
46 } SecurePackage;
48 /* Allocates space for and initializes a new provider. If fnTableA or fnTableW
49 * is non-NULL, assumes the provider is built-in, and if moduleName is non-NULL,
50 * means must load the LSA/user mode functions tables from external SSP/AP module.
51 * Otherwise moduleName must not be NULL.
52 * Returns a pointer to the stored provider entry, for use adding packages.
54 SecureProvider *SECUR32_addProvider(const SecurityFunctionTableA *fnTableA,
55 const SecurityFunctionTableW *fnTableW, PCWSTR moduleName) DECLSPEC_HIDDEN;
57 /* Allocates space for and adds toAdd packages with the given provider.
58 * provider must not be NULL, and either infoA or infoW may be NULL, but not
59 * both.
61 void SECUR32_addPackages(SecureProvider *provider, ULONG toAdd,
62 const SecPkgInfoA *infoA, const SecPkgInfoW *infoW) DECLSPEC_HIDDEN;
64 /* Tries to find the package named packageName. If it finds it, implicitly
65 * loads the package if it isn't already loaded.
67 SecurePackage *SECUR32_findPackageW(PCWSTR packageName) DECLSPEC_HIDDEN;
69 /* Tries to find the package named packageName. (Thunks to _findPackageW)
71 SecurePackage *SECUR32_findPackageA(PCSTR packageName) DECLSPEC_HIDDEN;
73 /* Initialization functions for built-in providers */
74 void SECUR32_initSchannelSP(void) DECLSPEC_HIDDEN;
75 void load_auth_packages(void) DECLSPEC_HIDDEN;
76 NTSTATUS NTAPI nego_SpLsaModeInitialize(ULONG, PULONG, PSECPKG_FUNCTION_TABLE *, PULONG) DECLSPEC_HIDDEN;
77 NTSTATUS NTAPI nego_SpUserModeInitialize(ULONG, PULONG, PSECPKG_USER_FUNCTION_TABLE *, PULONG) DECLSPEC_HIDDEN;
78 SECPKG_FUNCTION_TABLE *lsa_find_package(const char *name, SECPKG_USER_FUNCTION_TABLE **user_api) DECLSPEC_HIDDEN;
80 /* Cleanup functions for built-in providers */
81 void SECUR32_deinitSchannelSP(void) DECLSPEC_HIDDEN;
83 /* schannel internal interface */
84 typedef UINT64 schan_session;
86 typedef struct schan_credentials
88 ULONG credential_use;
89 DWORD enabled_protocols;
90 UINT64 credentials;
91 } schan_credentials;
93 struct session_params
95 schan_session session;
98 struct allocate_certificate_credentials_params
100 schan_credentials *c;
101 ULONG cert_encoding;
102 ULONG cert_size;
103 BYTE *cert_blob;
104 ULONG key_size;
105 BYTE *key_blob;
108 struct create_session_params
110 schan_credentials *cred;
111 schan_session *session;
114 struct free_certificate_credentials_params
116 schan_credentials *c;
119 struct get_application_protocol_params
121 schan_session session;
122 SecPkgContext_ApplicationProtocol *protocol;
125 struct get_connection_info_params
127 schan_session session;
128 SecPkgContext_ConnectionInfo *info;
131 struct get_cipher_info_params
133 schan_session session;
134 SecPkgContext_CipherInfo *info;
137 struct get_session_peer_certificate_params
139 schan_session session;
140 BYTE *buffer; /* Starts with array of ULONG sizes, followed by contiguous data blob. */
141 ULONG *bufsize;
142 ULONG *retcount;
145 struct get_unique_channel_binding_params
147 schan_session session;
148 void *buffer;
149 ULONG *bufsize;
152 enum control_token
154 CONTROL_TOKEN_NONE,
155 CONTROL_TOKEN_SHUTDOWN,
156 CONTROL_TOKEN_ALERT,
159 struct handshake_params
161 schan_session session;
162 SecBufferDesc *input;
163 ULONG input_size;
164 SecBufferDesc *output;
165 ULONG *input_offset;
166 int *output_buffer_idx;
167 ULONG *output_offset;
168 enum control_token control_token;
169 unsigned int alert_type;
170 unsigned int alert_number;
173 struct recv_params
175 schan_session session;
176 SecBufferDesc *input;
177 ULONG input_size;
178 void *buffer;
179 ULONG *length;
182 struct send_params
184 schan_session session;
185 SecBufferDesc *output;
186 const void *buffer;
187 ULONG length;
188 int *output_buffer_idx;
189 ULONG *output_offset;
192 struct set_application_protocols_params
194 schan_session session;
195 unsigned char *buffer;
196 unsigned int buflen;
199 struct set_dtls_mtu_params
201 schan_session session;
202 unsigned int mtu;
205 struct set_session_target_params
207 schan_session session;
208 const char *target;
211 struct set_dtls_timeouts_params
213 schan_session session;
214 unsigned int retrans_timeout;
215 unsigned int total_timeout;
218 enum schan_funcs
220 unix_process_attach,
221 unix_process_detach,
222 unix_allocate_certificate_credentials,
223 unix_create_session,
224 unix_dispose_session,
225 unix_free_certificate_credentials,
226 unix_get_application_protocol,
227 unix_get_cipher_info,
228 unix_get_connection_info,
229 unix_get_enabled_protocols,
230 unix_get_key_signature_algorithm,
231 unix_get_max_message_size,
232 unix_get_session_cipher_block_size,
233 unix_get_session_peer_certificate,
234 unix_get_unique_channel_binding,
235 unix_handshake,
236 unix_recv,
237 unix_send,
238 unix_set_application_protocols,
239 unix_set_dtls_mtu,
240 unix_set_session_target,
241 unix_set_dtls_timeouts,
244 #endif /* __SECUR32_PRIV_H__ */