fix WARNS=2 warnings

This commit is contained in:
lukem 2001-11-30 04:44:24 +00:00
parent 0046f5dadd
commit 0878e1d37d
2 changed files with 33 additions and 33 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: enc_des.c,v 1.5 2001/01/06 23:36:36 christos Exp $ */
/* $NetBSD: enc_des.c,v 1.6 2001/11/30 04:44:24 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)enc_des.c 8.3 (Berkeley) 5/30/95"; */
#else
__RCSID("$NetBSD: enc_des.c,v 1.5 2001/01/06 23:36:36 christos Exp $");
__RCSID("$NetBSD: enc_des.c,v 1.6 2001/11/30 04:44:24 lukem Exp $");
#endif
#endif /* not lint */
@ -602,23 +602,23 @@ cfb64_encrypt(s, c)
int c;
{
register struct stinfo *stp = &fb[CFB].streams[DIR_ENCRYPT-1];
register int index;
register int idx;
index = stp->str_index;
idx = stp->str_index;
while (c-- > 0) {
if (index == sizeof(Block)) {
if (idx == sizeof(Block)) {
Block b;
des_ecb_encrypt(&stp->str_output, &b, stp->str_sched, 1);
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
index = 0;
idx = 0;
}
/* On encryption, we store (feed ^ data) which is cypher */
*s = stp->str_output[index] = (stp->str_feed[index] ^ *s);
*s = stp->str_output[idx] = (stp->str_feed[idx] ^ *s);
s++;
index++;
idx++;
}
stp->str_index = index;
stp->str_index = idx;
}
int
@ -626,7 +626,7 @@ cfb64_decrypt(data)
int data;
{
register struct stinfo *stp = &fb[CFB].streams[DIR_DECRYPT-1];
int index;
int idx;
if (data == -1) {
/*
@ -639,18 +639,18 @@ cfb64_decrypt(data)
return(0);
}
index = stp->str_index++;
if (index == sizeof(Block)) {
idx = stp->str_index++;
if (idx == sizeof(Block)) {
Block b;
des_ecb_encrypt(&stp->str_output, &b, stp->str_sched, 1);
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
stp->str_index = 1; /* Next time will be 1 */
index = 0; /* But now use 0 */
idx = 0; /* But now use 0 */
}
/* On decryption we store (data) which is cypher. */
stp->str_output[index] = data;
return(data ^ stp->str_feed[index]);
stp->str_output[idx] = data;
return(data ^ stp->str_feed[idx]);
}
/*
@ -678,20 +678,20 @@ ofb64_encrypt(s, c)
int c;
{
register struct stinfo *stp = &fb[OFB].streams[DIR_ENCRYPT-1];
register int index;
register int idx;
index = stp->str_index;
idx = stp->str_index;
while (c-- > 0) {
if (index == sizeof(Block)) {
if (idx == sizeof(Block)) {
Block b;
des_ecb_encrypt(&stp->str_feed, &b, stp->str_sched, 1);
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
index = 0;
idx = 0;
}
*s++ ^= stp->str_feed[index];
index++;
*s++ ^= stp->str_feed[idx];
idx++;
}
stp->str_index = index;
stp->str_index = idx;
}
int
@ -699,7 +699,7 @@ ofb64_decrypt(data)
int data;
{
register struct stinfo *stp = &fb[OFB].streams[DIR_DECRYPT-1];
int index;
int idx;
if (data == -1) {
/*
@ -712,16 +712,16 @@ ofb64_decrypt(data)
return(0);
}
index = stp->str_index++;
if (index == sizeof(Block)) {
idx = stp->str_index++;
if (idx == sizeof(Block)) {
Block b;
des_ecb_encrypt(&stp->str_feed, &b, stp->str_sched, 1);
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
stp->str_index = 1; /* Next time will be 1 */
index = 0; /* But now use 0 */
idx = 0; /* But now use 0 */
}
return(data ^ stp->str_feed[index]);
return(data ^ stp->str_feed[idx]);
}
# endif /* DES_ENCRYPTION */
# endif /* AUTHENTICATION */

View File

@ -1,4 +1,4 @@
/* $NetBSD: kerberos.c,v 1.5 2001/01/06 23:36:37 christos Exp $ */
/* $NetBSD: kerberos.c,v 1.6 2001/11/30 04:48:14 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)kerberos.c 8.3 (Berkeley) 5/30/95";
#else
__RCSID("$NetBSD: kerberos.c,v 1.5 2001/01/06 23:36:37 christos Exp $");
__RCSID("$NetBSD: kerberos.c,v 1.6 2001/11/30 04:48:14 lukem Exp $");
#endif
#endif /* not lint */
@ -100,7 +100,6 @@ static unsigned char str_name[1024] = { IAC, SB, TELOPT_AUTHENTICATION,
#define KRB_SERVICE_NAME "rcmd"
static KTEXT_ST auth;
static char name[ANAME_SZ];
static AUTH_DAT adat = { 0 };
#ifdef ENCRYPTION
@ -267,6 +266,7 @@ kerberos4_is(ap, data, cnt)
Session_Key skey;
Block datablock;
#endif /* ENCRYPTION */
KTEXT_ST auth;
char realm[REALM_SZ];
char instance[INST_SZ];
int r;
@ -436,16 +436,16 @@ kerberos4_reply(ap, data, cnt)
}
int
kerberos4_status(ap, name, level)
kerberos4_status(ap, kname, level)
Authenticator *ap;
char *name;
char *kname;
int level;
{
if (level < AUTH_USER)
return(level);
if (UserNameRequested && !kuserok(&adat, UserNameRequested)) {
strcpy(name, UserNameRequested);
strcpy(kname, UserNameRequested);
return(AUTH_VALID);
} else
return(AUTH_USER);