Protoize
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@993 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -198,10 +198,8 @@ static Authenticator NoAuth = { 0 };
|
|||||||
static int i_support = 0;
|
static int i_support = 0;
|
||||||
static int i_wont_support = 0;
|
static int i_wont_support = 0;
|
||||||
|
|
||||||
Authenticator *
|
Authenticator *
|
||||||
findauthenticator(type, way)
|
findauthenticator(int type, int way)
|
||||||
int type;
|
|
||||||
int way;
|
|
||||||
{
|
{
|
||||||
Authenticator *ap = authenticators;
|
Authenticator *ap = authenticators;
|
||||||
|
|
||||||
@@ -210,10 +208,8 @@ findauthenticator(type, way)
|
|||||||
return(ap->type ? ap : 0);
|
return(ap->type ? ap : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_init(name, server)
|
auth_init(char *name, int server)
|
||||||
char *name;
|
|
||||||
int server;
|
|
||||||
{
|
{
|
||||||
Authenticator *ap = authenticators;
|
Authenticator *ap = authenticators;
|
||||||
|
|
||||||
@@ -238,9 +234,8 @@ auth_init(name, server)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_disable_name(name)
|
auth_disable_name(char *name)
|
||||||
char *name;
|
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
for (x = 0; x < AUTHTYPE_CNT; ++x) {
|
for (x = 0; x < AUTHTYPE_CNT; ++x) {
|
||||||
@@ -251,10 +246,8 @@ auth_disable_name(name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
getauthmask(type, maskp)
|
getauthmask(char *type, int *maskp)
|
||||||
char *type;
|
|
||||||
int *maskp;
|
|
||||||
{
|
{
|
||||||
register int x;
|
register int x;
|
||||||
|
|
||||||
@@ -272,24 +265,20 @@ getauthmask(type, maskp)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
auth_enable(type)
|
auth_enable(char *type)
|
||||||
char *type;
|
|
||||||
{
|
{
|
||||||
return(auth_onoff(type, 1));
|
return(auth_onoff(type, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
auth_disable(type)
|
auth_disable(char *type)
|
||||||
char *type;
|
|
||||||
{
|
{
|
||||||
return(auth_onoff(type, 0));
|
return(auth_onoff(type, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
auth_onoff(type, on)
|
auth_onoff(char *type, int on)
|
||||||
char *type;
|
|
||||||
int on;
|
|
||||||
{
|
{
|
||||||
int i, mask = -1;
|
int i, mask = -1;
|
||||||
Authenticator *ap;
|
Authenticator *ap;
|
||||||
@@ -319,9 +308,8 @@ auth_onoff(type, on)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
auth_togdebug(on)
|
auth_togdebug(int on)
|
||||||
int on;
|
|
||||||
{
|
{
|
||||||
if (on < 0)
|
if (on < 0)
|
||||||
auth_debug_mode ^= 1;
|
auth_debug_mode ^= 1;
|
||||||
@@ -331,8 +319,8 @@ auth_togdebug(on)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
auth_status()
|
auth_status(void)
|
||||||
{
|
{
|
||||||
Authenticator *ap;
|
Authenticator *ap;
|
||||||
int i, mask;
|
int i, mask;
|
||||||
@@ -358,8 +346,8 @@ auth_status()
|
|||||||
* This routine is called by the server to start authentication
|
* This routine is called by the server to start authentication
|
||||||
* negotiation.
|
* negotiation.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
auth_request()
|
auth_request(void)
|
||||||
{
|
{
|
||||||
static unsigned char str_request[64] = { IAC, SB,
|
static unsigned char str_request[64] = { IAC, SB,
|
||||||
TELOPT_AUTHENTICATION,
|
TELOPT_AUTHENTICATION,
|
||||||
@@ -398,10 +386,8 @@ auth_request()
|
|||||||
* with KERBEROS instead of LOGIN (which is against what the
|
* with KERBEROS instead of LOGIN (which is against what the
|
||||||
* protocol says)) you will have to hack this code...
|
* protocol says)) you will have to hack this code...
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
auth_send(data, cnt)
|
auth_send(unsigned char *data, int cnt)
|
||||||
unsigned char *data;
|
|
||||||
int cnt;
|
|
||||||
{
|
{
|
||||||
Authenticator *ap;
|
Authenticator *ap;
|
||||||
static unsigned char str_none[] = { IAC, SB, TELOPT_AUTHENTICATION,
|
static unsigned char str_none[] = { IAC, SB, TELOPT_AUTHENTICATION,
|
||||||
@@ -484,8 +470,8 @@ auth_send(data, cnt)
|
|||||||
#endif /* KANNAN */
|
#endif /* KANNAN */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_send_retry()
|
auth_send_retry(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* if auth_send_cnt <= 0 then auth_send will end up rejecting
|
* if auth_send_cnt <= 0 then auth_send will end up rejecting
|
||||||
@@ -494,10 +480,8 @@ auth_send_retry()
|
|||||||
auth_send(auth_send_data, auth_send_cnt);
|
auth_send(auth_send_data, auth_send_cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_is(data, cnt)
|
auth_is(unsigned char *data, int cnt)
|
||||||
unsigned char *data;
|
|
||||||
int cnt;
|
|
||||||
{
|
{
|
||||||
Authenticator *ap;
|
Authenticator *ap;
|
||||||
|
|
||||||
@@ -517,10 +501,8 @@ auth_is(data, cnt)
|
|||||||
Name, *data);
|
Name, *data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_reply(data, cnt)
|
auth_reply(unsigned char *data, int cnt)
|
||||||
unsigned char *data;
|
|
||||||
int cnt;
|
|
||||||
{
|
{
|
||||||
Authenticator *ap;
|
Authenticator *ap;
|
||||||
|
|
||||||
@@ -535,10 +517,8 @@ auth_reply(data, cnt)
|
|||||||
Name, *data);
|
Name, *data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_name(data, cnt)
|
auth_name(unsigned char *data, int cnt)
|
||||||
unsigned char *data;
|
|
||||||
int cnt;
|
|
||||||
{
|
{
|
||||||
unsigned char savename[256];
|
unsigned char savename[256];
|
||||||
|
|
||||||
@@ -560,10 +540,8 @@ auth_name(data, cnt)
|
|||||||
auth_encrypt_user(savename);
|
auth_encrypt_user(savename);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
auth_sendname(cp, len)
|
auth_sendname(unsigned char *cp, int len)
|
||||||
unsigned char *cp;
|
|
||||||
int len;
|
|
||||||
{
|
{
|
||||||
static unsigned char str_request[256+6]
|
static unsigned char str_request[256+6]
|
||||||
= { IAC, SB, TELOPT_AUTHENTICATION, TELQUAL_NAME, };
|
= { IAC, SB, TELOPT_AUTHENTICATION, TELQUAL_NAME, };
|
||||||
@@ -583,27 +561,23 @@ auth_sendname(cp, len)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_finished(ap, result)
|
auth_finished(Authenticator *ap, int result)
|
||||||
Authenticator *ap;
|
|
||||||
int result;
|
|
||||||
{
|
{
|
||||||
if (!(authenticated = ap))
|
if (!(authenticated = ap))
|
||||||
authenticated = &NoAuth;
|
authenticated = &NoAuth;
|
||||||
validuser = result;
|
validuser = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
auth_intr(sig)
|
auth_intr(int sig)
|
||||||
int sig;
|
|
||||||
{
|
{
|
||||||
auth_finished(0, AUTH_REJECT);
|
auth_finished(0, AUTH_REJECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
auth_wait(name)
|
auth_wait(char *name)
|
||||||
char *name;
|
|
||||||
{
|
{
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
printf(">>>%s: in auth_wait.\r\n", Name);
|
printf(">>>%s: in auth_wait.\r\n", Name);
|
||||||
@@ -634,17 +608,14 @@ auth_wait(name)
|
|||||||
return(validuser);
|
return(validuser);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_debug(mode)
|
auth_debug(int mode)
|
||||||
int mode;
|
|
||||||
{
|
{
|
||||||
auth_debug_mode = mode;
|
auth_debug_mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_printsub(data, cnt, buf, buflen)
|
auth_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
|
||||||
unsigned char *data, *buf;
|
|
||||||
int cnt, buflen;
|
|
||||||
{
|
{
|
||||||
Authenticator *ap;
|
Authenticator *ap;
|
||||||
|
|
||||||
@@ -654,10 +625,8 @@ auth_printsub(data, cnt, buf, buflen)
|
|||||||
auth_gen_printsub(data, cnt, buf, buflen);
|
auth_gen_printsub(data, cnt, buf, buflen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
auth_gen_printsub(data, cnt, buf, buflen)
|
auth_gen_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
|
||||||
unsigned char *data, *buf;
|
|
||||||
int cnt, buflen;
|
|
||||||
{
|
{
|
||||||
register unsigned char *cp;
|
register unsigned char *cp;
|
||||||
unsigned char tbuf[16];
|
unsigned char tbuf[16];
|
||||||
|
Reference in New Issue
Block a user