clikrb5: Move pure krb wrapper functions from libads to clikrb5.
[mat/samba.git] / source3 / libads / kerberos_proto.h
1 /*
2  *  Unix SMB/CIFS implementation.
3  *  kerberos utility library
4  *
5  *  Copyright (C) Andrew Tridgell                       2001
6  *  Copyright (C) Remus Koos (remuskoos@yahoo.com)      2001
7  *  Copyright (C) Luke Howard                           2002-2003
8  *  Copyright (C) Jim McDonough <jmcd@us.ibm.com>       2003
9  *  Copyright (C) Guenther Deschner                     2003-2008
10  *  Copyright (C) Andrew Bartlett <abartlet@samba.org>  2004-2005
11  *  Copyright (C) Jeremy Allison                        2004,2007
12  *  Copyright (C) Stefan Metzmacher                     2004-2005
13  *  Copyright (C) Nalin Dahyabhai <nalin@redhat.com>    2004
14  *  Copyright (C) Gerald Carter                         2006
15  *
16  *  This program is free software; you can redistribute it and/or modify
17  *  it under the terms of the GNU General Public License as published by
18  *  the Free Software Foundation; either version 3 of the License, or
19  *  (at your option) any later version.
20  *
21  *  This program is distributed in the hope that it will be useful,
22  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  *  GNU General Public License for more details.
25  *
26  *  You should have received a copy of the GNU General Public License
27  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
28  */
29
30 #ifndef _LIBADS_KERBEROS_PROTO_H_
31 #define _LIBADS_KERBEROS_PROTO_H_
32
33 struct PAC_LOGON_INFO;
34
35 #include "libads/ads_status.h"
36
37 /* The following definitions come from libads/kerberos.c  */
38
39 int kerberos_kinit_password_ext(const char *principal,
40                                 const char *password,
41                                 int time_offset,
42                                 time_t *expire_time,
43                                 time_t *renew_till_time,
44                                 const char *cache_name,
45                                 bool request_pac,
46                                 bool add_netbios_addr,
47                                 time_t renewable_time,
48                                 NTSTATUS *ntstatus);
49 int ads_kdestroy(const char *cc_name);
50 char* kerberos_standard_des_salt( void );
51 bool kerberos_secrets_store_des_salt( const char* salt );
52 char* kerberos_secrets_fetch_des_salt( void );
53 char *kerberos_get_default_realm_from_ccache(TALLOC_CTX *mem_ctx);
54 char *kerberos_get_realm_from_hostname(TALLOC_CTX *mem_ctx, const char *hostname);
55
56 bool kerberos_secrets_store_salting_principal(const char *service,
57                                               int enctype,
58                                               const char *principal);
59 int kerberos_kinit_password(const char *principal,
60                             const char *password,
61                             int time_offset,
62                             const char *cache_name);
63 bool create_local_private_krb5_conf_for_domain(const char *realm,
64                                                 const char *domain,
65                                                 const char *sitename,
66                                                 const struct sockaddr_storage *pss,
67                                                 const char *kdc_name);
68
69 /* The following definitions come from libads/authdata.c  */
70
71 NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
72                              const char *name,
73                              const char *pass,
74                              time_t time_offset,
75                              time_t *expire_time,
76                              time_t *renew_till_time,
77                              const char *cache_name,
78                              bool request_pac,
79                              bool add_netbios_addr,
80                              time_t renewable_time,
81                              const char *impersonate_princ_s,
82                              struct PAC_LOGON_INFO **logon_info);
83
84 /* The following definitions come from libads/krb5_setpw.c  */
85
86 ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ,
87                                  const char *newpw, int time_offset);
88 ADS_STATUS kerberos_set_password(const char *kpasswd_server,
89                                  const char *auth_principal, const char *auth_password,
90                                  const char *target_principal, const char *new_password,
91                                  int time_offset);
92
93 #endif /* _LIBADS_KERBEROS_PROTO_H_ */