2 * Copyright (c) 1997-2005 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
35 * $Id: kdc_locl.h,v 1.72 2005/08/12 08:46:39 lha Exp $
38 #ifndef __KDC_LOCL_H__
39 #define __KDC_LOCL_H__
44 extern sig_atomic_t exit_flag;
45 extern size_t max_request;
46 extern const char *port_str;
47 extern krb5_addresses explicit_addresses;
49 extern int enable_http;
51 #define DETACH_IS_DEFAULT FALSE
53 extern int detach_from_console;
55 #define _PATH_KDC_CONF HDB_DB_DIR "/kdc.conf"
56 #define DEFAULT_LOG_DEST "0-1/FILE:" HDB_DB_DIR "/kdc.log"
58 extern struct timeval _kdc_now;
59 #define kdc_time (_kdc_now.tv_sec)
62 _kdc_as_rep(krb5_context context,
63 krb5_kdc_configuration *config,
64 KDC_REQ*, const krb5_data*, krb5_data*,
65 const char*, struct sockaddr*);
67 krb5_kdc_configuration *
68 configure(krb5_context context, int argc, char **argv);
71 _kdc_db_fetch(krb5_context, krb5_kdc_configuration *,
72 krb5_principal, enum hdb_ent_type, hdb_entry **);
75 _kdc_free_ent(krb5_context context, hdb_entry *);
78 loop(krb5_context context, krb5_kdc_configuration *config);
81 _kdc_tgs_rep (krb5_context context,
82 krb5_kdc_configuration *config,
83 KDC_REQ*, krb5_data*, const char*, struct sockaddr *);
86 _kdc_check_flags(krb5_context context,
87 krb5_kdc_configuration *config,
88 hdb_entry *client, const char *client_name,
89 hdb_entry *server, const char *server_name,
90 krb5_boolean is_as_req);
93 _kdc_get_des_key(krb5_context context, hdb_entry*,
94 krb5_boolean, krb5_boolean, Key**);
97 _kdc_encode_v4_ticket(krb5_context context,
98 krb5_kdc_configuration *config,
99 void *buf, size_t len, const EncTicketPart *et,
100 const PrincipalName *service, size_t *size);
102 _kdc_do_524(krb5_context context,
103 krb5_kdc_configuration *config,
104 const Ticket *t, krb5_data *reply,
105 const char *from, struct sockaddr *addr);
109 typedef struct pk_client_params pk_client_params;
110 krb5_error_code _kdc_pk_initialize(krb5_context,
111 krb5_kdc_configuration *,
114 krb5_error_code _kdc_pk_rd_padata(krb5_context, krb5_kdc_configuration *,
115 KDC_REQ *, PA_DATA *, pk_client_params **);
116 krb5_error_code _kdc_pk_mk_pa_reply(krb5_context,
117 krb5_kdc_configuration *,
123 krb5_error_code _kdc_pk_check_client(krb5_context,
124 krb5_kdc_configuration *,
127 pk_client_params *, char **);
128 void _kdc_pk_free_client_param(krb5_context, pk_client_params *);
136 _kdc_db_fetch4 (krb5_context context,
137 krb5_kdc_configuration *config,
138 const char*, const char*, const char*, enum hdb_ent_type, hdb_entry**);
141 _kdc_do_version4 (krb5_context context,
142 krb5_kdc_configuration *config,
143 unsigned char*, size_t, krb5_data*, const char*,
144 struct sockaddr_in*);
146 _kdc_maybe_version4(unsigned char*, int);
149 _kdc_do_kaserver (krb5_context context,
150 krb5_kdc_configuration *config,
151 unsigned char*, size_t, krb5_data*,
152 const char*, struct sockaddr_in*);
155 #endif /* __KDC_LOCL_H__ */