More ANSI/ISO 9899-1990 to the people!

Now actually builds (not including util) with DEC "cc -std1" and Sun
"acc -Xc".  There are still major prototype conflicts, but there isn't
much to do about this.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@192 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Unknown User d91-jda
1995-11-12 20:22:06 +00:00
parent 9f1661eb7a
commit a445da10c5
20 changed files with 268 additions and 489 deletions

View File

@@ -539,7 +539,6 @@ auth_name(data, cnt)
unsigned char *data;
int cnt;
{
Authenticator *ap;
unsigned char savename[256];
if (cnt < 1) {

View File

@@ -111,11 +111,4 @@ void ofb64_session P((Session_Key *, int));
int ofb64_keyid P((int, unsigned char *, int *));
void ofb64_printsub P((unsigned char *, int, unsigned char *, int));
#if OLD
int des_new_random_key P((Block));
void des_set_random_generator_seed P((Block));
void des_key_sched P((Block, Schedule));
void des_ecb_encrypt P((Block, Block, Schedule, int));
int des_string_to_key P((char *, Block));
#endif
#endif

View File

@@ -46,12 +46,14 @@ static char orig_sccsid[] = "@(#)enc_des.c 5.1 (Berkeley) 3/22/91";
#include <stdio.h>
#ifdef __STDC__
#include <stdlib.h>
#include <string.h>
#endif
#include "encrypt.h"
#include "key-proto.h"
#include "misc-proto.h"
#include <des.h>
extern encrypt_debug_mode;
#define CFB 0
@@ -65,24 +67,26 @@ extern encrypt_debug_mode;
#define FAILED -1
struct stinfo {
des_cblock str_output;
des_cblock str_feed;
des_cblock str_iv;
des_cblock str_ikey;
des_key_schedule str_sched;
int str_index;
int str_flagshift;
};
struct fb {
Block krbdes_key;
Schedule krbdes_sched;
Block temp_feed;
des_cblock krbdes_key;
des_key_schedule krbdes_sched;
des_cblock temp_feed;
unsigned char fb_feed[64];
int need_start;
int state[2];
int keyid[2];
int once;
struct stinfo {
Block str_output;
Block str_feed;
Block str_iv;
Block str_ikey;
Schedule str_sched;
int str_index;
int str_flagshift;
} streams[2];
struct stinfo streams[2];
};
static struct fb fb[2];
@@ -114,18 +118,16 @@ struct keyidlist {
#define FB64_IV_BAD 3
void fb64_stream_iv P((Block, struct stinfo *));
void fb64_stream_iv P((des_cblock, struct stinfo *));
void fb64_init P((struct fb *));
static int fb64_start P((struct fb *, int, int));
int fb64_is P((unsigned char *, int, struct fb *));
int fb64_reply P((unsigned char *, int, struct fb *));
static void fb64_session P((Session_Key *, int, struct fb *));
void fb64_stream_key P((Block, struct stinfo *));
void fb64_stream_key P((des_cblock, struct stinfo *));
int fb64_keyid P((int, unsigned char *, int *, struct fb *));
void
cfb64_init(server)
int server;
void cfb64_init(int server)
{
fb64_init(&fb[CFB]);
fb[CFB].fb_feed[4] = ENCTYPE_DES_CFB64;
@@ -133,9 +135,8 @@ cfb64_init(server)
fb[CFB].streams[1].str_flagshift = SHIFT_VAL(1, CFB);
}
void
ofb64_init(server)
int server;
void ofb64_init(int server)
{
fb64_init(&fb[OFB]);
fb[OFB].fb_feed[4] = ENCTYPE_DES_OFB64;
@@ -143,9 +144,7 @@ ofb64_init(server)
fb[CFB].streams[1].str_flagshift = SHIFT_VAL(1, OFB);
}
void
fb64_init(fbp)
register struct fb *fbp;
void fb64_init(struct fb *fbp)
{
memset((void *)fbp,0, sizeof(*fbp));
fbp->state[0] = fbp->state[1] = FAILED;
@@ -163,28 +162,18 @@ fb64_init(fbp)
* 2: Not yet. Other things (like getting the key from
* Kerberos) have to happen before we can continue.
*/
int
cfb64_start(dir, server)
int dir;
int server;
int cfb64_start(int dir, int server)
{
return(fb64_start(&fb[CFB], dir, server));
}
int
ofb64_start(dir, server)
int dir;
int server;
int ofb64_start(int dir, int server)
{
return(fb64_start(&fb[OFB], dir, server));
}
static int
fb64_start(fbp, dir, server)
struct fb *fbp;
int dir;
int server;
static int fb64_start(struct fb *fbp, int dir, int server)
{
Block b;
int x;
unsigned char *p;
register int state;
@@ -222,7 +211,7 @@ fb64_start(fbp, dir, server)
* Create a random feed and send it over.
*/
#ifndef OLD_DES_RANDOM_KEY
des_new_random_key(fbp->temp_feed);
des_new_random_key(&fbp->temp_feed);
#else
/*
* From des_cryp.man "If the des_check_key flag is non-zero,
@@ -234,13 +223,14 @@ fb64_start(fbp, dir, server)
des_set_odd_parity(fbp->temp_feed);
} while (des_is_weak_key(fbp->temp_feed));
#endif
des_ecb_encrypt(fbp->temp_feed, fbp->temp_feed,
des_ecb_encrypt(&fbp->temp_feed,
&fbp->temp_feed,
fbp->krbdes_sched, 1);
p = fbp->fb_feed + 3;
*p++ = ENCRYPT_IS;
p++;
*p++ = FB64_IV;
for (x = 0; x < sizeof(Block); ++x) {
for (x = 0; x < sizeof(des_cblock); ++x) {
if ((*p++ = fbp->temp_feed[x]) == IAC)
*p++ = IAC;
}
@@ -261,30 +251,21 @@ fb64_start(fbp, dir, server)
* 0: Successful, initial negotiation all done.
* 1: successful, negotiation not done yet.
*/
int
cfb64_is(data, cnt)
unsigned char *data;
int cnt;
int cfb64_is(unsigned char *data, int cnt)
{
return(fb64_is(data, cnt, &fb[CFB]));
}
int
ofb64_is(data, cnt)
unsigned char *data;
int cnt;
int ofb64_is(unsigned char *data, int cnt)
{
return(fb64_is(data, cnt, &fb[OFB]));
}
int
fb64_is(data, cnt, fbp)
unsigned char *data;
int cnt;
struct fb *fbp;
int fb64_is(unsigned char *data, int cnt, struct fb *fbp)
{
int x;
unsigned char *p;
Block b;
register int state = fbp->state[DIR_DECRYPT-1];
if (cnt-- < 1)
@@ -292,7 +273,7 @@ fb64_is(data, cnt, fbp)
switch (*data++) {
case FB64_IV:
if (cnt != sizeof(Block)) {
if (cnt != sizeof(des_cblock)) {
if (encrypt_debug_mode)
printf("CFB64: initial vector failed on size\r\n");
state = FAILED;
@@ -352,31 +333,20 @@ fb64_is(data, cnt, fbp)
* 0: Successful, initial negotiation all done.
* 1: successful, negotiation not done yet.
*/
int
cfb64_reply(data, cnt)
unsigned char *data;
int cnt;
int cfb64_reply(unsigned char *data, int cnt)
{
return(fb64_reply(data, cnt, &fb[CFB]));
}
int
ofb64_reply(data, cnt)
unsigned char *data;
int cnt;
int ofb64_reply(unsigned char *data, int cnt)
{
return(fb64_reply(data, cnt, &fb[OFB]));
}
int
fb64_reply(data, cnt, fbp)
unsigned char *data;
int cnt;
struct fb *fbp;
int fb64_reply(unsigned char *data, int cnt, struct fb *fbp)
{
int x;
unsigned char *p;
Block b;
register int state = fbp->state[DIR_ENCRYPT-1];
if (cnt-- < 1)
@@ -392,7 +362,7 @@ fb64_reply(data, cnt, fbp)
break;
case FB64_IV_BAD:
memset(fbp->temp_feed, 0, sizeof(Block));
memset(fbp->temp_feed, 0, sizeof(des_cblock));
fb64_stream_iv(fbp->temp_feed, &fbp->streams[DIR_ENCRYPT-1]);
state = FAILED;
break;
@@ -411,27 +381,17 @@ fb64_reply(data, cnt, fbp)
return(fbp->state[DIR_ENCRYPT-1] = state);
}
void
cfb64_session(key, server)
Session_Key *key;
int server;
void cfb64_session(Session_Key *key, int server)
{
fb64_session(key, server, &fb[CFB]);
}
void
ofb64_session(key, server)
Session_Key *key;
int server;
void ofb64_session(Session_Key *key, int server)
{
fb64_session(key, server, &fb[OFB]);
}
static void
fb64_session(key, server, fbp)
Session_Key *key;
int server;
struct fb *fbp;
static void fb64_session(Session_Key *key, int server, struct fb *fbp)
{
if (!key || key->type != SK_DES) {
@@ -440,18 +400,18 @@ fb64_session(key, server, fbp)
key ? key->type : -1, SK_DES);
return;
}
memcpy((void *)fbp->krbdes_key, (void *)key->data, sizeof(Block));
memcpy((void *)fbp->krbdes_key, (void *)key->data, sizeof(des_cblock));
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_ENCRYPT-1]);
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]);
if (fbp->once == 0) {
#ifndef OLD_DES_RANDOM_KEY
des_init_random_number_generator(fbp->krbdes_key);
des_init_random_number_generator(&fbp->krbdes_key);
#endif
fbp->once = 1;
}
des_key_sched(fbp->krbdes_key, fbp->krbdes_sched);
des_key_sched(&fbp->krbdes_key, fbp->krbdes_sched);
/*
* Now look to see if krbdes_start() was was waiting for
* the key to show up. If so, go ahead an call it now
@@ -467,27 +427,18 @@ fb64_session(key, server, fbp)
* We only accept a keyid of 0. If we get a keyid of
* 0, then mark the state as SUCCESS.
*/
int
cfb64_keyid(dir, kp, lenp)
int dir, *lenp;
unsigned char *kp;
int cfb64_keyid(int dir, unsigned char *kp, int *lenp)
{
return(fb64_keyid(dir, kp, lenp, &fb[CFB]));
}
int
ofb64_keyid(dir, kp, lenp)
int dir, *lenp;
unsigned char *kp;
int ofb64_keyid(int dir, unsigned char *kp, int *lenp)
{
return(fb64_keyid(dir, kp, lenp, &fb[OFB]));
}
int
fb64_keyid(dir, kp, lenp, fbp)
int dir, *lenp;
unsigned char *kp;
struct fb *fbp;
int fb64_keyid(int dir, unsigned char *kp, int *lenp, struct fb *fbp)
{
register int state = fbp->state[dir-1];
@@ -504,10 +455,8 @@ fb64_keyid(dir, kp, lenp, fbp)
return(fbp->state[dir-1] = state);
}
void
fb64_printsub(data, cnt, buf, buflen, type)
unsigned char *data, *buf, *type;
int cnt, buflen;
void fb64_printsub(unsigned char *data, int cnt,
unsigned char *buf, int buflen, char *type)
{
char lbuf[32];
register int i;
@@ -547,47 +496,37 @@ fb64_printsub(data, cnt, buf, buflen, type)
}
}
void
cfb64_printsub(data, cnt, buf, buflen)
unsigned char *data, *buf;
int cnt, buflen;
void cfb64_printsub(unsigned char *data, int cnt,
unsigned char *buf, int buflen)
{
fb64_printsub(data, cnt, buf, buflen, "CFB64");
}
void
ofb64_printsub(data, cnt, buf, buflen)
unsigned char *data, *buf;
int cnt, buflen;
void ofb64_printsub(unsigned char *data, int cnt,
unsigned char *buf, int buflen)
{
fb64_printsub(data, cnt, buf, buflen, "OFB64");
}
void
fb64_stream_iv(seed, stp)
Block seed;
register struct stinfo *stp;
void fb64_stream_iv(des_cblock seed, struct stinfo *stp)
{
memcpy((void *)stp->str_iv, (void *)seed,sizeof(Block));
memcpy((void *)stp->str_output, (void *)seed, sizeof(Block));
memcpy((void *)stp->str_iv, (void *)seed,sizeof(des_cblock));
memcpy((void *)stp->str_output, (void *)seed, sizeof(des_cblock));
des_key_sched(stp->str_ikey, stp->str_sched);
des_key_sched(&stp->str_ikey, stp->str_sched);
stp->str_index = sizeof(Block);
stp->str_index = sizeof(des_cblock);
}
void
fb64_stream_key(key, stp)
Block key;
register struct stinfo *stp;
void fb64_stream_key(des_cblock key, register struct stinfo *stp)
{
memcpy((void *)stp->str_ikey, (void *)key, sizeof(Block));
des_key_sched(key, stp->str_sched);
memcpy((void *)stp->str_ikey, (void *)key, sizeof(des_cblock));
des_key_sched((des_cblock*)key, stp->str_sched);
memcpy((void *)stp->str_output, (void *)stp->str_iv, sizeof(Block));
memcpy((void *)stp->str_output, (void *)stp->str_iv, sizeof(des_cblock));
stp->str_index = sizeof(Block);
stp->str_index = sizeof(des_cblock);
}
/*
@@ -612,20 +551,17 @@ fb64_stream_key(key, stp)
* V(n+1) = DES(On, key)
*/
void
cfb64_encrypt(s, c)
register unsigned char *s;
int c;
void cfb64_encrypt(unsigned char *s, int c)
{
register struct stinfo *stp = &fb[CFB].streams[DIR_ENCRYPT-1];
register int index;
index = stp->str_index;
while (c-- > 0) {
if (index == sizeof(Block)) {
Block b;
des_ecb_encrypt(stp->str_output, b, stp->str_sched, 1);
memcpy((void *)stp->str_feed, (void *)b, sizeof(Block));
if (index == sizeof(des_cblock)) {
des_cblock b;
des_ecb_encrypt(&stp->str_output, &b,stp->str_sched, 1);
memcpy((void *)stp->str_feed, (void *)b, sizeof(des_cblock));
index = 0;
}
@@ -637,9 +573,7 @@ cfb64_encrypt(s, c)
stp->str_index = index;
}
int
cfb64_decrypt(data)
int data;
int cfb64_decrypt(int data)
{
register struct stinfo *stp = &fb[CFB].streams[DIR_DECRYPT-1];
int index;
@@ -656,10 +590,10 @@ cfb64_decrypt(data)
}
index = stp->str_index++;
if (index == sizeof(Block)) {
Block b;
des_ecb_encrypt(stp->str_output, b, stp->str_sched, 1);
memcpy((void *)stp->str_feed, (void *)b, sizeof(Block));
if (index == sizeof(des_cblock)) {
des_cblock b;
des_ecb_encrypt(&stp->str_output,&b, stp->str_sched, 1);
memcpy((void *)stp->str_feed, (void *)b, sizeof(des_cblock));
stp->str_index = 1; /* Next time will be 1 */
index = 0; /* But now use 0 */
}
@@ -688,20 +622,18 @@ cfb64_decrypt(data)
* V(n+1) = DES(Vn, key)
* On = Dn ^ Vn
*/
void
ofb64_encrypt(s, c)
register unsigned char *s;
int c;
void ofb64_encrypt(unsigned char *s, int c)
{
register struct stinfo *stp = &fb[OFB].streams[DIR_ENCRYPT-1];
register int index;
index = stp->str_index;
while (c-- > 0) {
if (index == sizeof(Block)) {
Block b;
des_ecb_encrypt(stp->str_feed, b, stp->str_sched, 1);
memcpy((void *)stp->str_feed, (void *)b, sizeof(Block));
if (index == sizeof(des_cblock)) {
des_cblock b;
des_ecb_encrypt(&stp->str_feed,&b, stp->str_sched, 1);
memcpy((void *)stp->str_feed, (void *)b, sizeof(des_cblock));
index = 0;
}
*s++ ^= stp->str_feed[index];
@@ -710,9 +642,7 @@ ofb64_encrypt(s, c)
stp->str_index = index;
}
int
ofb64_decrypt(data)
int data;
int ofb64_decrypt(int data)
{
register struct stinfo *stp = &fb[OFB].streams[DIR_DECRYPT-1];
int index;
@@ -729,10 +659,10 @@ ofb64_decrypt(data)
}
index = stp->str_index++;
if (index == sizeof(Block)) {
Block b;
des_ecb_encrypt(stp->str_feed, b, stp->str_sched, 1);
memcpy((void *)stp->str_feed, (void *)b, sizeof(Block));
if (index == sizeof(des_cblock)) {
des_cblock b;
des_ecb_encrypt(&stp->str_feed,&b,stp->str_sched, 1);
memcpy((void *)stp->str_feed, (void *)b, sizeof(des_cblock));
stp->str_index = 1; /* Next time will be 1 */
index = 0; /* But now use 0 */
}

View File

@@ -581,7 +581,7 @@ encrypt_is(data, cnt)
} else {
ret = (*ep->is)(data, cnt);
if (encrypt_debug_mode)
printf("(*ep->is)(%x, %d) returned %s(%d)\n", data, cnt,
printf("(*ep->is)(%p, %d) returned %s(%d)\n", data, cnt,
(ret < 0) ? "FAIL " :
(ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret);
}
@@ -625,7 +625,7 @@ encrypt_reply(data, cnt)
} else {
ret = (*ep->reply)(data, cnt);
if (encrypt_debug_mode)
printf("(*ep->reply)(%x, %d) returned %s(%d)\n",
printf("(*ep->reply)(%p, %d) returned %s(%d)\n",
data, cnt,
(ret < 0) ? "FAIL " :
(ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret);
@@ -741,27 +741,9 @@ encrypt_request_start(data, cnt)
static unsigned char str_keyid[(MAXKEYLEN*2)+5] = { IAC, SB, TELOPT_ENCRYPT };
encrypt_enc_keyid(keyid, len)
unsigned char *keyid;
int len;
{
encrypt_keyid(&ki[1], keyid, len);
}
encrypt_dec_keyid(keyid, len)
unsigned char *keyid;
int len;
{
encrypt_keyid(&ki[0], keyid, len);
}
encrypt_keyid(kp, keyid, len)
struct key_info *kp;
unsigned char *keyid;
int len;
void encrypt_keyid(struct key_info *kp, unsigned char *keyid, int len)
{
Encryptions *ep;
unsigned char *strp, *cp;
int dir = kp->dir;
register int ret = 0;
@@ -798,12 +780,18 @@ encrypt_keyid(kp, keyid, len)
encrypt_send_keyid(dir, kp->keyid, kp->keylen, 0);
}
void
encrypt_send_keyid(dir, keyid, keylen, saveit)
int dir;
unsigned char *keyid;
int keylen;
int saveit;
void encrypt_enc_keyid(unsigned char *keyid, int len)
{
encrypt_keyid(&ki[1], keyid, len);
}
void encrypt_dec_keyid(unsigned char *keyid, int len)
{
encrypt_keyid(&ki[0], keyid, len);
}
void encrypt_send_keyid(int dir, unsigned char *keyid, int keylen, int saveit)
{
unsigned char *strp;
@@ -954,10 +942,9 @@ encrypt_send_request_end()
printf(">>>%s: Request input to be clear text\r\n", Name);
}
void
encrypt_wait()
void encrypt_wait(void)
{
register int encrypt, decrypt;
if (encrypt_debug_mode)
printf(">>>%s: in encrypt_wait\r\n", Name);
if (!havesessionkey || !(I_SUPPORT_ENCRYPT & remote_supports_decrypt))
@@ -974,10 +961,8 @@ encrypt_debug(mode)
encrypt_debug_mode = mode;
}
void
encrypt_gen_printsub(data, cnt, buf, buflen)
unsigned char *data, *buf;
int cnt, buflen;
void encrypt_gen_printsub(unsigned char *data, int cnt,
unsigned char *buf, int buflen)
{
char tbuf[16], *cp;

View File

@@ -62,14 +62,10 @@
#define DIR_DECRYPT 1
#define DIR_ENCRYPT 2
typedef unsigned char Block[8];
typedef unsigned char *BlockT;
typedef struct { Block _B; } Schedule[16];
#define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | \
key[4] | key[5] | key[6] | key[7])
#define SAMEKEY(k1, k2) (!bcmp((void *)k1, (void *)k2, sizeof(Block)))
#define SAMEKEY(k1, k2) (!bcmp((void *)k1, (void *)k2, sizeof(des_cblock)))
typedef struct {
short type;

View File

@@ -45,11 +45,9 @@ static char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95";
* the length is returned. If *s1 is a prefix of *s2,
* the length of *s1 is returned.
*/
int
isprefix(s1, s2)
register char *s1, *s2;
int isprefix(char *s1, char *s2)
{
register int n = 0;
char *os1;
register char c1, c2;

View File

@@ -131,7 +131,7 @@ static krb5_authenticator authenticator;
#define Voidptr krb5_pointer
Block session_key;
des_cblock session_key;
static int
Data(ap, type, d, c)
@@ -430,12 +430,12 @@ kerberos5_is(ap, data, cnt)
authdat->authenticator->subkey->keytype == KEYTYPE_DES) {
memmove((Voidptr )session_key,
(Voidptr )authdat->authenticator->subkey->contents,
sizeof(Block));
sizeof(des_cblock));
} else if (authdat->ticket->enc_part2->session->keytype ==
KEYTYPE_DES) {
memmove((Voidptr )session_key,
(Voidptr )authdat->ticket->enc_part2->session->contents,
sizeof(Block));
sizeof(des_cblock));
} else
break;
@@ -518,7 +518,7 @@ kerberos5_reply(ap, data, cnt)
tmpkey.keytype = KEYTYPE_DES;
tmpkey.contents = session_key;
tmpkey.length = sizeof(Block);
tmpkey.length = sizeof(des_cblock);
if (r = krb5_rd_rep(&inbuf, &tmpkey, &reply)) {
printf("[ Mutual authentication failed: %s ]\n",

View File

@@ -1,71 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)key-proto.h 8.1 (Berkeley) 6/4/93
*/
/*
* Copyright (C) 1990 by the Massachusetts Institute of Technology
*
* Export of this software from the United States of America is assumed
* to require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, 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, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#ifndef __KEY_PROTO__
#define __KEY_PROTO__
#if !defined(P)
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
#endif
int key_file_exists P((void));
void key_lookup P((unsigned char *, Block));
void key_stream_init P((Block, Block, int));
unsigned char key_stream P((int, int));
#endif

View File

@@ -113,7 +113,7 @@ static KTEXT_ST auth;
static char name[ANAME_SZ];
static char user_passwd[ANAME_SZ];
static AUTH_DAT adat = { 0 };
static Schedule sched;
static des_key_schedule sched;
static char challenge[REALM_SZ];
static int
@@ -157,7 +157,7 @@ krb4encpwd_init(ap, server)
int server;
{
char hostname[80], *cp, *realm;
C_Block skey;
des_clock skey;
if (server) {
str_data[3] = TELQUAL_REPLY;
@@ -202,7 +202,7 @@ krb4encpwd_is(ap, data, cnt)
int cnt;
{
Session_Key skey;
Block datablock;
des_cblock datablock;
char r_passwd[ANAME_SZ], r_user[ANAME_SZ];
char lhostname[ANAME_SZ], *cp;
int r;
@@ -232,7 +232,7 @@ krb4encpwd_is(ap, data, cnt)
return;
}
memmove((void *)session_key, (void *)adat.session, sizeof(Block));
memmove((void *)session_key, (void *)adat.session, sizeof(des_cblock));
Data(ap, KRB4_ENCPWD_ACCEPT, (void *)0, 0);
auth_finished(ap, AUTH_USER);
break;
@@ -242,7 +242,7 @@ krb4encpwd_is(ap, data, cnt)
* Take the received random challenge text and save
* for future authentication.
*/
memmove((void *)challenge, (void *)data, sizeof(Block));
memmove((void *)challenge, (void *)data, sizeof(des_cblock));
break;
@@ -280,7 +280,7 @@ krb4encpwd_reply(ap, data, cnt)
{
Session_Key skey;
KTEXT_ST krb_token;
Block enckey;
des_cblock enckey;
CREDENTIALS cred;
int r;
char randchal[REALM_SZ], instance[ANAME_SZ], *cp;

View File

@@ -200,7 +200,7 @@ rsaencpwd_is(ap, data, cnt)
int cnt;
{
Session_Key skey;
Block datablock;
des_cblock datablock;
char r_passwd[PWD_SZ], r_user[NAME_SZ];
char *cp, key[160];
char chalkey[160], *ptr;
@@ -321,7 +321,7 @@ rsaencpwd_reply(ap, data, cnt)
{
Session_Key skey;
KTEXT_ST token;
Block enckey;
des_cblock enckey;
int r, pubkey_len;
char randchal[CHAL_SZ], *cp;
char chalkey[160], pubkey[128], *ptr;

View File

@@ -100,8 +100,8 @@ static unsigned char str_name[1024] = { IAC, SB, TELOPT_AUTHENTICATION,
#define SPX_REJECT 1 /* Rejected (reason might follow) */
#define SPX_ACCEPT 2 /* Accepted */
static Schedule sched;
static Block challenge = { 0 };
static des_key_schedule sched;
static des_cblock challenge = { 0 };
/*******************************************************************/
@@ -200,7 +200,7 @@ spx_init(ap, server)
spx_send(ap)
Authenticator *ap;
{
Block enckey;
des_cblock enckey;
int r;
gss_OID actual_mech_type, output_name_type;
@@ -312,7 +312,7 @@ spx_is(ap, data, cnt)
int cnt;
{
Session_Key skey;
Block datablock;
des_cblock datablock;
int r;
if (cnt-- < 1)