openbsd-ports/security/stel/patches/patch-stel_sub_c
2004-01-04 21:03:51 +00:00

97 lines
2.9 KiB
Plaintext

$OpenBSD: patch-stel_sub_c,v 1.2 2004/01/04 21:03:51 espie Exp $
--- stel/sub.c.orig 1996-04-26 18:29:26.000000000 +0200
+++ stel/sub.c 2004-01-04 22:01:07.000000000 +0100
@@ -24,7 +24,11 @@ static char *rcsid = "@(#) $Id: sub.c,v
#include <sys/stat.h>
#include <sys/utsname.h>
#include <syslog.h>
+#ifndef __STDC__
#include <varargs.h>
+#else
+#include <stdarg.h>
+#endif
#include "regex.h"
@@ -515,10 +519,10 @@ unsigned char *rndstr;
memcpy(sessionkeyhash, digest2, 8);
#ifdef DESCORE
- descore_ecb_encrypt(sessionkeyhash, sessionkeyhash, tmpsched, ENCRYPT);
+ descore_ecb_encrypt(sessionkeyhash, sessionkeyhash, tmpsched, DES_ENCRYPT);
#else
des_ecb_encrypt((des_cblock *)sessionkeyhash,
- (des_cblock *)sessionkeyhash, tmpsched, ENCRYPT);
+ (des_cblock *)sessionkeyhash, tmpsched, DES_ENCRYPT);
#endif
bzero(tmpsched, sizeof(tmpsched));
@@ -984,17 +988,17 @@ char *authbuf;
/* build K_E(sessionkeyhash) */
memcpy(cookie, sessionkeyhash, 8);
#ifdef DESCORE
- descore_ecb_encrypt(cookie, cookie, authsched, ENCRYPT);
+ descore_ecb_encrypt(cookie, cookie, authsched, DES_ENCRYPT);
#else
des_ecb_encrypt((des_cblock *)cookie, (des_cblock *)cookie,
- authsched, ENCRYPT);
+ authsched, DES_ENCRYPT);
#endif
if (side == SERVER_SIDE) /* encrypt twice */
#ifdef DESCORE
- descore_ecb_encrypt(cookie, cookie, authsched, ENCRYPT);
+ descore_ecb_encrypt(cookie, cookie, authsched, DES_ENCRYPT);
#else
des_ecb_encrypt((des_cblock *)cookie, (des_cblock *)cookie,
- authsched, ENCRYPT);
+ authsched, DES_ENCRYPT);
#endif
if (logging) {
@@ -1053,17 +1057,17 @@ char *authbuf;
if (side == CLIENT_SIDE) /* decrypt it once */
#ifdef DESCORE
- descore_ecb_encrypt(othercookie, othercookie, authsched, DECRYPT);
+ descore_ecb_encrypt(othercookie, othercookie, authsched, DES_DECRYPT);
#else
des_ecb_encrypt((des_cblock *)othercookie,
- (des_cblock *)othercookie, authsched, DECRYPT);
+ (des_cblock *)othercookie, authsched, DES_DECRYPT);
#endif
else if (side == SERVER_SIDE) /* encrypt once more */
#ifdef DESCORE
- descore_ecb_encrypt(othercookie, othercookie, authsched, ENCRYPT);
+ descore_ecb_encrypt(othercookie, othercookie, authsched, DES_ENCRYPT);
#else
des_ecb_encrypt((des_cblock *)othercookie,
- (des_cblock *)othercookie, authsched, ENCRYPT);
+ (des_cblock *)othercookie, authsched, DES_ENCRYPT);
#endif
if (logging) {
@@ -1574,7 +1578,7 @@ randomdigest()
}
/* client printf */
-#if defined(IRIX) || defined(SOLARIS)
+#if defined(IRIX) || defined(SOLARIS) || defined(__STDC__)
cprintf(char *fmt, ...)
#else
cprintf(va_alist)
@@ -1582,12 +1586,12 @@ va_dcl
#endif
{
va_list args;
-#if !defined(IRIX) && !defined(SOLARIS)
+#if !defined(IRIX) && !defined(SOLARIS) && !defined(__STDC__)
char *fmt;
#endif
char buf[128];
-#if defined(IRIX) || defined(SOLARIS)
+#if defined(IRIX) || defined(SOLARIS) || defined(__STDC__)
va_start(args, fmt);
#else
va_start(args);