s3-utils/net_rpc_printer.c: print more info on write error
[Samba/gebeck_regimport.git] / source3 / include / smb_krb5.h
blobbc9996c541dbe0abaf3e20337cc6372a2c117054
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
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.
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, see <http://www.gnu.org/licenses/>.
23 #ifndef _HEADER_smb_krb5_h
24 #define _HEADER_smb_krb5_h
26 #ifdef HAVE_KRB5
28 #define KRB5_PRIVATE 1 /* this file uses PRIVATE interfaces! */
29 /* this file uses DEPRECATED interfaces! */
31 #if defined(HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER)
32 #define KRB5_DEPRECATED 1
33 #else
34 #define KRB5_DEPRECATED
35 #endif
37 #include "libcli/auth/krb5_wrap.h"
39 #ifndef KRB5_ADDR_NETBIOS
40 #define KRB5_ADDR_NETBIOS 0x14
41 #endif
43 #ifndef KRB5KRB_ERR_RESPONSE_TOO_BIG
44 #define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L)
45 #endif
47 /* Heimdal uses a slightly different name */
48 #if defined(HAVE_ENCTYPE_ARCFOUR_HMAC_MD5) && !defined(HAVE_ENCTYPE_ARCFOUR_HMAC)
49 #define ENCTYPE_ARCFOUR_HMAC ENCTYPE_ARCFOUR_HMAC_MD5
50 #endif
52 /* The older versions of heimdal that don't have this
53 define don't seem to use it anyway. I'm told they
54 always use a subkey */
55 #ifndef HAVE_AP_OPTS_USE_SUBKEY
56 #define AP_OPTS_USE_SUBKEY 0
57 #endif
59 typedef struct {
60 #if defined(HAVE_MAGIC_IN_KRB5_ADDRESS) && defined(HAVE_ADDRTYPE_IN_KRB5_ADDRESS) /* MIT */
61 krb5_address **addrs;
62 #elif defined(HAVE_KRB5_ADDRESSES) /* Heimdal */
63 krb5_addresses *addrs;
64 #else
65 #error UNKNOWN_KRB5_ADDRESS_TYPE
66 #endif /* defined(HAVE_MAGIC_IN_KRB5_ADDRESS) && defined(HAVE_ADDRTYPE_IN_KRB5_ADDRESS) */
67 } smb_krb5_addresses;
69 #ifdef HAVE_KRB5_KEYBLOCK_KEYVALUE /* Heimdal */
70 #define KRB5_KEY_TYPE(k) ((k)->keytype)
71 #define KRB5_KEY_LENGTH(k) ((k)->keyvalue.length)
72 #define KRB5_KEY_DATA(k) ((k)->keyvalue.data)
73 #define KRB5_KEY_DATA_CAST void
74 #else /* MIT */
75 #define KRB5_KEY_TYPE(k) ((k)->enctype)
76 #define KRB5_KEY_LENGTH(k) ((k)->length)
77 #define KRB5_KEY_DATA(k) ((k)->contents)
78 #define KRB5_KEY_DATA_CAST krb5_octet
79 #endif /* HAVE_KRB5_KEYBLOCK_KEYVALUE */
81 #ifdef HAVE_KRB5_KEYTAB_ENTRY_KEY /* MIT */
82 #define KRB5_KT_KEY(k) (&(k)->key)
83 #elif HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK /* Heimdal */
84 #define KRB5_KT_KEY(k) (&(k)->keyblock)
85 #else
86 #error krb5_keytab_entry has no key or keyblock member
87 #endif /* HAVE_KRB5_KEYTAB_ENTRY_KEY */
89 #endif /* HAVE_KRB5 */
91 #include "krb5_protos.h"
93 #endif /* _HEADER_smb_krb5_h */