git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@992 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1996-11-17 00:04:20 +00:00
parent 6ffcd51d18
commit 74c0bb16f5
4 changed files with 952 additions and 979 deletions

View File

@@ -98,17 +98,17 @@ static char *Name = "Noname";
static long i_support_encrypt = typemask(ENCTYPE_DES_CFB64) static long i_support_encrypt = typemask(ENCTYPE_DES_CFB64)
| typemask(ENCTYPE_DES_OFB64); | typemask(ENCTYPE_DES_OFB64);
static long i_support_decrypt = typemask(ENCTYPE_DES_CFB64) static long i_support_decrypt = typemask(ENCTYPE_DES_CFB64)
| typemask(ENCTYPE_DES_OFB64); | typemask(ENCTYPE_DES_OFB64);
static long i_wont_support_encrypt = 0; static long i_wont_support_encrypt = 0;
static long i_wont_support_decrypt = 0; static long i_wont_support_decrypt = 0;
#define I_SUPPORT_ENCRYPT (i_support_encrypt & ~i_wont_support_encrypt) #define I_SUPPORT_ENCRYPT (i_support_encrypt & ~i_wont_support_encrypt)
#define I_SUPPORT_DECRYPT (i_support_decrypt & ~i_wont_support_decrypt) #define I_SUPPORT_DECRYPT (i_support_decrypt & ~i_wont_support_decrypt)
static long remote_supports_encrypt = 0; static long remote_supports_encrypt = 0;
static long remote_supports_decrypt = 0; static long remote_supports_decrypt = 0;
static Encryptions encryptions[] = { static Encryptions encryptions[] = {
#if defined(DES_ENCRYPTION) #if defined(DES_ENCRYPTION)
{ "DES_CFB64", ENCTYPE_DES_CFB64, { "DES_CFB64", ENCTYPE_DES_CFB64,
cfb64_encrypt, cfb64_encrypt,
@@ -132,7 +132,7 @@ static Encryptions encryptions[] = {
ofb64_printsub }, ofb64_printsub },
#endif #endif
{ 0, }, { 0, },
}; };
static unsigned char str_send[64] = { IAC, SB, TELOPT_ENCRYPT, static unsigned char str_send[64] = { IAC, SB, TELOPT_ENCRYPT,
ENCRYPT_SUPPORT }; ENCRYPT_SUPPORT };

View File

@@ -46,7 +46,8 @@ static char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95";
* the length of *s1 is returned. * the length of *s1 is returned.
*/ */
int isprefix(char *s1, char *s2) int
isprefix(char *s1, char *s2)
{ {
char *os1; char *os1;
register char c1, c2; register char c1, c2;
@@ -67,11 +68,11 @@ int isprefix(char *s1, char *s2)
static char *ambiguous; /* special return value for command routines */ static char *ambiguous; /* special return value for command routines */
char ** char **
genget(name, table, stlen) genget(char *name, char **table, int stlen)
char *name; /* name to match */ /* name to match */
char **table; /* name entry in table */ /* name entry in table */
int stlen;
{ {
register char **c, **found; register char **c, **found;
register int n; register int n;
@@ -95,9 +96,8 @@ genget(name, table, stlen)
/* /*
* Function call version of Ambiguous() * Function call version of Ambiguous()
*/ */
int int
Ambiguous(s) Ambiguous(char *s)
char *s;
{ {
return((char **)s == &ambiguous); return((char **)s == &ambiguous);
} }

View File

@@ -103,12 +103,8 @@ static des_cblock session_key;
static des_key_schedule sched; static des_key_schedule sched;
static des_cblock challenge; static des_cblock challenge;
static int static int
Data(ap, type, d, c) Data(Authenticator *ap, int type, void *d, int c)
Authenticator *ap;
int type;
void *d;
int c;
{ {
unsigned char *p = str_data + 4; unsigned char *p = str_data + 4;
unsigned char *cd = (unsigned char *)d; unsigned char *cd = (unsigned char *)d;
@@ -138,10 +134,8 @@ Data(ap, type, d, c)
return(net_write(str_data, p - str_data)); return(net_write(str_data, p - str_data));
} }
int int
kerberos4_init(ap, server) kerberos4_init(Authenticator *ap, int server)
Authenticator *ap;
int server;
{ {
FILE *fp; FILE *fp;
@@ -165,8 +159,8 @@ kerberos4_send(char *name, Authenticator *ap)
KTEXT_ST auth; KTEXT_ST auth;
char instance[INST_SZ]; char instance[INST_SZ];
char *realm; char *realm;
char *krb_realmofhost(); char *krb_realmofhost(const char *);
char *krb_get_phost(); char *krb_get_phost(const char *);
CREDENTIALS cred; CREDENTIALS cred;
int r; int r;
@@ -263,11 +257,8 @@ kerberos4_send_oneway(Authenticator *ap)
return kerberos4_send("KERBEROS4", ap); return kerberos4_send("KERBEROS4", ap);
} }
void void
kerberos4_is(ap, data, cnt) kerberos4_is(Authenticator *ap, unsigned char *data, int cnt)
Authenticator *ap;
unsigned char *data;
int cnt;
{ {
char realm[REALM_SZ]; char realm[REALM_SZ];
char instance[INST_SZ]; char instance[INST_SZ];
@@ -368,11 +359,8 @@ kerberos4_is(ap, data, cnt)
} }
} }
void void
kerberos4_reply(ap, data, cnt) kerberos4_reply(Authenticator *ap, unsigned char *data, int cnt)
Authenticator *ap;
unsigned char *data;
int cnt;
{ {
Session_Key skey; Session_Key skey;
@@ -424,11 +412,8 @@ kerberos4_reply(ap, data, cnt)
} }
} }
int int
kerberos4_status(ap, name, level) kerberos4_status(Authenticator *ap, char *name, int level)
Authenticator *ap;
char *name;
int level;
{ {
if (level < AUTH_USER) if (level < AUTH_USER)
return(level); return(level);
@@ -443,10 +428,8 @@ kerberos4_status(ap, name, level)
#define BUMP(buf, len) while (*(buf)) {++(buf), --(len);} #define BUMP(buf, len) while (*(buf)) {++(buf), --(len);}
#define ADDC(buf, len, c) if ((len) > 0) {*(buf)++ = (c); --(len);} #define ADDC(buf, len, c) if ((len) > 0) {*(buf)++ = (c); --(len);}
void void
kerberos4_printsub(data, cnt, buf, buflen) kerberos4_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
unsigned char *data, *buf;
int cnt, buflen;
{ {
char lbuf[32]; char lbuf[32];
register int i; register int i;
@@ -498,10 +481,8 @@ kerberos4_printsub(data, cnt, buf, buflen)
} }
} }
int int
kerberos4_cksum(d, n) kerberos4_cksum(unsigned char *d, int n)
unsigned char *d;
int n;
{ {
int ck = 0; int ck = 0;

View File

@@ -45,12 +45,8 @@ char *LocalHostName;
char *UserNameRequested = 0; char *UserNameRequested = 0;
int ConnectedCount = 0; int ConnectedCount = 0;
void void
auth_encrypt_init(local, remote, name, server) auth_encrypt_init(char *local, char *remote, char *name, int server)
char *local;
char *remote;
char *name;
int server;
{ {
RemoteHostName = remote; RemoteHostName = remote;
LocalHostName = local; LocalHostName = local;
@@ -66,27 +62,23 @@ auth_encrypt_init(local, remote, name, server)
} }
} }
void void
auth_encrypt_user(name) auth_encrypt_user(char *name)
char *name;
{ {
extern char *strdup(); extern char *strdup(const char *);
if (UserNameRequested) if (UserNameRequested)
free(UserNameRequested); free(UserNameRequested);
UserNameRequested = name ? strdup(name) : 0; UserNameRequested = name ? strdup(name) : 0;
} }
void void
auth_encrypt_connect(cnt) auth_encrypt_connect(int cnt)
int cnt;
{ {
} }
void void
printd(data, cnt) printd(unsigned char *data, int cnt)
unsigned char *data;
int cnt;
{ {
if (cnt > 16) if (cnt > 16)
cnt = 16; cnt = 16;