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