2 Unix SMB/CIFS implementation.
3 Standardised Authentication types
4 Copyright (C) Andrew Bartlett 2001
5 Copyright (C) Stefan Metzmacher 2005
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "auth/gensec/ntlmssp.h"
26 #include "libcli/auth/credentials.h"
27 #include "auth/gensec/gensec.h"
28 #include "auth/gensec/spnego.h"
30 /* modules can use the following to determine if the interface has changed
31 * please increment the version number after each interface change
32 * with a comment and maybe update struct auth_critical_sizes.
34 /* version 1 - version from samba 3.0 - metze */
35 /* version 2 - initial samba4 version - metze */
36 /* version 3 - subsequent samba4 version - abartlet */
37 /* version 4 - subsequent samba4 version - metze */
38 #define AUTH_INTERFACE_VERSION 4
40 struct auth_usersupplied_info
42 const char *account_name;
43 const char *domain_name;
44 const char *workstation_name;
46 /* the values the client gives us */
48 const char *account_name;
49 const char *domain_name;
56 DATA_BLOB lm_interactive_password;
57 DATA_BLOB nt_interactive_password;
58 DATA_BLOB plaintext_password;
61 struct auth_serversupplied_info
63 struct dom_sid *account_sid;
64 struct dom_sid *primary_group_sid;
66 size_t n_domain_groups;
67 struct dom_sid **domain_groups;
69 DATA_BLOB user_session_key;
70 DATA_BLOB lm_session_key;
72 const char *account_name;
73 const char *domain_name;
75 const char *full_name;
76 const char *logon_script;
77 const char *profile_path;
78 const char *home_directory;
79 const char *home_drive;
84 NTTIME last_password_change;
85 NTTIME allow_password_change;
86 NTTIME force_password_change;
89 uint16_t bad_password_count;
96 struct auth_session_info {
97 struct security_token *security_token;
98 struct auth_serversupplied_info *server_info;
99 DATA_BLOB session_key;
102 struct auth_method_context;
104 struct auth_operations {
107 NTSTATUS (*get_challenge)(struct auth_method_context *ctx, TALLOC_CTX *mem_ctx, DATA_BLOB *challenge);
109 NTSTATUS (*check_password)(struct auth_method_context *ctx, TALLOC_CTX *mem_ctx,
110 const struct auth_usersupplied_info *user_info,
111 struct auth_serversupplied_info **server_info);
114 struct auth_method_context {
115 struct auth_method_context *prev, *next;
116 struct auth_context *auth_ctx;
117 const struct auth_operations *ops;
122 struct auth_context {
124 /* Who set this up in the first place? */
127 BOOL may_be_modified;
132 /* methods, in the order they should be called */
133 struct auth_method_context *methods;
136 /* this structure is used by backends to determine the size of some critical types */
137 struct auth_critical_sizes {
138 int interface_version;
139 int sizeof_auth_operations;
140 int sizeof_auth_methods;
141 int sizeof_auth_context;
142 int sizeof_auth_usersupplied_info;
143 int sizeof_auth_serversupplied_info;
147 #endif /* _SMBAUTH_H_ */