1 /* data.h global data structures for shishi application
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
45 /* extern int 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>
119 #define _(String) gettext (String)
120 #define gettext_noop(String) String
121 #define N_(String) gettext_noop (String)
123 /* Short and long parameter */
137 /* Long parameters only */
140 OPTION_KDC_REQUEST
= 300,
143 OPTION_KDC_WRITE_AP_REQUEST_FILE
,
144 OPTION_KDC_WRITE_AUTHENTICATOR_FILE
,
145 OPTION_KDC_WRITE_REQUEST_FILE
,
146 OPTION_KDC_WRITE_RESPONSE_FILE
,
147 OPTION_KDC_READ_REQUEST_FILE
,
148 OPTION_KDC_READ_RESPONSE_FILE
,
152 OPTION_KDC_CLIENT_NAME
,
153 OPTION_KDC_KEY_VALUE
,
155 OPTION_KDC_SERVER_NAME
,
156 OPTION_KDC_TICKET_GRANTER
,
158 OPTION_KDC_FORCE_TGS
,
159 OPTION_AP_AUTHENTICATOR_READ_FILE
,
160 OPTION_AP_AUTHENTICATOR_WRITE_FILE
,
161 OPTION_AP_AUTHENTICATOR_DATA
,
162 OPTION_AP_AUTHENTICATOR_READ_DATA_FILE
,
163 OPTION_AP_REQUEST_READ_FILE
,
164 OPTION_AP_REQUEST_WRITE_FILE
,
166 OPTION_AP_SERVER_NAME
,
167 OPTION_CRYPTO_ENCRYPT
,
168 OPTION_CRYPTO_DECRYPT
,
169 OPTION_CRYPTO_ALGORITHM
,
170 OPTION_CRYPTO_KEY_VERSION
,
171 OPTION_CRYPTO_KEY_USAGE
,
172 OPTION_CRYPTO_KEY_VALUE
,
173 OPTION_CRYPTO_READ_KEY_FILE
,
174 OPTION_CRYPTO_WRITE_KEY_FILE
,
175 OPTION_CRYPTO_READ_DATA_FILE
,
176 OPTION_CRYPTO_WRITE_DATA_FILE
,
177 OPTION_CRYPTO_PASSWORD
,
178 OPTION_CRYPTO_RANDOM
,
179 OPTION_CRYPTO_PARAMETER
,
182 OPTION_CRYPTO_CLIENT_NAME
,
184 OPTION_CRYPTO_GENERATE_KEY
,
185 OPTION_LIST_SERVER_NAME
,
186 OPTION_DESTROY_SERVER_NAME
,
188 OPTION_CLIENT_SERVER_NAME
,
189 OPTION_CLIENT_AP_OPTIONS
,
191 OPTION_SERVER_CLIENT_NAME
,
192 OPTION_SERVER_SERVER_NAME
,
193 OPTION_SERVER_KEY_FILE
,
194 OPTION_SERVER_KEY_VALUE
,
195 OPTION_SERVER_PASSWORD
,
197 OPTION_AS_CLIENT_NAME
,
200 OPTION_TGS_TICKET_GRANTER
,
201 OPTION_TGS_CLIENT_NAME
,
202 OPTION_TGS_SERVER_NAME
,
203 OPTION_VERBOSE_LIBRARY
206 #define TYPE_TEXT_NAME "text"
207 #define TYPE_DER_NAME "der"
208 #define TYPE_HEX_NAME "hex"
209 #define TYPE_BASE64_NAME "base64"
210 #define TYPE_BINARY_NAME "binary"
214 int silent
, verbose
, verbose_library
;
219 char *ticketwritefile
;
223 /* kdc/as/tgs and ap */
224 char *authenticatorwritefile
;
225 int authenticatorwritetype
;
226 char *apreqwritefile
;
237 char *kdcreqwritefile
;
239 char *kdcreqreadfile
;
241 char *kdcrepwritefile
;
243 char *kdcrepreadfile
;
249 char *authenticatorreadfile
;
250 int authenticatorreadtype
;
251 char *authenticatordatareadfile
;
252 int authenticatordatareadtype
;
253 char *authenticatordata
;
275 extern int ap (Shishi
* handle
, struct arguments arg
);
277 extern int kdc (Shishi
* handle
, struct arguments arg
);
279 extern int client (Shishi
* handle
, struct arguments arg
);
281 extern int server (Shishi
* handle
, struct arguments arg
);
283 extern int crypto (Shishi
* handle
, struct arguments arg
);