source: trunk/third/kermit/ckuat2.h @ 20081

Revision 20081, 11.6 KB checked in by zacheiss, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r20080, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2  C K U A T 2 . H  --  Kerberos headers for C-Kermit
3
4  Copyright (C) 1985, 2002,
5    Trustees of Columbia University in the City of New York.
6    All rights reserved.  See the C-Kermit COPYING.TXT file or the
7    copyright text in the ckcmai.c module for disclaimer and permissions.
8
9  Author:
10  Jeffrey E Altman (jaltman@columbia.edu) -- Kerberos IV and V intergration.
11*/
12/*
13 * Based on a concatenation of all necessary include files distributed with
14 * the Kerberos 5 NT Alpha 2 Telnet package from MIT.
15 */
16
17#ifndef KRB5_TELNET_H
18#define KRB5_TELNET_H
19/*-
20 * Copyright (c) 1991, 1993
21 *      The Regents of the University of California.  All rights reserved.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the above copyright
27 *    notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 *    notice, this list of conditions and the following disclaimer in the
30 *    documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 *    must display the following acknowledgement:
33 *      This product includes software developed by the University of
34 *      California, Berkeley and its contributors.
35 * 4. Neither the name of the University nor the names of its contributors
36 *    may be used to endorse or promote products derived from this software
37 *    without specific prior written permission.
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
40 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
42 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
43 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
44 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
45 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
47 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
48 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49 * SUCH DAMAGE.
50 *
51 *      @(#)encrypt.h   8.1 (Berkeley) 6/4/93
52 */
53
54/*
55 * Copyright (C) 1990 by the Massachusetts Institute of Technology
56 *
57 * Export of this software from the United States of America may
58 * require a specific license from the United States Government.
59 * It is the responsibility of any person or organization contemplating
60 * export to obtain such a license before exporting.
61 *
62 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
63 * distribute this software and its documentation for any purpose and
64 * without fee is hereby granted, provided that the above copyright
65 * notice appear in all copies and that both that copyright notice and
66 * this permission notice appear in supporting documentation, and that
67 * the name of M.I.T. not be used in advertising or publicity pertaining
68 * to distribution of the software without specific, written prior
69 * permission.  M.I.T. makes no representations about the suitability of
70 * this software for any purpose.  It is provided "as is" without express
71 * or implied warranty.
72 */
73
74#ifdef  CK_ENCRYPTION
75
76#ifndef __ENCRYPTION__
77#define __ENCRYPTION__
78
79#define DIR_DECRYPT             1
80#define DIR_ENCRYPT             2
81
82#ifndef CK_DES_C
83#ifndef NOBLOCKDEF
84typedef unsigned char Block[8];
85#endif /* NOBLOCKDEF */
86typedef unsigned char *BlockT;
87#ifndef KRB4    /* already defined in kerberosiv/des.h */
88typedef struct des_ks_struct { Block _; } Schedule[16];
89#else /* KRB4 */
90#ifndef OS2
91#ifndef NOBLOCKDEF    /* already defined in kerberosiv/des.h */
92typedef struct des_ks_struct { Block _; } Schedule[16];
93#endif /* NOBLOCKDEF */
94#endif /* OS2 */
95#endif /* KRB4 */
96
97#define VALIDKEY(key) (key[0]|key[1]|key[2]|key[3]|key[4]|key[5]|key[6]|key[7])
98
99#define SAMEKEY(k1, k2) (!memcmp((void *)k1, (void *)k2, sizeof(Block)))
100#endif /* CK_DES_C */
101
102typedef struct _session_key {
103  short         type;
104  int           length;
105  unsigned char *data;
106} Session_Key;
107
108#ifdef __STDC__
109typedef struct {
110  char  *name;
111  int   type;
112  void  (*output)(unsigned char *, int);
113  int   (*input)(int);
114  void  (*init)(int);
115  int   (*start)(int, int);
116  int   (*is)(unsigned char *, int);
117  int   (*reply)(unsigned char *, int);
118  int   (*session)(Session_Key *, int);
119  int   (*keyid)(int, unsigned char *, int *);
120  void  (*printsub)(unsigned char *, int, unsigned char *, int);
121} Encryptions;
122#if !defined(P)
123#define P(x) x
124#endif
125#else
126typedef struct {
127  char  *name;
128  int   type;
129  void  (*output)();
130  int   (*input)();
131  void  (*init)();
132  int   (*start)();
133  int   (*is)();
134  int   (*reply)();
135  int   (*session)();
136  int   (*keyid)();
137  void  (*printsub)();
138} Encryptions;
139#if !defined(P)
140#define P(x) ()
141#endif
142#endif
143
144int encrypt_parse(unsigned char *, int);
145
146#ifdef DEBUG
147int printsub(char, unsigned char *, size_t);
148#endif
149
150#define SK_GENERIC      0       /* Just a string of bits */
151#define SK_DES          1       /* Matched Kerberos v5 ENCTYPE_DES */
152
153void encrypt_init P((kstream,int));
154Encryptions *findencryption P((int));
155void encrypt_send_support P((void));
156void encrypt_auto P((int));
157void decrypt_auto P((int));
158int  encrypt_is P((unsigned char *, int));
159int  encrypt_reply P((unsigned char *, int));
160void encrypt_start_input P((int));
161int  encrypt_session_key P((Session_Key *, int));
162void encrypt_end_input P((void));
163void encrypt_start_output P((int));
164void encrypt_end_output P((void));
165void encrypt_send_request_start P((void));
166void encrypt_send_request_end P((void));
167void encrypt_send_end P((void));
168void encrypt_wait P((void));
169int  encrypt_is_encrypting P((void));
170void encrypt_send_support P((void));
171int  encrypt_send_keyid P((int, unsigned char *, int, int));
172
173int encrypt_cmd P((int, char **));
174void encrypt_display P((void));
175
176#ifdef CK_KERBEROS
177void krbdes_encrypt P((unsigned char *, int));
178int  krbdes_decrypt P((int));
179int  krbdes_is P((unsigned char *, int));
180int  krbdes_reply P((unsigned char *, int));
181void krbdes_init P((int));
182int  krbdes_start P((int, int));
183void krbdes_session P((Session_Key *, int));
184void krbdes_printsub P((unsigned char *, int, unsigned char *, int));
185#endif /* CK_KERBEROS */
186
187void cfb64_encrypt P((unsigned char *, int));
188int cfb64_decrypt P((int));
189void cfb64_init P((int));
190int cfb64_start P((int, int));
191int cfb64_is P((unsigned char *, int));
192int cfb64_reply P((unsigned char *, int));
193int cfb64_session P((Session_Key *, int));
194int cfb64_keyid P((int, unsigned char *, int *));
195void cfb64_printsub P((unsigned char *, int, unsigned char *, int));
196
197void ofb64_encrypt P((unsigned char *, int));
198int ofb64_decrypt P((int));
199void ofb64_init P((int));
200int ofb64_start P((int, int));
201int ofb64_is P((unsigned char *, int));
202int ofb64_reply P((unsigned char *, int));
203int ofb64_session P((Session_Key *, int));
204int ofb64_keyid P((int, unsigned char *, int *));
205void ofb64_printsub P((unsigned char *, int, unsigned char *, int));
206
207void des3_cfb64_encrypt P((unsigned char *, int));
208int  des3_cfb64_decrypt P((int));
209void des3_cfb64_init P((int));
210int  des3_cfb64_start P((int, int));
211int  des3_cfb64_is P((unsigned char *, int));
212int  des3_cfb64_reply P((unsigned char *, int));
213int  des3_cfb64_session P((Session_Key *, int));
214int  des3_cfb64_keyid P((int, unsigned char *, int *));
215void des3_cfb64_printsub P((unsigned char *, int, unsigned char *, int));
216
217void des3_ofb64_encrypt P((unsigned char *, int));
218int  des3_ofb64_decrypt P((int));
219void des3_ofb64_init P((int));
220int  des3_ofb64_start P((int, int));
221int  des3_ofb64_is P((unsigned char *, int));
222int  des3_ofb64_reply P((unsigned char *, int));
223int  des3_ofb64_session P((Session_Key *, int));
224int  des3_ofb64_keyid P((int, unsigned char *, int *));
225void des3_ofb64_printsub P((unsigned char *, int, unsigned char *, int));
226
227#ifdef CAST_ENCRYPTION
228void cast_cfb64_encrypt P((unsigned char *, int));
229int  cast_cfb64_decrypt P((int));
230void cast_cfb64_init P((int));
231int  cast_cfb64_start P((int, int));
232int  cast_cfb64_is P((unsigned char *, int));
233int  cast_cfb64_reply P((unsigned char *, int));
234int  cast_cfb64_session P((Session_Key *, int));
235int  cast_cfb64_keyid P((int, unsigned char *, int *));
236void cast_cfb64_printsub P((unsigned char *, int, unsigned char *, int));
237
238void cast_ofb64_encrypt P((unsigned char *, int));
239int  cast_ofb64_decrypt P((int));
240void cast_ofb64_init P((int));
241int  cast_ofb64_start P((int, int));
242int  cast_ofb64_is P((unsigned char *, int));
243int  cast_ofb64_reply P((unsigned char *, int));
244int  cast_ofb64_session P((Session_Key *, int));
245int  cast_ofb64_keyid P((int, unsigned char *, int *));
246void cast_ofb64_printsub P((unsigned char *, int, unsigned char *, int));
247
248void castexp_cfb64_encrypt P((unsigned char *, int));
249int  castexp_cfb64_decrypt P((int));
250void castexp_cfb64_init P((int));
251int  castexp_cfb64_start P((int, int));
252int  castexp_cfb64_is P((unsigned char *, int));
253int  castexp_cfb64_reply P((unsigned char *, int));
254int  castexp_cfb64_session P((Session_Key *, int));
255int  castexp_cfb64_keyid P((int, unsigned char *, int *));
256void castexp_cfb64_printsub P((unsigned char *, int, unsigned char *, int));
257
258void castexp_ofb64_encrypt P((unsigned char *, int));
259int  castexp_ofb64_decrypt P((int));
260void castexp_ofb64_init P((int));
261int  castexp_ofb64_start P((int, int));
262int  castexp_ofb64_is P((unsigned char *, int));
263int  castexp_ofb64_reply P((unsigned char *, int));
264int  castexp_ofb64_session P((Session_Key *, int));
265int  castexp_ofb64_keyid P((int, unsigned char *, int *));
266void castexp_ofb64_printsub P((unsigned char *, int, unsigned char *, int));
267#endif /* CAST_ENCRYPTION */
268
269/* int  des_string_to_key P((char *, Block)); */
270
271#ifdef DEBUG
272extern int encrypt_debug_mode;
273#endif
274
275#ifndef CRYPT_DLL
276extern int (*decrypt_input) P((int));
277extern void (*encrypt_output) P((unsigned char *, int));
278#endif /* CRYPT_DLL */
279
280int decrypt_ks_hack(unsigned char *, int);
281
282#endif /* __ENCRYPTION__ */
283#endif /* ENCRYPTION */
284
285#ifdef CRYPT_DLL
286struct _crypt_dll_init {
287    int version;
288
289    /* Version 1 variables */
290    int (*p_ttol)(char *,int);
291    int (*p_dodebug)(int,char *,char *,long);
292    int (*p_dohexdump)(char *,char *,int);
293    void (*p_tn_debug)(char *);
294    int (*p_vscrnprintf)(char *, ...);
295
296    /* Version 2 variables */
297    void * p_k5_context;
298
299    /* Version 3 variables */
300    void (*p_install_funcs)(char *,void *);
301
302    /* Version 5 variables */
303    unsigned long (*p_reqtelmutex)(unsigned long);
304    unsigned long (*p_reltelmutex)(void);
305};
306#endif /* CRYPT_DLL */
307
308/* per Kerberos v5 protocol spec */
309#ifndef ENCTYPE_NULL
310#define ENCTYPE_NULL            0x0000
311#endif
312#ifndef  ENCTYPE_DES_CBC_CRC
313#define ENCTYPE_DES_CBC_CRC     0x0001  /* DES cbc mode with CRC-32 */
314#endif
315#ifndef  ENCTYPE_DES_CBC_MD4
316#define ENCTYPE_DES_CBC_MD4     0x0002  /* DES cbc mode with RSA-MD4 */
317#endif
318#ifndef  ENCTYPE_DES_CBC_MD5
319#define ENCTYPE_DES_CBC_MD5     0x0003  /* DES cbc mode with RSA-MD5 */
320#endif
321#ifndef  ENCTYPE_DES_CBC_RAW
322#define ENCTYPE_DES_CBC_RAW     0x0004  /* DES cbc mode raw */
323#endif
324/* XXX deprecated? */
325#ifndef  ENCTYPE_DES3_CBC_SHA
326#define ENCTYPE_DES3_CBC_SHA    0x0005  /* DES-3 cbc mode with NIST-SHA */
327#endif
328#ifndef  ENCTYPE_DES3_CBC_RAW
329#define ENCTYPE_DES3_CBC_RAW    0x0006  /* DES-3 cbc mode raw */
330#endif
331#ifndef  ENCTYPE_DES_HMAC_SHA1
332#define ENCTYPE_DES_HMAC_SHA1   0x0008
333#endif
334#ifndef  ENCTYPE_DES3_CBC_SHA1
335#define ENCTYPE_DES3_CBC_SHA1  0x0010
336#endif
337#ifndef  ENCTYPE_UNKNOWN
338#define ENCTYPE_UNKNOWN         0x01ff
339#endif
340/* local crud */
341/* marc's DES-3 with 32-bit length */
342#ifndef  ENCTYPE_LOCAL_DES3_HMAC_SHA1
343#define ENCTYPE_LOCAL_DES3_HMAC_SHA1 0x7007
344#endif
345#endif /* KRB5_TELNET_H */
Note: See TracBrowser for help on using the repository browser.