2 samba -- Unix SMB/CIFS implementation.
4 Client credentials structure
6 Copyright (C) Jelmer Vernooij 2004-2005
7 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 struct ccache_container;
26 /* In order of priority */
27 enum credentials_obtained {
28 CRED_UNINITIALISED = 0, /* We don't even have a guess yet */
29 CRED_GUESS_ENV, /* Current value should be used, which was guessed */
30 CRED_CALLBACK, /* Callback should be used to obtain value */
31 CRED_GUESS_FILE, /* A guess from a file (or file pointed at in env variable) */
32 CRED_SPECIFIED /* Was explicitly specified on the command-line */
35 #define CLI_CRED_NTLM2 0x01
36 #define CLI_CRED_NTLMv2_AUTH 0x02
37 #define CLI_CRED_LANMAN_AUTH 0x04
38 #define CLI_CRED_NTLM_AUTH 0x08
40 struct cli_credentials {
41 /* Preferred methods, NULL means default */
42 const char **preferred_methods;
44 enum credentials_obtained workstation_obtained;
45 enum credentials_obtained username_obtained;
46 enum credentials_obtained password_obtained;
47 enum credentials_obtained domain_obtained;
48 enum credentials_obtained realm_obtained;
49 enum credentials_obtained ccache_obtained;
50 enum credentials_obtained client_gss_creds_obtained;
51 enum credentials_obtained principal_obtained;
52 enum credentials_obtained keytab_obtained;
53 enum credentials_obtained server_gss_creds_obtained;
55 const char *workstation;
58 const char *old_password;
61 const char *principal;
62 const char *salt_principal;
66 struct samr_Password *nt_hash;
68 struct ccache_container *ccache;
69 struct gssapi_creds_container *client_gss_creds;
70 struct keytab_container *keytab;
71 struct gssapi_creds_container *server_gss_creds;
73 const char *(*workstation_cb) (struct cli_credentials *);
74 const char *(*password_cb) (struct cli_credentials *);
75 const char *(*username_cb) (struct cli_credentials *);
76 const char *(*domain_cb) (struct cli_credentials *);
77 const char *(*realm_cb) (struct cli_credentials *);
78 const char *(*principal_cb) (struct cli_credentials *);
80 /* Private handle for the callback routines to use */
83 struct creds_CredentialState *netlogon_creds;
84 enum netr_SchannelType secure_channel_type;
87 struct smb_krb5_context *smb_krb5_context;
89 /* We are flagged to get machine account details from the
90 * secrets.ldb when we are asked for a username or password */
92 BOOL machine_account_pending;
94 /* Is this a machine account? */
97 /* A list of valid GENSEC mechanisms for use on this account */
98 const struct gensec_security_ops **gensec_list;
101 #include "auth/credentials/credentials_proto.h"