2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
16 #ifndef _SMBD_AUTHSVC_H
17 #define _SMBD_AUTHSVC_H
20 * Declarations shared with authsvc modules.
23 #include <sys/types.h>
24 #include <smbsrv/libsmb.h>
27 * This is the common authsvc_context shared by all back-ends.
28 * Note that ctx_mech_oid is really SPNEGO_MECH_OID, and the
29 * ctx_itoken, ctx_otoken members are SPNEGO_TOKEN_HANDLE,
30 * but this is using the underlying types so as to avoid
31 * dragging in spnego.h here.
33 typedef struct authsvc_context
{
36 int (*ctx_mh_work
)(struct authsvc_context
*);
37 void (*ctx_mh_fini
)(struct authsvc_context
*);
41 /* (in,out) SPNEGO token handles */
45 /* (in,out) raw (buf,len,type) */
53 /* (in,out) body (buf,len) */
59 /* who is the client */
60 smb_lsa_clinfo_t ctx_clinfo
;
62 /* final authentication token */
63 struct smb_token
*ctx_token
;
65 /* private data for the back-end */
69 int smbd_krb5ssp_init(authsvc_context_t
*);
70 int smbd_krb5ssp_work(authsvc_context_t
*);
71 void smbd_krb5ssp_fini(authsvc_context_t
*);
73 int smbd_ntlmssp_init(authsvc_context_t
*);
74 int smbd_ntlmssp_work(authsvc_context_t
*);
75 void smbd_ntlmssp_fini(authsvc_context_t
*);
77 /* Exposed for unit tests. */
78 int smbd_authsvc_dispatch(authsvc_context_t
*);
79 authsvc_context_t
*smbd_authctx_create(void);
80 void smbd_authctx_destroy(authsvc_context_t
*);
82 #endif /* _SMBD_AUTHSVC_H */