Commit 7d0889b7 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

secur32: Move Schannel support to a Unix library.

parent a84b0299
......@@ -40,6 +40,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(secur32);
HINSTANCE hsecur32;
/**
* Type definitions
*/
......@@ -1246,6 +1248,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
switch (reason)
{
case DLL_PROCESS_ATTACH:
hsecur32 = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
SECUR32_initializeProviders();
break;
......
......@@ -27,6 +27,8 @@
#include "wine/list.h"
#include "schannel.h"
extern HINSTANCE hsecur32 DECLSPEC_HIDDEN;
typedef struct _SecureProvider
{
struct list entry;
......@@ -83,7 +85,7 @@ void load_auth_packages(void) DECLSPEC_HIDDEN;
void SECUR32_deinitSchannelSP(void) DECLSPEC_HIDDEN;
/* schannel internal interface */
typedef struct schan_imp_session_opaque *schan_imp_session;
typedef struct schan_session_opaque *schan_session;
typedef struct schan_credentials
{
......@@ -111,40 +113,43 @@ struct schan_transport
struct schan_buffers out;
};
char *schan_get_buffer(const struct schan_transport *t, struct schan_buffers *s, SIZE_T *count) DECLSPEC_HIDDEN;
extern int schan_pull(struct schan_transport *t, void *buff, size_t *buff_len) DECLSPEC_HIDDEN;
extern int schan_push(struct schan_transport *t, const void *buff, size_t *buff_len) DECLSPEC_HIDDEN;
extern schan_imp_session schan_session_for_transport(struct schan_transport* t) DECLSPEC_HIDDEN;
/* schannel implementation interface */
extern BOOL schan_imp_create_session(schan_imp_session *session, schan_credentials *cred) DECLSPEC_HIDDEN;
extern void schan_imp_dispose_session(schan_imp_session session) DECLSPEC_HIDDEN;
extern void schan_imp_set_session_transport(schan_imp_session session,
struct schan_transport *t) DECLSPEC_HIDDEN;
extern void schan_imp_set_session_target(schan_imp_session session, const char *target) DECLSPEC_HIDDEN;
extern SECURITY_STATUS schan_imp_handshake(schan_imp_session session) DECLSPEC_HIDDEN;
extern unsigned int schan_imp_get_session_cipher_block_size(schan_imp_session session) DECLSPEC_HIDDEN;
extern unsigned int schan_imp_get_max_message_size(schan_imp_session session) DECLSPEC_HIDDEN;
extern ALG_ID schan_imp_get_key_signature_algorithm(schan_imp_session session) DECLSPEC_HIDDEN;
extern SECURITY_STATUS schan_imp_get_connection_info(schan_imp_session session,
SecPkgContext_ConnectionInfo *info) DECLSPEC_HIDDEN;
extern SECURITY_STATUS schan_imp_get_unique_channel_binding(schan_imp_session session,
SecPkgContext_Bindings *bindings) DECLSPEC_HIDDEN;
extern SECURITY_STATUS schan_imp_get_session_peer_certificate(schan_imp_session session, HCERTSTORE,
PCCERT_CONTEXT *cert) DECLSPEC_HIDDEN;
extern SECURITY_STATUS schan_imp_send(schan_imp_session session, const void *buffer,
SIZE_T *length) DECLSPEC_HIDDEN;
extern SECURITY_STATUS schan_imp_recv(schan_imp_session session, void *buffer,
SIZE_T *length) DECLSPEC_HIDDEN;
extern BOOL schan_imp_allocate_certificate_credentials(schan_credentials *, const CERT_CONTEXT *) DECLSPEC_HIDDEN;
extern void schan_imp_free_certificate_credentials(schan_credentials*) DECLSPEC_HIDDEN;
extern DWORD schan_imp_enabled_protocols(void) DECLSPEC_HIDDEN;
extern BOOL schan_imp_init(void) DECLSPEC_HIDDEN;
extern void schan_imp_deinit(void) DECLSPEC_HIDDEN;
extern void schan_imp_set_application_protocols(schan_imp_session, unsigned char *, unsigned int) DECLSPEC_HIDDEN;
extern SECURITY_STATUS schan_imp_get_application_protocol(schan_imp_session,
SecPkgContext_ApplicationProtocol *) DECLSPEC_HIDDEN;
extern SECURITY_STATUS schan_imp_set_dtls_mtu(schan_imp_session, unsigned int) DECLSPEC_HIDDEN;
#endif /* ndef __SECUR32_PRIV_H__ */
struct schan_cert_list
{
unsigned int count;
CERT_BLOB *certs;
};
struct schan_funcs
{
BOOL (CDECL *allocate_certificate_credentials)(schan_credentials *, const CERT_CONTEXT *, const DATA_BLOB *);
BOOL (CDECL *create_session)(schan_session *, schan_credentials *);
void (CDECL *dispose_session)(schan_session);
void (CDECL *free_certificate_credentials)(schan_credentials *);
SECURITY_STATUS (CDECL *get_application_protocol)(schan_session, SecPkgContext_ApplicationProtocol *);
SECURITY_STATUS (CDECL *get_connection_info)(schan_session, SecPkgContext_ConnectionInfo *);
DWORD (CDECL *get_enabled_protocols)(void);
ALG_ID (CDECL *get_key_signature_algorithm)(schan_session);
unsigned int (CDECL *get_max_message_size)(schan_session);
unsigned int (CDECL *get_session_cipher_block_size)(schan_session);
SECURITY_STATUS (CDECL *get_session_peer_certificate)(schan_session, struct schan_cert_list *);
SECURITY_STATUS (CDECL *get_unique_channel_binding)(schan_session, SecPkgContext_Bindings *);
SECURITY_STATUS (CDECL *handshake)(schan_session session);
SECURITY_STATUS (CDECL *recv)(schan_session, void *, SIZE_T *);
SECURITY_STATUS (CDECL *send)(schan_session, const void *, SIZE_T *);
void (CDECL *set_application_protocols)(schan_session, unsigned char *, unsigned int);
SECURITY_STATUS (CDECL *set_dtls_mtu)(schan_session, unsigned int);
void (CDECL *set_session_target)(schan_session, const char *);
void (CDECL *set_session_transport)(schan_session, struct schan_transport *);
};
struct schan_callbacks
{
char * (CDECL *get_buffer)(const struct schan_transport *, struct schan_buffers *, SIZE_T *);
schan_session (CDECL *get_session_for_transport)(struct schan_transport *);
int CDECL (CDECL *pull)(struct schan_transport *, void *, size_t *);
int CDECL (CDECL *push)(struct schan_transport *, const void *, size_t *);
};
extern const struct schan_funcs *schan_funcs;
#endif /* __SECUR32_PRIV_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment