Remove asn1 junk.
[shishi.git] / src / data.h
blob038bc2187f4397531d58ab4be221f178cacd00bb
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
22 #ifndef DATA_H
23 #define DATA_H
25 #if HAVE_CONFIG_H
26 #include "config.h"
27 #endif
29 #ifdef STDC_HEADERS
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <stdarg.h>
33 #include <ctype.h>
34 #endif
36 #if HAVE_UNISTD_H
37 #include <unistd.h>
38 #endif
40 #ifdef HAVE_NETDB_H
41 #include <netdb.h>
42 #endif
44 #if defined HAVE_DECL_H_ERRNO && !HAVE_DECL_H_ERRNO
45 /* extern int h_errno; */
46 #endif
48 #ifdef HAVE_PWD_H
49 #include <pwd.h>
50 #endif
52 #ifdef HAVE_SYS_TYPES_H
53 #include <sys/types.h>
54 #endif
56 #ifdef HAVE_SYS_SELECT_H
57 #include <sys/select.h>
58 #endif
60 #ifdef HAVE_SYS_SOCKET_H
61 #include <sys/socket.h>
62 #endif
64 #ifdef HAVE_SYS_IOCTL_H
65 #include <sys/ioctl.h>
66 #endif
68 #ifdef HAVE_ERRNO_H
69 #include <errno.h>
70 #endif
72 #if HAVE_INTTYPES_H
73 # include <inttypes.h>
74 #else
75 # if HAVE_STDINT_H
76 # include <stdint.h>
77 # endif
78 #endif
80 #if TIME_WITH_SYS_TIME
81 # include <sys/time.h>
82 # include <time.h>
83 #else
84 # if HAVE_SYS_TIME_H
85 # include <sys/time.h>
86 # else
87 # include <time.h>
88 # endif
89 #endif
91 #if HAVE_STRING_H
92 # if !STDC_HEADERS && HAVE_MEMORY_H
93 # include <memory.h>
94 # endif
95 # include <string.h>
96 #endif
97 #if HAVE_STRINGS_H
98 # include <strings.h>
99 #endif
101 #ifdef HAVE_SIGNAL_H
102 #include <signal.h>
103 #endif
105 #ifdef HAVE_NETINET_IN_H
106 #include <netinet/in.h>
107 #endif
108 #ifdef HAVE_NETINET_IN6_H
109 #include <netinet/in6.h>
110 #endif
112 #ifdef HAVE_LOCALE_H
113 #include <locale.h>
114 #endif
116 #include <gettext.h>
117 #include <shishi.h>
119 #define _(String) gettext (String)
120 #define gettext_noop(String) String
121 #define N_(String) gettext_noop (String)
123 /* Short and long parameter */
124 enum
126 COMMAND_AP = 1,
127 COMMAND_AS,
128 COMMAND_CLIENT,
129 COMMAND_CRYPTO,
130 COMMAND_KDC,
131 COMMAND_LIST,
132 COMMAND_DESTROY,
133 COMMAND_SERVER,
134 COMMAND_TGS
137 /* Long parameters only */
138 enum
140 OPTION_KDC_REQUEST = 300,
141 OPTION_KDC_SENDRECV,
142 OPTION_KDC_RESPONSE,
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,
149 OPTION_KDC_SERVER,
150 OPTION_KDC_CLIENT,
151 OPTION_KDC_PASSWORD,
152 OPTION_KDC_CLIENT_NAME,
153 OPTION_KDC_KEY_VALUE,
154 OPTION_KDC_REALM,
155 OPTION_KDC_SERVER_NAME,
156 OPTION_KDC_TICKET_GRANTER,
157 OPTION_KDC_FORCE_AS,
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,
165 OPTION_AP_REALM,
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,
180 OPTION_CRYPTO_REALM,
181 OPTION_CRYPTO_SALT,
182 OPTION_CRYPTO_CLIENT_NAME,
183 OPTION_CRYPTO_DEBUG,
184 OPTION_CRYPTO_GENERATE_KEY,
185 OPTION_LIST_SERVER_NAME,
186 OPTION_DESTROY_SERVER_NAME,
187 OPTION_CLIENT_REALM,
188 OPTION_CLIENT_SERVER_NAME,
189 OPTION_CLIENT_AP_OPTIONS,
190 OPTION_SERVER_REALM,
191 OPTION_SERVER_CLIENT_NAME,
192 OPTION_SERVER_SERVER_NAME,
193 OPTION_SERVER_KEY_FILE,
194 OPTION_SERVER_KEY_VALUE,
195 OPTION_SERVER_PASSWORD,
196 OPTION_AS_REALM,
197 OPTION_AS_CLIENT_NAME,
198 OPTION_AS_PASSWORD,
199 OPTION_TGS_REALM,
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"
212 struct arguments
214 int silent, verbose, verbose_library;
215 char *etypes;
216 char *lib_options;
217 int command;
218 char *ticketfile;
219 char *ticketwritefile;
220 const char *realm;
221 char *systemcfgfile;
222 char *usercfgfile;
223 /* kdc/as/tgs and ap */
224 char *authenticatorwritefile;
225 int authenticatorwritetype;
226 char *apreqwritefile;
227 int apreqwritetype;
228 /* kdc/as/tgs */
229 const char *cname;
230 const char *sname;
231 char *tgtname;
232 int forceas_p;
233 int forcetgs_p;
234 int request_p;
235 int sendrecv_p;
236 int response_p;
237 char *kdcreqwritefile;
238 int kdcreqwritetype;
239 char *kdcreqreadfile;
240 int kdcreqreadtype;
241 char *kdcrepwritefile;
242 int kdcrepwritetype;
243 char *kdcrepreadfile;
244 int kdcrepreadtype;
245 /* ap */
246 char *apreqreadfile;
247 int apreqreadtype;
248 char *servername;
249 char *authenticatorreadfile;
250 int authenticatorreadtype;
251 char *authenticatordatareadfile;
252 int authenticatordatareadtype;
253 char *authenticatordata;
254 /* crypto */
255 int algorithm;
256 int encrypt_p;
257 int decrypt_p;
258 char *password;
259 char *salt;
260 char *parameter;
261 int random;
262 int kvno;
263 char *keyvalue;
264 int keyusage;
265 char *readkeyfile;
266 char *writekeyfile;
267 char *inputfile;
268 int inputtype;
269 char *outputfile;
270 int outputtype;
271 /* client */
272 int apoptions;
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);
285 #endif