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
36 #ifndef __KRB5_V4COMPAT_H__
37 #define __KRB5_V4COMPAT_H__
42 * This file must only be included with v4 compat glue stuff in
45 * It MUST NOT be installed.
48 #define KRB_PROT_VERSION 4
50 #define AUTH_MSG_KDC_REQUEST (1<<1)
51 #define AUTH_MSG_KDC_REPLY (2<<1)
52 #define AUTH_MSG_APPL_REQUEST (3<<1)
53 #define AUTH_MSG_APPL_REQUEST_MUTUAL (4<<1)
54 #define AUTH_MSG_ERR_REPLY (5<<1)
55 #define AUTH_MSG_PRIVATE (6<<1)
56 #define AUTH_MSG_SAFE (7<<1)
57 #define AUTH_MSG_APPL_ERR (8<<1)
58 #define AUTH_MSG_KDC_FORWARD (9<<1)
59 #define AUTH_MSG_KDC_RENEW (10<<1)
60 #define AUTH_MSG_DIE (63<<1)
62 /* General definitions */
68 #define MAX_KTXT_LEN 1250
76 unsigned int length
; /* Length of the text */
77 unsigned char dat
[MAX_KTXT_LEN
]; /* The data itself */
78 uint32_t mbz
; /* zero to catch runaway strings */
82 char service
[ANAME_SZ
]; /* Service name */
83 char instance
[INST_SZ
]; /* Instance */
84 char realm
[REALM_SZ
]; /* Auth domain */
85 char session
[8]; /* Session key */
86 int lifetime
; /* Lifetime */
87 int kvno
; /* Key version number */
88 struct ktext ticket_st
; /* The ticket itself */
89 int32_t issue_date
; /* The issue time */
90 char pname
[ANAME_SZ
]; /* Principal's name */
91 char pinst
[INST_SZ
]; /* Principal's instance */
94 #define TKTLIFENUMFIXED 64
95 #define TKTLIFEMINFIXED 0x80
96 #define TKTLIFEMAXFIXED 0xBF
97 #define TKTLIFENOEXPIRE 0xFF
98 #define MAXTKTLIFETIME (30*24*3600) /* 30 days */
100 #define NEVERDATE ((time_t)0x7fffffffL)
103 #define KERB_ERR_NULL_KEY 10
105 #define CLOCK_SKEW 5*60
108 #ifdef KRB5_USE_PATH_TOKENS
109 #define TKT_ROOT "%{TEMP}/tkt"
111 #define TKT_ROOT "/tmp/tkt"
115 struct _krb5_krb_auth_data
{
116 int8_t k_flags
; /* Flags from ticket */
117 char *pname
; /* Principal's name */
118 char *pinst
; /* His Instance */
119 char *prealm
; /* His Realm */
120 uint32_t checksum
; /* Data checksum (opt) */
121 krb5_keyblock session
; /* Session Key */
122 unsigned char life
; /* Life of ticket */
123 uint32_t time_sec
; /* Time ticket issued */
124 uint32_t address
; /* Address in ticket */
127 KRB5_LIB_FUNCTION
time_t KRB5_LIB_CALL
128 _krb5_krb_life_to_time (int, int);
130 KRB5_LIB_FUNCTION
int KRB5_LIB_CALL
131 _krb5_krb_time_to_life (time_t, time_t);
133 KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
134 _krb5_krb_tf_setup (krb5_context
, struct credentials
*,
137 KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
138 _krb5_krb_dest_tkt(krb5_context
, const char *);
140 #define krb_time_to_life _krb5_krb_time_to_life
141 #define krb_life_to_time _krb5_krb_life_to_time
143 #endif /* __KRB5_V4COMPAT_H__ */