2 * Copyright (c) 1997 - 2003 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 /* $Heimdal: krb5-v4compat.h 21575 2007-07-16 07:44:54Z lha $
37 #ifndef __KRB5_V4COMPAT_H__
38 #define __KRB5_V4COMPAT_H__
43 * This file must only be included with v4 compat glue stuff in
46 * It MUST NOT be installed.
49 #define KRB_PROT_VERSION 4
51 #define AUTH_MSG_KDC_REQUEST (1<<1)
52 #define AUTH_MSG_KDC_REPLY (2<<1)
53 #define AUTH_MSG_APPL_REQUEST (3<<1)
54 #define AUTH_MSG_APPL_REQUEST_MUTUAL (4<<1)
55 #define AUTH_MSG_ERR_REPLY (5<<1)
56 #define AUTH_MSG_PRIVATE (6<<1)
57 #define AUTH_MSG_SAFE (7<<1)
58 #define AUTH_MSG_APPL_ERR (8<<1)
59 #define AUTH_MSG_KDC_FORWARD (9<<1)
60 #define AUTH_MSG_KDC_RENEW (10<<1)
61 #define AUTH_MSG_DIE (63<<1)
63 /* General definitions */
69 #define MAX_KTXT_LEN 1250
77 unsigned int length
; /* Length of the text */
78 unsigned char dat
[MAX_KTXT_LEN
]; /* The data itself */
79 uint32_t mbz
; /* zero to catch runaway strings */
83 char service
[ANAME_SZ
]; /* Service name */
84 char instance
[INST_SZ
]; /* Instance */
85 char realm
[REALM_SZ
]; /* Auth domain */
86 char session
[8]; /* Session key */
87 int lifetime
; /* Lifetime */
88 int kvno
; /* Key version number */
89 struct ktext ticket_st
; /* The ticket itself */
90 int32_t issue_date
; /* The issue time */
91 char pname
[ANAME_SZ
]; /* Principal's name */
92 char pinst
[INST_SZ
]; /* Principal's instance */
95 #define TKTLIFENUMFIXED 64
96 #define TKTLIFEMINFIXED 0x80
97 #define TKTLIFEMAXFIXED 0xBF
98 #define TKTLIFENOEXPIRE 0xFF
99 #define MAXTKTLIFETIME (30*24*3600) /* 30 days */
101 #define NEVERDATE ((time_t)0x7fffffffL)
104 #define KERB_ERR_NULL_KEY 10
106 #define CLOCK_SKEW 5*60
109 #define TKT_ROOT "/tmp/tkt"
112 struct _krb5_krb_auth_data
{
113 int8_t k_flags
; /* Flags from ticket */
114 char *pname
; /* Principal's name */
115 char *pinst
; /* His Instance */
116 char *prealm
; /* His Realm */
117 uint32_t checksum
; /* Data checksum (opt) */
118 krb5_keyblock session
; /* Session Key */
119 unsigned char life
; /* Life of ticket */
120 uint32_t time_sec
; /* Time ticket issued */
121 uint32_t address
; /* Address in ticket */
124 time_t _krb5_krb_life_to_time (int, int);
125 int _krb5_krb_time_to_life (time_t, time_t);
126 krb5_error_code
_krb5_krb_tf_setup (krb5_context
, struct credentials
*,
128 krb5_error_code
_krb5_krb_dest_tkt(krb5_context
, const char *);
130 #define krb_time_to_life _krb5_krb_time_to_life
131 #define krb_life_to_time _krb5_krb_life_to_time
133 #endif /* __KRB5_V4COMPAT_H__ */