2004-03-02 05:57:35 +01:00
|
|
|
/*
|
|
|
|
* secur32 private definitions.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004 Juan Lang
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-03-02 05:57:35 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SECUR32_PRIV_H__
|
|
|
|
#define __SECUR32_PRIV_H__
|
|
|
|
|
2005-10-30 20:06:24 +01:00
|
|
|
#include <sys/types.h>
|
2011-03-14 00:58:40 +01:00
|
|
|
#include <limits.h>
|
|
|
|
#include "schannel.h"
|
2021-05-07 11:54:44 +02:00
|
|
|
#include "wine/list.h"
|
2005-08-30 10:55:20 +02:00
|
|
|
|
2021-05-07 11:54:41 +02:00
|
|
|
extern HINSTANCE hsecur32 DECLSPEC_HIDDEN;
|
|
|
|
|
2004-03-02 05:57:35 +01:00
|
|
|
typedef struct _SecureProvider
|
|
|
|
{
|
2005-08-30 10:55:20 +02:00
|
|
|
struct list entry;
|
2005-05-13 19:44:47 +02:00
|
|
|
BOOL loaded;
|
2004-03-02 05:57:35 +01:00
|
|
|
PWSTR moduleName;
|
|
|
|
HMODULE lib;
|
|
|
|
SecurityFunctionTableA fnTableA;
|
|
|
|
SecurityFunctionTableW fnTableW;
|
|
|
|
} SecureProvider;
|
|
|
|
|
|
|
|
typedef struct _SecurePackage
|
|
|
|
{
|
2005-08-30 10:55:20 +02:00
|
|
|
struct list entry;
|
2004-03-02 05:57:35 +01:00
|
|
|
SecPkgInfoW infoW;
|
|
|
|
SecureProvider *provider;
|
|
|
|
} SecurePackage;
|
|
|
|
|
2005-05-13 19:44:47 +02:00
|
|
|
/* Allocates space for and initializes a new provider. If fnTableA or fnTableW
|
2008-07-02 17:18:49 +02:00
|
|
|
* is non-NULL, assumes the provider is built-in, and if moduleName is non-NULL,
|
|
|
|
* means must load the LSA/user mode functions tables from external SSP/AP module.
|
2005-05-13 19:44:47 +02:00
|
|
|
* Otherwise moduleName must not be NULL.
|
|
|
|
* Returns a pointer to the stored provider entry, for use adding packages.
|
|
|
|
*/
|
2006-01-24 14:00:32 +01:00
|
|
|
SecureProvider *SECUR32_addProvider(const SecurityFunctionTableA *fnTableA,
|
2011-04-21 11:37:02 +02:00
|
|
|
const SecurityFunctionTableW *fnTableW, PCWSTR moduleName) DECLSPEC_HIDDEN;
|
2005-05-13 19:44:47 +02:00
|
|
|
|
|
|
|
/* Allocates space for and adds toAdd packages with the given provider.
|
|
|
|
* provider must not be NULL, and either infoA or infoW may be NULL, but not
|
|
|
|
* both.
|
|
|
|
*/
|
|
|
|
void SECUR32_addPackages(SecureProvider *provider, ULONG toAdd,
|
2011-04-21 11:37:02 +02:00
|
|
|
const SecPkgInfoA *infoA, const SecPkgInfoW *infoW) DECLSPEC_HIDDEN;
|
2005-05-13 19:44:47 +02:00
|
|
|
|
2004-03-02 05:57:35 +01:00
|
|
|
/* Tries to find the package named packageName. If it finds it, implicitly
|
|
|
|
* loads the package if it isn't already loaded.
|
|
|
|
*/
|
2011-04-21 11:37:02 +02:00
|
|
|
SecurePackage *SECUR32_findPackageW(PCWSTR packageName) DECLSPEC_HIDDEN;
|
2004-03-02 05:57:35 +01:00
|
|
|
|
|
|
|
/* Tries to find the package named packageName. (Thunks to _findPackageW)
|
|
|
|
*/
|
2011-04-21 11:37:02 +02:00
|
|
|
SecurePackage *SECUR32_findPackageA(PCSTR packageName) DECLSPEC_HIDDEN;
|
2004-03-02 05:57:35 +01:00
|
|
|
|
2005-05-13 19:44:47 +02:00
|
|
|
/* Initialization functions for built-in providers */
|
2011-04-21 11:37:02 +02:00
|
|
|
void SECUR32_initSchannelSP(void) DECLSPEC_HIDDEN;
|
|
|
|
void SECUR32_initNegotiateSP(void) DECLSPEC_HIDDEN;
|
2018-02-01 11:04:33 +01:00
|
|
|
void load_auth_packages(void) DECLSPEC_HIDDEN;
|
2005-05-13 19:44:47 +02:00
|
|
|
|
2008-09-22 22:14:04 +02:00
|
|
|
/* Cleanup functions for built-in providers */
|
2011-04-21 11:37:02 +02:00
|
|
|
void SECUR32_deinitSchannelSP(void) DECLSPEC_HIDDEN;
|
2008-09-22 22:14:04 +02:00
|
|
|
|
2011-03-14 00:58:40 +01:00
|
|
|
/* schannel internal interface */
|
2021-05-07 11:54:41 +02:00
|
|
|
typedef struct schan_session_opaque *schan_session;
|
2013-03-25 13:55:20 +01:00
|
|
|
|
|
|
|
typedef struct schan_credentials
|
|
|
|
{
|
|
|
|
ULONG credential_use;
|
|
|
|
void *credentials;
|
2013-03-27 12:22:23 +01:00
|
|
|
DWORD enabled_protocols;
|
2013-03-25 13:55:20 +01:00
|
|
|
} schan_credentials;
|
2011-03-14 00:58:40 +01:00
|
|
|
|
|
|
|
struct schan_transport;
|
|
|
|
|
2011-10-03 20:22:50 +02:00
|
|
|
struct schan_buffers
|
|
|
|
{
|
|
|
|
SIZE_T offset;
|
|
|
|
SIZE_T limit;
|
|
|
|
const SecBufferDesc *desc;
|
2021-12-03 18:24:24 +01:00
|
|
|
SecBuffer *alloc_buffer;
|
2011-10-03 20:22:50 +02:00
|
|
|
int current_buffer_idx;
|
|
|
|
int (*get_next_buffer)(const struct schan_transport *, struct schan_buffers *);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct schan_transport
|
|
|
|
{
|
|
|
|
struct schan_context *ctx;
|
2021-12-03 12:07:36 +01:00
|
|
|
schan_session session;
|
2011-10-03 20:22:50 +02:00
|
|
|
struct schan_buffers in;
|
|
|
|
struct schan_buffers out;
|
|
|
|
};
|
|
|
|
|
2021-12-04 13:18:34 +01:00
|
|
|
struct session_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct allocate_certificate_credentials_params
|
|
|
|
{
|
|
|
|
schan_credentials *c;
|
|
|
|
const CERT_CONTEXT *ctx;
|
|
|
|
const DATA_BLOB *key_blob;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct create_session_params
|
|
|
|
{
|
|
|
|
struct schan_transport *transport;
|
|
|
|
schan_credentials *cred;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct free_certificate_credentials_params
|
|
|
|
{
|
|
|
|
schan_credentials *c;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct get_application_protocol_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
SecPkgContext_ApplicationProtocol *protocol;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct get_connection_info_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
SecPkgContext_ConnectionInfo *info;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct get_session_peer_certificate_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
CERT_BLOB *certs;
|
|
|
|
ULONG *bufsize;
|
|
|
|
ULONG *retcount;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct get_unique_channel_binding_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
void *buffer;
|
|
|
|
ULONG *bufsize;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct handshake_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
SecBufferDesc *input;
|
|
|
|
SIZE_T input_size;
|
|
|
|
SecBufferDesc *output;
|
|
|
|
SecBuffer *alloc_buffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct recv_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
SecBufferDesc *input;
|
|
|
|
SIZE_T input_size;
|
|
|
|
void *buffer;
|
|
|
|
SIZE_T *length;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct send_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
SecBufferDesc *output;
|
|
|
|
const void *buffer;
|
|
|
|
SIZE_T *length;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct set_application_protocols_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
unsigned char *buffer;
|
|
|
|
unsigned int buflen;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct set_dtls_mtu_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
unsigned int mtu;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct set_session_target_params
|
|
|
|
{
|
|
|
|
schan_session session;
|
|
|
|
const char *target;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum schan_funcs
|
|
|
|
{
|
|
|
|
unix_process_attach,
|
|
|
|
unix_process_detach,
|
|
|
|
unix_allocate_certificate_credentials,
|
|
|
|
unix_create_session,
|
|
|
|
unix_dispose_session,
|
|
|
|
unix_free_certificate_credentials,
|
|
|
|
unix_get_application_protocol,
|
|
|
|
unix_get_connection_info,
|
|
|
|
unix_get_enabled_protocols,
|
|
|
|
unix_get_key_signature_algorithm,
|
|
|
|
unix_get_max_message_size,
|
|
|
|
unix_get_session_cipher_block_size,
|
|
|
|
unix_get_session_peer_certificate,
|
|
|
|
unix_get_unique_channel_binding,
|
|
|
|
unix_handshake,
|
|
|
|
unix_recv,
|
|
|
|
unix_send,
|
|
|
|
unix_set_application_protocols,
|
|
|
|
unix_set_dtls_mtu,
|
|
|
|
unix_set_session_target,
|
|
|
|
};
|
2021-05-07 11:54:41 +02:00
|
|
|
|
|
|
|
#endif /* __SECUR32_PRIV_H__ */
|