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>
27 #include "wine/list.h"
29 extern HINSTANCE hsecur32 DECLSPEC_HIDDEN
;
31 typedef struct _SecureProvider
37 SecurityFunctionTableA fnTableA
;
38 SecurityFunctionTableW fnTableW
;
41 typedef struct _SecurePackage
45 SecureProvider
*provider
;
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
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 SECUR32_initNegotiateSP(void) DECLSPEC_HIDDEN
;
76 void load_auth_packages(void) DECLSPEC_HIDDEN
;
78 /* Cleanup functions for built-in providers */
79 void SECUR32_deinitSchannelSP(void) DECLSPEC_HIDDEN
;
81 /* schannel internal interface */
82 typedef struct schan_session_opaque
*schan_session
;
84 typedef struct schan_credentials
88 DWORD enabled_protocols
;
91 struct schan_transport
;
97 const SecBufferDesc
*desc
;
98 int current_buffer_idx
;
99 BOOL allow_buffer_resize
;
100 int (*get_next_buffer
)(const struct schan_transport
*, struct schan_buffers
*);
103 struct schan_transport
105 struct schan_context
*ctx
;
106 struct schan_buffers in
;
107 struct schan_buffers out
;
110 struct schan_cert_list
118 BOOL (CDECL
*allocate_certificate_credentials
)(schan_credentials
*, const CERT_CONTEXT
*, const DATA_BLOB
*);
119 BOOL (CDECL
*create_session
)(schan_session
*, schan_credentials
*);
120 void (CDECL
*dispose_session
)(schan_session
);
121 void (CDECL
*free_certificate_credentials
)(schan_credentials
*);
122 SECURITY_STATUS (CDECL
*get_application_protocol
)(schan_session
, SecPkgContext_ApplicationProtocol
*);
123 SECURITY_STATUS (CDECL
*get_connection_info
)(schan_session
, SecPkgContext_ConnectionInfo
*);
124 DWORD (CDECL
*get_enabled_protocols
)(void);
125 ALG_ID (CDECL
*get_key_signature_algorithm
)(schan_session
);
126 unsigned int (CDECL
*get_max_message_size
)(schan_session
);
127 unsigned int (CDECL
*get_session_cipher_block_size
)(schan_session
);
128 SECURITY_STATUS (CDECL
*get_session_peer_certificate
)(schan_session
, struct schan_cert_list
*);
129 SECURITY_STATUS (CDECL
*get_unique_channel_binding
)(schan_session
, SecPkgContext_Bindings
*);
130 SECURITY_STATUS (CDECL
*handshake
)(schan_session session
);
131 SECURITY_STATUS (CDECL
*recv
)(schan_session
, void *, SIZE_T
*);
132 SECURITY_STATUS (CDECL
*send
)(schan_session
, const void *, SIZE_T
*);
133 void (CDECL
*set_application_protocols
)(schan_session
, unsigned char *, unsigned int);
134 SECURITY_STATUS (CDECL
*set_dtls_mtu
)(schan_session
, unsigned int);
135 void (CDECL
*set_session_target
)(schan_session
, const char *);
136 void (CDECL
*set_session_transport
)(schan_session
, struct schan_transport
*);
139 struct schan_callbacks
141 char * (CDECL
*get_buffer
)(const struct schan_transport
*, struct schan_buffers
*, SIZE_T
*);
142 schan_session (CDECL
*get_session_for_transport
)(struct schan_transport
*);
143 int CDECL (CDECL
*pull
)(struct schan_transport
*, void *, size_t *);
144 int CDECL (CDECL
*push
)(struct schan_transport
*, const void *, size_t *);
147 extern const struct schan_funcs
*schan_funcs
;
149 #endif /* __SECUR32_PRIV_H__ */