4 Copyright (c) 2010, Simo Sorce <idra@samba.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 struct mit_samba_context
{
24 struct auth_session_info
*session_info
;
26 /* for compat with hdb plugin common code */
28 struct samba_kdc_db_context
*db_ctx
;
31 int mit_samba_context_init(struct mit_samba_context
**_ctx
);
33 void mit_samba_context_free(struct mit_samba_context
*ctx
);
35 int mit_samba_generate_salt(krb5_data
*salt
);
37 int mit_samba_generate_random_password(krb5_data
*pwd
);
39 int mit_samba_get_principal(struct mit_samba_context
*ctx
,
40 krb5_const_principal principal
,
42 krb5_db_entry
**_kentry
);
44 int mit_samba_get_firstkey(struct mit_samba_context
*ctx
,
45 krb5_db_entry
**_kentry
);
47 int mit_samba_get_nextkey(struct mit_samba_context
*ctx
,
48 krb5_db_entry
**_kentry
);
50 int mit_samba_get_pac(struct mit_samba_context
*smb_ctx
,
53 krb5_db_entry
*client
,
54 krb5_db_entry
*server
,
55 krb5_keyblock
*replaced_reply_key
,
58 krb5_error_code
mit_samba_reget_pac(struct mit_samba_context
*ctx
,
61 krb5_const_principal client_principal
,
62 krb5_db_entry
*client
,
63 krb5_db_entry
*server
,
64 krb5_db_entry
*krbtgt
,
65 krb5_keyblock
*krbtgt_keyblock
,
68 krb5_error_code
mit_samba_update_pac(struct mit_samba_context
*ctx
,
71 krb5_db_entry
*client
,
72 krb5_db_entry
*server
,
73 krb5_db_entry
*signing_krbtgt
,
77 int mit_samba_check_client_access(struct mit_samba_context
*ctx
,
78 krb5_db_entry
*client
,
79 const char *client_name
,
80 krb5_db_entry
*server
,
81 const char *server_name
,
82 const char *netbios_name
,
86 int mit_samba_check_s4u2proxy(struct mit_samba_context
*ctx
,
87 const krb5_db_entry
*server
,
88 krb5_const_principal target_principal
);
89 krb5_error_code
mit_samba_check_allowed_to_delegate_from(
90 struct mit_samba_context
*ctx
,
91 krb5_const_principal client
,
92 krb5_const_principal server
,
94 const krb5_db_entry
*proxy
);
96 int mit_samba_kpasswd_change_password(struct mit_samba_context
*ctx
,
98 krb5_db_entry
*db_entry
);
100 void mit_samba_zero_bad_password_count(krb5_db_entry
*db_entry
);
102 void mit_samba_update_bad_password_count(krb5_db_entry
*db_entry
);
104 bool mit_samba_princ_needs_pac(krb5_db_entry
*db_entry
);
106 #endif /* _MIT_SAMBA_H */