Fix bug 7045 - Bad (non memory copying) interfaces in smbc_setXXXX calls.
[Samba.git] / source / include / smb_krb5.h
blobce7acc431faf88be9b476677b230e2d71c6e5b4c
1 #ifndef _HEADER_smb_krb5_h
2 #define _HEADER_smb_krb5_h
4 #define KRB5_PRIVATE 1 /* this file uses PRIVATE interfaces! */
5 /* this file uses DEPRECATED interfaces! */
7 #if defined(HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER)
8 #define KRB5_DEPRECATED 1
9 #else
10 #define KRB5_DEPRECATED
11 #endif
13 #if HAVE_KRB5_H
14 #include <krb5.h>
15 #endif
17 #ifndef KRB5_ADDR_NETBIOS
18 #define KRB5_ADDR_NETBIOS 0x14
19 #endif
21 #ifndef KRB5KRB_ERR_RESPONSE_TOO_BIG
22 #define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L)
23 #endif
25 typedef struct {
26 NTSTATUS ntstatus;
27 uint32 unknown1;
28 uint32 unknown2; /* 0x00000001 */
29 } KRB5_EDATA_NTSTATUS;
31 /* Heimdal uses a slightly different name */
32 #if defined(HAVE_ENCTYPE_ARCFOUR_HMAC_MD5)
33 #define ENCTYPE_ARCFOUR_HMAC ENCTYPE_ARCFOUR_HMAC_MD5
34 #endif
36 /* The older versions of heimdal that don't have this
37 define don't seem to use it anyway. I'm told they
38 always use a subkey */
39 #ifndef HAVE_AP_OPTS_USE_SUBKEY
40 #define AP_OPTS_USE_SUBKEY 0
41 #endif
43 #ifdef HAVE_KRB5
44 typedef struct {
45 #if defined(HAVE_MAGIC_IN_KRB5_ADDRESS) && defined(HAVE_ADDRTYPE_IN_KRB5_ADDRESS) /* MIT */
46 krb5_address **addrs;
47 #elif defined(HAVE_KRB5_ADDRESSES) /* Heimdal */
48 krb5_addresses *addrs;
49 #else
50 #error UNKNOWN_KRB5_ADDRESS_TYPE
51 #endif /* defined(HAVE_MAGIC_IN_KRB5_ADDRESS) && defined(HAVE_ADDRTYPE_IN_KRB5_ADDRESS) */
52 } smb_krb5_addresses;
54 #ifdef HAVE_KRB5_KEYBLOCK_KEYVALUE /* Heimdal */
55 #define KRB5_KEY_TYPE(k) ((k)->keytype)
56 #define KRB5_KEY_LENGTH(k) ((k)->keyvalue.length)
57 #define KRB5_KEY_DATA(k) ((k)->keyvalue.data)
58 #define KRB5_KEY_DATA_CAST void
59 #else /* MIT */
60 #define KRB5_KEY_TYPE(k) ((k)->enctype)
61 #define KRB5_KEY_LENGTH(k) ((k)->length)
62 #define KRB5_KEY_DATA(k) ((k)->contents)
63 #define KRB5_KEY_DATA_CAST krb5_octet
64 #endif /* HAVE_KRB5_KEYBLOCK_KEYVALUE */
66 #ifdef HAVE_KRB5_KEYTAB_ENTRY_KEY /* MIT */
67 #define KRB5_KT_KEY(k) (&(k)->key)
68 #elif HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK /* Heimdal */
69 #define KRB5_KT_KEY(k) (&(k)->keyblock)
70 #else
71 #error krb5_keytab_entry has no key or keyblock member
72 #endif /* HAVE_KRB5_KEYTAB_ENTRY_KEY */
74 #endif /* HAVE_KRB5 */
76 #include "krb5_protos.h"
78 #endif /* _HEADER_smb_krb5_h */