1 /* internal.h internal header file for shishi
2 * Copyright (C) 2002, 2003 Simon Josefsson
4 * This file is part of Shishi.
6 * Shishi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Shishi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Shishi; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
44 #if defined HAVE_DECL_H_ERRNO && !HAVE_DECL_H_ERRNO
52 #ifdef HAVE_SYS_TYPES_H
53 #include <sys/types.h>
56 #ifdef HAVE_SYS_SELECT_H
57 #include <sys/select.h>
60 #ifdef HAVE_SYS_SOCKET_H
61 #include <sys/socket.h>
64 #ifdef HAVE_SYS_IOCTL_H
65 #include <sys/ioctl.h>
73 # include <inttypes.h>
80 #if TIME_WITH_SYS_TIME
81 # include <sys/time.h>
85 # include <sys/time.h>
92 # if !STDC_HEADERS && HAVE_MEMORY_H
105 #ifdef HAVE_NETINET_IN_H
106 #include <netinet/in.h>
108 #ifdef HAVE_NETINET_IN6_H
109 #include <netinet/in6.h>
111 #ifdef HAVE_ARPA_INET_H
112 #include <arpa/inet.h>
116 extern char *_shishi_gettext (const char *str
);
117 #define _(String) _shishi_gettext (String)
118 #define gettext_noop(String) String
119 #define N_(String) gettext_noop (String)
123 #include "vasprintf.h"
128 #define GENERALIZEDTIME_TIME_LEN 15
129 #define MAX_KEY_LEN 32
130 #define MAX_RANDOM_LEN 32
131 #define MAX_HASH_LEN 32
132 #define MAX_CKSUM_LEN 32
134 #define SHISHI_VERBOSE_CRYPTO (1<<1)
135 #define SHISHI_VERBOSE_ASN1 (1<<2)
136 #define SHISHI_VERBOSE_NOICE (1<<3)
138 #define KRBTGT "krbtgt"
139 #define PRINCIPAL_DELIMITER "/"
141 #define VERBOSEASN1(h) (h->verbose & SHISHI_VERBOSE_ASN1)
142 #define VERBOSECRYPTO(h) (h->verbose & SHISHI_VERBOSE_CRYPTO)
143 #define VERBOSENOICE(h) (h->verbose & SHISHI_VERBOSE_NOICE)
144 #define VERBOSES (SHISHI_VERBOSE_ASN1 | \
145 SHISHI_VERBOSE_CRYPTO | \
146 SHISHI_VERBOSE_NOICE)
147 #define VERBOSE(h) (h->verbose & ~VERBOSES)
149 #ifndef HOST_NAME_MAX
150 #define HOST_NAME_MAX BUFSIZ
153 struct Shishi_kdcinfo
156 struct sockaddr sockaddress
;
159 struct Shishi_realminfo
162 struct Shishi_kdcinfo
*kdcaddresses
;
171 char *default_principal
;
174 int32_t *clientkdcetypes
;
175 int nclientkdcetypes
;
176 struct Shishi_realminfo
*realminfos
;
182 char *tktsdefaultfile
;
183 char *hostkeysdefaultfile
;
188 #define BASE_DIR "/.shishi"
189 #define TICKET_FILE BASE_DIR "/tickets"
190 #define USERCFG_FILE BASE_DIR "/config"
193 _shishi_print_armored_data (Shishi
* handle
,
195 Shishi_asn1 asn1
, char *asn1type
, char *headers
);
197 _shishi_save_data (Shishi
* handle
, FILE * fh
, Shishi_asn1 asn1
,
201 _shishi_authenticator_input (Shishi
* handle
,
202 FILE * fh
, Shishi_asn1
* authenticator
,
205 _shishi_apreq_input (Shishi
* handle
, FILE * fh
, Shishi_asn1
* apreq
,
207 int _shishi_aprep_input (Shishi
* handle
, FILE * fh
, Shishi_asn1
* aprep
,
209 int _shishi_kdcreq_input (Shishi
* handle
, FILE * fh
, Shishi_asn1
* asreq
,
211 int _shishi_kdcrep_input (Shishi
* handle
, FILE * fh
, Shishi_asn1
* asrep
,
213 int _shishi_krberror_input (Shishi
* handle
, FILE * fh
,
214 Shishi_asn1
* krberror
, int type
);
215 int _shishi_encapreppart_input (Shishi
* handle
, FILE * fh
,
216 Shishi_asn1
* encapreppart
, int type
);
217 int _shishi_safe_input (Shishi
* handle
, FILE * fh
,
218 Shishi_asn1
* safe
, int type
);
220 Shishi_asn1
_shishi_asn1_read (void);
221 int _shishi_cipher_init (void);
224 shishi_asn1_integer2_field (Shishi
* handle
,
225 Shishi_asn1 node
, unsigned long *i
,
228 #if defined(WITH_DMALLOC) && WITH_DMALLOC
232 #endif /* _INTERNAL_H */