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 @@ ...@@ -40,6 +40,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(secur32); WINE_DEFAULT_DEBUG_CHANNEL(secur32);
HINSTANCE hsecur32;
/** /**
* Type definitions * Type definitions
*/ */
...@@ -1246,6 +1248,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) ...@@ -1246,6 +1248,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
switch (reason) switch (reason)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
hsecur32 = hinstDLL;
DisableThreadLibraryCalls(hinstDLL); DisableThreadLibraryCalls(hinstDLL);
SECUR32_initializeProviders(); SECUR32_initializeProviders();
break; break;
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include "wine/list.h" #include "wine/list.h"
#include "schannel.h" #include "schannel.h"
extern HINSTANCE hsecur32 DECLSPEC_HIDDEN;
typedef struct _SecureProvider typedef struct _SecureProvider
{ {
struct list entry; struct list entry;
...@@ -83,7 +85,7 @@ void load_auth_packages(void) DECLSPEC_HIDDEN; ...@@ -83,7 +85,7 @@ void load_auth_packages(void) DECLSPEC_HIDDEN;
void SECUR32_deinitSchannelSP(void) DECLSPEC_HIDDEN; void SECUR32_deinitSchannelSP(void) DECLSPEC_HIDDEN;
/* schannel internal interface */ /* schannel internal interface */
typedef struct schan_imp_session_opaque *schan_imp_session; typedef struct schan_session_opaque *schan_session;
typedef struct schan_credentials typedef struct schan_credentials
{ {
...@@ -111,40 +113,43 @@ struct schan_transport ...@@ -111,40 +113,43 @@ struct schan_transport
struct schan_buffers out; struct schan_buffers out;
}; };
char *schan_get_buffer(const struct schan_transport *t, struct schan_buffers *s, SIZE_T *count) DECLSPEC_HIDDEN; struct schan_cert_list
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; unsigned int count;
CERT_BLOB *certs;
extern schan_imp_session schan_session_for_transport(struct schan_transport* t) DECLSPEC_HIDDEN; };
/* schannel implementation interface */ struct schan_funcs
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; BOOL (CDECL *allocate_certificate_credentials)(schan_credentials *, const CERT_CONTEXT *, const DATA_BLOB *);
extern void schan_imp_set_session_transport(schan_imp_session session, BOOL (CDECL *create_session)(schan_session *, schan_credentials *);
struct schan_transport *t) DECLSPEC_HIDDEN; void (CDECL *dispose_session)(schan_session);
extern void schan_imp_set_session_target(schan_imp_session session, const char *target) DECLSPEC_HIDDEN; void (CDECL *free_certificate_credentials)(schan_credentials *);
extern SECURITY_STATUS schan_imp_handshake(schan_imp_session session) DECLSPEC_HIDDEN; SECURITY_STATUS (CDECL *get_application_protocol)(schan_session, SecPkgContext_ApplicationProtocol *);
extern unsigned int schan_imp_get_session_cipher_block_size(schan_imp_session session) DECLSPEC_HIDDEN; SECURITY_STATUS (CDECL *get_connection_info)(schan_session, SecPkgContext_ConnectionInfo *);
extern unsigned int schan_imp_get_max_message_size(schan_imp_session session) DECLSPEC_HIDDEN; DWORD (CDECL *get_enabled_protocols)(void);
extern ALG_ID schan_imp_get_key_signature_algorithm(schan_imp_session session) DECLSPEC_HIDDEN; ALG_ID (CDECL *get_key_signature_algorithm)(schan_session);
extern SECURITY_STATUS schan_imp_get_connection_info(schan_imp_session session, unsigned int (CDECL *get_max_message_size)(schan_session);
SecPkgContext_ConnectionInfo *info) DECLSPEC_HIDDEN; unsigned int (CDECL *get_session_cipher_block_size)(schan_session);
extern SECURITY_STATUS schan_imp_get_unique_channel_binding(schan_imp_session session, SECURITY_STATUS (CDECL *get_session_peer_certificate)(schan_session, struct schan_cert_list *);
SecPkgContext_Bindings *bindings) DECLSPEC_HIDDEN; SECURITY_STATUS (CDECL *get_unique_channel_binding)(schan_session, SecPkgContext_Bindings *);
extern SECURITY_STATUS schan_imp_get_session_peer_certificate(schan_imp_session session, HCERTSTORE, SECURITY_STATUS (CDECL *handshake)(schan_session session);
PCCERT_CONTEXT *cert) DECLSPEC_HIDDEN; SECURITY_STATUS (CDECL *recv)(schan_session, void *, SIZE_T *);
extern SECURITY_STATUS schan_imp_send(schan_imp_session session, const void *buffer, SECURITY_STATUS (CDECL *send)(schan_session, const void *, SIZE_T *);
SIZE_T *length) DECLSPEC_HIDDEN; void (CDECL *set_application_protocols)(schan_session, unsigned char *, unsigned int);
extern SECURITY_STATUS schan_imp_recv(schan_imp_session session, void *buffer, SECURITY_STATUS (CDECL *set_dtls_mtu)(schan_session, unsigned int);
SIZE_T *length) DECLSPEC_HIDDEN; void (CDECL *set_session_target)(schan_session, const char *);
extern BOOL schan_imp_allocate_certificate_credentials(schan_credentials *, const CERT_CONTEXT *) DECLSPEC_HIDDEN; void (CDECL *set_session_transport)(schan_session, struct schan_transport *);
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; struct schan_callbacks
extern void schan_imp_deinit(void) DECLSPEC_HIDDEN; {
extern void schan_imp_set_application_protocols(schan_imp_session, unsigned char *, unsigned int) DECLSPEC_HIDDEN; char * (CDECL *get_buffer)(const struct schan_transport *, struct schan_buffers *, SIZE_T *);
extern SECURITY_STATUS schan_imp_get_application_protocol(schan_imp_session, schan_session (CDECL *get_session_for_transport)(struct schan_transport *);
SecPkgContext_ApplicationProtocol *) DECLSPEC_HIDDEN; int CDECL (CDECL *pull)(struct schan_transport *, void *, size_t *);
extern SECURITY_STATUS schan_imp_set_dtls_mtu(schan_imp_session, unsigned int) DECLSPEC_HIDDEN; int CDECL (CDECL *push)(struct schan_transport *, const void *, size_t *);
};
#endif /* ndef __SECUR32_PRIV_H__ */
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