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
|
#define OPTS_FORWARD_CREDS 0x00000020
#define OPTS_FORWARDABLE_CREDS 0x00000010
#define RCMD_BUFSIZ 5120
enum kcmd_proto {
/* Old protocol: DES encryption only. No subkeys. No protection
for cleartext length. No ivec supplied. OOB hacks used for
rlogin. Checksum may be omitted at connection startup. */
KCMD_OLD_PROTOCOL = 1,
/* New protocol: Any encryption scheme. Client-generated subkey
required. Prepend cleartext-length to cleartext data (but don't
include it in count). Starting ivec defined, chained. In-band
signalling. Checksum required. */
KCMD_NEW_PROTOCOL,
/* Hack: Get credentials, and use the old protocol iff the session
key type is single-DES. */
KCMD_PROTOCOL_COMPAT_HACK,
/* Using Kerberos version 4. */
KCMD_V4_PROTOCOL,
/* ??? */
KCMD_UNKNOWN_PROTOCOL
};
extern int kcmd (int *sock, char **ahost, int /* u_short */ rport,
char *locuser, char *remuser, char *cmd,
int *fd2p, char *service, char *realm,
krb5_creds **cred,
krb5_int32 *seqno, krb5_int32 *server_seqno,
struct sockaddr_in *laddr,
struct sockaddr_in *faddr,
krb5_auth_context *authconp,
krb5_flags authopts,
int anyport, int suppress_err,
enum kcmd_proto *protonum /* input and output */
);
extern int rcmd_stream_read (int fd, char *buf, size_t len, int secondary);
extern int rcmd_stream_write (int fd, char *buf, size_t len, int secondary);
extern int getport (int * /* portnum */, int * /* addrfamily */);
extern void rcmd_stream_init_krb5 (krb5_keyblock *in_keyblock,
int encrypt_flag, int lencheck,
int am_client, enum kcmd_proto protonum);
extern void rcmd_stream_init_normal(void);
#if defined(KRB5_KRB4_COMPAT) && !defined(SKIP_V4_PROTO)
extern void rcmd_stream_init_krb4(C_Block, int, int, int);
extern int k4cmd(int *sock, char **ahost, unsigned int rport,
char *locuser,
char *remuser, char *cmd, int *fd2p, KTEXT ticket,
char *service, char *realm, CREDENTIALS *cred,
Key_schedule schedule, MSG_DAT *msg_data,
struct sockaddr_in *laddr, struct sockaddr_in *faddr,
long authopts, int anyport);
#endif
#ifndef HAVE_STRSAVE
extern char *strsave(const char *sp);
#endif
krb5_error_code rd_and_store_for_creds(krb5_context context,
krb5_auth_context auth_context,
krb5_data *inbuf, krb5_ticket *ticket,
krb5_ccache *ccache);
int princ_maps_to_lname(krb5_principal principal, char *luser);
#ifdef NEED_SETENV
extern int setenv(char *, char *, int);
#endif
#include "fake-addrinfo.h"
#ifdef KRB_DEFS
krb5_error_code krb5_compat_recvauth(krb5_context, krb5_auth_context *,
krb5_pointer, char *, krb5_principal,
krb5_int32, krb5_keytab,
krb5_int32, char *, char *,
struct sockaddr_in *,
struct sockaddr_in *, char *,
krb5_ticket **, krb5_int32 *,
AUTH_DAT **, Key_schedule, char *);
krb5_error_code
krb5_compat_recvauth_version(krb5_context, krb5_auth_context *,
krb5_pointer, krb5_principal, krb5_int32,
krb5_keytab, krb5_int32, char *, char *,
struct sockaddr_in *, struct sockaddr_in *,
char *, krb5_ticket **, krb5_int32*,
AUTH_DAT **, Key_schedule, krb5_data *);
#endif
|