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

Revision 20081, 8.0 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/*  C K U A T H . H --  "C-Kermit to Authentication" interface  */
2
3/*
4  Author: Jeffrey Altman <jaltman@columbia.edu>,
5  Columbia University Academic Information Systems, New York City.
6
7  Copyright (C) 1999, 2002,
8    Trustees of Columbia University in the City of New York.
9    All rights reserved.  See the C-Kermit COPYING.TXT file or the
10    copyright text in the ckcmai.c module for disclaimer and permissions.
11*/
12
13/*
14 * Based on a concatenation of all necessary include files distributed with
15 * the Kerberos 5 NT Alpha 2 Telnet package from MIT.
16 */
17
18#ifndef KRB5_KERMIT_H
19#define KRB5_KERMIT_H
20
21#ifndef BOOL
22#define BOOL int
23#endif
24
25/* Header file for encrypted-stream library.
26 * Written by Ken Raeburn (Raeburn@Cygnus.COM).
27 * Copyright (C) 1991, 1992, 1994 by Cygnus Support.
28 *
29 * Permission to use, copy, modify, and
30 * distribute this software and its documentation for any purpose and
31 * without fee is hereby granted, provided that the above copyright
32 * notice appear in all copies and that both that copyright notice and
33 * this permission notice appear in supporting documentation.
34 * Cygnus Support makes no representations about the suitability of
35 * this software for any purpose.  It is provided "as is" without express
36 * or implied warranty.
37 */
38
39#ifndef K5STREAM_H
40#define K5STREAM_H
41
42typedef void *kstream_ptr;                      /* Data send on the kstream */
43struct kstream_data_block {
44  kstream_ptr ptr;
45  size_t length;
46};
47
48typedef struct kstream_int {                    /* Object we pass around */
49    int fd;                                       /* Open socket descriptor */
50    int (*encrypt)(struct kstream_data_block *, /* output */
51                   struct kstream_data_block *); /* input */
52    int encrypt_type;
53    int (*decrypt)(struct kstream_data_block *, /* output */
54                   struct kstream_data_block *); /* input */
55    int decrypt_type;
56} *kstream;
57
58/* Prototypes */
59
60int  kstream_destroy();
61void kstream_set_buffer_mode(int);
62int  kstream_create_from_fd(int fd, kstream_ptr);
63int kstream_write(void *, size_t);
64int kstream_read(void *, size_t);
65
66#endif /* K5STREAM_H */
67
68/*
69 * Implements Telnet authentication and encryption
70 */
71
72#ifndef TELNET_AUTH_H
73#define TELNET_AUTH_H
74
75int auth_parse(unsigned char *, int);
76
77int auth_init(kstream);
78
79void auth_destroy(void);
80
81int auth_encrypt(struct kstream_data_block *, struct kstream_data_block *);
82
83int auth_decrypt(struct kstream_data_block *, struct kstream_data_block *);
84
85extern BOOL forward_flag;
86extern BOOL forwardable_flag;
87extern BOOL forwarded_tickets;
88#endif /* TEL_AUTH_H */
89
90
91/* C-Kermit specific functions */
92_PROTOTYP(void auth_finished,(int));
93_PROTOTYP(int ck_auth_init, (char *, char *, char *, int));
94_PROTOTYP(int ck_tn_auth_valid, (VOID));
95_PROTOTYP(int ck_tn_auth_in_progress,(VOID));
96_PROTOTYP(int ck_tn_sb_auth, (char *, int));
97_PROTOTYP(int ck_tn_sb_encrypt, (char *, int));
98_PROTOTYP(int ck_tn_auth_request, (VOID));
99_PROTOTYP(void ck_tn_encrypt, (char *, int));
100_PROTOTYP(void ck_tn_decrypt, (char *, int));
101_PROTOTYP(void ck_tn_encrypt_start, (VOID));
102_PROTOTYP(void ck_tn_encrypt_stop, (VOID));
103_PROTOTYP(int ck_tn_authenticated, (VOID));
104#ifdef CK_ENCRYPTION
105_PROTOTYP(int ck_tn_encrypting, (VOID));
106_PROTOTYP(int ck_tn_decrypting, (VOID));
107#endif /* CK_ENCRYPTION */
108#ifdef CK_SSL
109_PROTOTYP(int ck_tn_tls_negotiate, (VOID));
110_PROTOTYP(int SendSSLAuthSB, (int, void *, int));
111#endif /* CK_SSL */
112
113#ifdef CK_KERBEROS
114    /* Define MIT_CURRENT to compile the code for use with versions of */
115    /* Kerberos later than KRB5 1.0.5.  Note.  This will not compile   */
116    /* successfully in Kermit 95 due to the segmentation of crypto     */
117    /* into a separate DLL.                                            */
118
119#define KRB_DEFTIM 600                  /* Default lifetime (minutes) */
120
121/* Kerberos structure definitions */
122
123struct krb_op_data {                    /* Operational data for all actions */
124    int version;                        /* Kerberos version    */
125    char * cache;                       /* Kerberos cache file */
126};
127
128struct krb4_init_data {                 /* INITIALIZE data structure */
129    int lifetime;
130    char * principal;                   /* Principal string */
131    char * instance;
132    char * realm;                       /* Realm string */
133    char * password;                    /* Kerberos password */
134    int    preauth;                     /* Use preauth mode? */
135    int    verbose;                     /* Verbose output? */
136};
137
138#define KRB5_NUM_OF_ADDRS 16
139struct krb5_init_data {                 /* INITIALIZE data structure */
140    int forwardable;                    /* Switch values */
141    int proxiable;                      /* Correspond to switch names... */
142    int lifetime;
143    int renew;
144    int renewable;
145    int validate;
146    char * postdate;
147    char * service;
148    char * principal;                   /* Principal string */
149    char * instance;
150    char * realm;                       /* Realm string */
151    char * password;                    /* Kerberos password */
152    int    preauth;                     /* Use preauth mode? */
153    int    verbose;                     /* Verbose output? */
154    int    getk4;                       /* Get K4 TGT? */
155    char * addrs[KRB5_NUM_OF_ADDRS+1];  /* List of IP Addresses */
156    int  no_addresses;                  /* Do not include IP Addresses */
157};
158
159struct krb5_list_cred_data {            /* List Credentials data */
160    int encryption;
161    int flags;
162    int addr;
163};
164
165_PROTOTYP(int ck_krb5_autoget_TGT, (char *));
166_PROTOTYP(int ck_krb5_initTGT, (struct krb_op_data *,struct krb5_init_data *,
167                                 struct krb4_init_data *));
168_PROTOTYP(int ck_krb5_destroy, (struct krb_op_data *));
169_PROTOTYP(int ck_krb5_list_creds, (struct krb_op_data *,
170                                    struct krb5_list_cred_data *));
171_PROTOTYP(char * ck_krb5_getrealm, (char *));
172_PROTOTYP(char * ck_krb5_getprincipal, (char *));
173_PROTOTYP(char * ck_krb5_get_cc_name, (VOID));
174
175_PROTOTYP(int ck_krb4_autoget_TGT, (char *));
176_PROTOTYP(int ck_krb4_initTGT, (struct krb_op_data *,struct krb4_init_data *));
177_PROTOTYP(int ck_krb4_destroy, (struct krb_op_data *));
178_PROTOTYP(int ck_krb4_list_creds, (struct krb_op_data *));
179_PROTOTYP(char * ck_krb4_getrealm, (VOID));
180_PROTOTYP(char * ck_krb4_getprincipal, (VOID));
181
182_PROTOTYP(int ck_krb4_get_tkts, (VOID));
183_PROTOTYP(char * ck_krb4_get_next_tkt, (VOID));
184_PROTOTYP(int ck_krb4_tkt_isvalid,(char *));
185_PROTOTYP(int ck_krb4_is_tgt_valid,(VOID));
186_PROTOTYP(int ck_krb4_tkt_time,(char *));
187
188_PROTOTYP(int ck_krb5_get_tkts, (char *));
189_PROTOTYP(char * ck_krb5_get_next_tkt, (VOID));
190_PROTOTYP(int ck_krb5_tkt_isvalid,(char *,char *));
191_PROTOTYP(char * ck_krb5_tkt_flags,(char *,char *));
192_PROTOTYP(int ck_krb5_is_tgt_valid,(VOID));
193_PROTOTYP(int ck_krb5_tkt_time,(char *,char *));
194
195_PROTOTYP(int krb4_des_avail,(int));
196_PROTOTYP(int krb4_des_write,(int,char *,int));
197_PROTOTYP(int krb4_des_read, (int,char *,int));
198_PROTOTYP(int krb5_des_avail,(int));
199_PROTOTYP(int krb5_des_write,(int,char *,int,int));
200_PROTOTYP(int krb5_des_read, (int,char *,int,int));
201_PROTOTYP(int krb5_u2u_avail,(int));
202_PROTOTYP(int krb5_u2u_write,(int,char *,int));
203_PROTOTYP(int krb5_u2u_read, (int,char *,int));
204_PROTOTYP(int k5_user_to_user_server_auth,(VOID));
205_PROTOTYP(int k5_user_to_user_client_auth,(VOID));
206#endif /* CK_KERBEROS */
207
208_PROTOTYP(int ck_krb5_is_installed,(void));
209_PROTOTYP(int ck_krb4_is_installed,(void));
210_PROTOTYP(int ck_srp_is_installed,(void));
211_PROTOTYP(int ck_ntlm_is_installed,(void));
212_PROTOTYP(int ck_crypt_is_installed,(void));
213_PROTOTYP(int ck_ssleay_is_installed,(void));
214_PROTOTYP(int ck_gssapi_is_installed,(void));
215_PROTOTYP(int ck_krypto_is_installed,(void));
216
217_PROTOTYP(VOID ck_encrypt_send_support,(VOID));
218_PROTOTYP(int ck_get_crypt_table,(struct keytab **, int *));
219_PROTOTYP(char * ck_krb4_realmofhost,(char *));
220_PROTOTYP(char * ck_krb5_realmofhost,(char *));
221
222#define FORWARD  /* allow forwarding of credential */
223#ifdef FORWARD
224_PROTOTYP(int kerberos5_forward,(VOID));
225#endif /* FORWARD */
226
227#define AUTHTYPLSTSZ 8
228#endif /*KRB5_KERMIT_H*/
Note: See TracBrowser for help on using the repository browser.