libcli/auth: Move more kerberos wrapping in common
[samba.git] / libcli / auth / krb5_wrap.h
1 /*
2    Unix SMB/CIFS implementation.
3    simple kerberos5 routines for active directory
4    Copyright (C) Andrew Tridgell 2001
5    Copyright (C) Luke Howard 2002-2003
6    Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005
7    Copyright (C) Guenther Deschner 2005-2009
8
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 3 of the License, or
12    (at your option) any later version.
13
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.
18
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 */
22
23 #include "system/kerberos.h"
24 struct PAC_SIGNATURE_DATA;
25 struct PAC_DATA;
26
27 int create_kerberos_key_from_string_direct(krb5_context context,
28                                                   krb5_principal host_princ,
29                                                   krb5_data *password,
30                                                   krb5_keyblock *key,
31                                            krb5_enctype enctype);
32 void kerberos_free_data_contents(krb5_context context, krb5_data *pdata);
33 krb5_error_code smb_krb5_kt_free_entry(krb5_context context, krb5_keytab_entry *kt_entry);
34 char *smb_get_krb5_error_message(krb5_context context, krb5_error_code code, TALLOC_CTX *mem_ctx);
35
36  krb5_error_code smb_krb5_parse_name(krb5_context context,
37                                 const char *name, /* in unix charset */
38                                      krb5_principal *principal);
39 krb5_error_code smb_krb5_unparse_name(TALLOC_CTX *mem_ctx,
40                                       krb5_context context,
41                                       krb5_const_principal principal,
42                                       char **unix_name);
43  krb5_error_code smb_krb5_parse_name_norealm(krb5_context context, 
44                                             const char *name, 
45                                              krb5_principal *principal);
46  bool smb_krb5_principal_compare_any_realm(krb5_context context, 
47                                           krb5_const_principal princ1, 
48                                            krb5_const_principal princ2);
49  void smb_krb5_checksum_from_pac_sig(krb5_checksum *cksum,
50                                      struct PAC_SIGNATURE_DATA *sig);
51  krb5_error_code smb_krb5_verify_checksum(krb5_context context,
52                                           const krb5_keyblock *keyblock,
53                                          krb5_keyusage usage,
54                                          krb5_checksum *cksum,
55                                          uint8_t *data,
56                                           size_t length);