rpcrt4: Avoid casting an object to IUnknown.
[wine.git] / dlls / secur32 / secur32_priv.h
blob258454560fec2f8c0814e35edfc81d2474d414ee
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 "wine/list.h"
29 typedef struct _SecureProvider
31 struct list entry;
32 BOOL loaded;
33 PWSTR moduleName;
34 HMODULE lib;
35 SecurityFunctionTableA fnTableA;
36 SecurityFunctionTableW fnTableW;
37 } SecureProvider;
39 typedef struct _SecurePackage
41 struct list entry;
42 SecPkgInfoW infoW;
43 SecureProvider *provider;
44 } SecurePackage;
46 /* Allocates space for and initializes a new provider. If fnTableA or fnTableW
47 * is non-NULL, assumes the provider is built-in, and if moduleName is non-NULL,
48 * means must load the LSA/user mode functions tables from external SSP/AP module.
49 * Otherwise moduleName must not be NULL.
50 * Returns a pointer to the stored provider entry, for use adding packages.
52 SecureProvider *SECUR32_addProvider(const SecurityFunctionTableA *fnTableA,
53 const SecurityFunctionTableW *fnTableW, PCWSTR moduleName) DECLSPEC_HIDDEN;
55 /* Allocates space for and adds toAdd packages with the given provider.
56 * provider must not be NULL, and either infoA or infoW may be NULL, but not
57 * both.
59 void SECUR32_addPackages(SecureProvider *provider, ULONG toAdd,
60 const SecPkgInfoA *infoA, const SecPkgInfoW *infoW) DECLSPEC_HIDDEN;
62 /* Tries to find the package named packageName. If it finds it, implicitly
63 * loads the package if it isn't already loaded.
65 SecurePackage *SECUR32_findPackageW(PCWSTR packageName) DECLSPEC_HIDDEN;
67 /* Tries to find the package named packageName. (Thunks to _findPackageW)
69 SecurePackage *SECUR32_findPackageA(PCSTR packageName) DECLSPEC_HIDDEN;
71 /* Initialization functions for built-in providers */
72 void SECUR32_initSchannelSP(void) DECLSPEC_HIDDEN;
73 void SECUR32_initNegotiateSP(void) DECLSPEC_HIDDEN;
74 void load_auth_packages(void) DECLSPEC_HIDDEN;
76 /* Cleanup functions for built-in providers */
77 void SECUR32_deinitSchannelSP(void) DECLSPEC_HIDDEN;
79 /* schannel internal interface */
80 typedef UINT64 schan_session;
82 typedef struct schan_credentials
84 ULONG credential_use;
85 DWORD enabled_protocols;
86 UINT64 credentials;
87 } schan_credentials;
89 struct session_params
91 schan_session session;
94 struct allocate_certificate_credentials_params
96 schan_credentials *c;
97 ULONG cert_encoding;
98 ULONG cert_size;
99 BYTE *cert_blob;
100 ULONG key_size;
101 BYTE *key_blob;
104 struct create_session_params
106 schan_credentials *cred;
107 schan_session *session;
110 struct free_certificate_credentials_params
112 schan_credentials *c;
115 struct get_application_protocol_params
117 schan_session session;
118 SecPkgContext_ApplicationProtocol *protocol;
121 struct get_connection_info_params
123 schan_session session;
124 SecPkgContext_ConnectionInfo *info;
127 struct get_cipher_info_params
129 schan_session session;
130 SecPkgContext_CipherInfo *info;
133 struct get_session_peer_certificate_params
135 schan_session session;
136 BYTE *buffer; /* Starts with array of ULONG sizes, followed by contiguous data blob. */
137 ULONG *bufsize;
138 ULONG *retcount;
141 struct get_unique_channel_binding_params
143 schan_session session;
144 void *buffer;
145 ULONG *bufsize;
148 enum control_token
150 control_token_none,
151 control_token_shutdown,
154 struct handshake_params
156 schan_session session;
157 SecBufferDesc *input;
158 ULONG input_size;
159 SecBufferDesc *output;
160 ULONG *input_offset;
161 int *output_buffer_idx;
162 ULONG *output_offset;
163 enum control_token control_token;
166 struct recv_params
168 schan_session session;
169 SecBufferDesc *input;
170 ULONG input_size;
171 void *buffer;
172 ULONG *length;
175 struct send_params
177 schan_session session;
178 SecBufferDesc *output;
179 const void *buffer;
180 ULONG length;
181 int *output_buffer_idx;
182 ULONG *output_offset;
185 struct set_application_protocols_params
187 schan_session session;
188 unsigned char *buffer;
189 unsigned int buflen;
192 struct set_dtls_mtu_params
194 schan_session session;
195 unsigned int mtu;
198 struct set_session_target_params
200 schan_session session;
201 const char *target;
204 struct set_dtls_timeouts_params
206 schan_session session;
207 unsigned int retrans_timeout;
208 unsigned int total_timeout;
211 enum schan_funcs
213 unix_process_attach,
214 unix_process_detach,
215 unix_allocate_certificate_credentials,
216 unix_create_session,
217 unix_dispose_session,
218 unix_free_certificate_credentials,
219 unix_get_application_protocol,
220 unix_get_cipher_info,
221 unix_get_connection_info,
222 unix_get_enabled_protocols,
223 unix_get_key_signature_algorithm,
224 unix_get_max_message_size,
225 unix_get_session_cipher_block_size,
226 unix_get_session_peer_certificate,
227 unix_get_unique_channel_binding,
228 unix_handshake,
229 unix_recv,
230 unix_send,
231 unix_set_application_protocols,
232 unix_set_dtls_mtu,
233 unix_set_session_target,
234 unix_set_dtls_timeouts,
237 #endif /* __SECUR32_PRIV_H__ */