*/
#include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
#include <afs/param.h>
-#endif
-RCSID
- ("$Header$");
-
-#if defined(UKERNEL)
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "afs/stds.h"
-#include "afs/pthread_glock.h"
-#include "afs/cellconfig.h"
-#include "afs/afsutil.h"
-#include "afs/auth.h"
-#include "afs/kauth.h"
-#include "afs/kautils.h"
-#include "afs/pthread_glock.h"
-#include "des/des.h"
-
-#else /* defined(UKERNEL) */
#include <afs/stds.h>
#include <afs/pthread_glock.h>
#include <stdio.h>
#include <winsock2.h>
#include <crypt.h>
#endif
-#ifdef HAVE_STRING_H
#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
#ifdef HAVE_UNISTD_H
+#if !defined(__USE_XOPEN)
#define __USE_XOPEN
+#endif
#include <unistd.h>
#endif
#include <afs/cellconfig.h>
#include <afs/auth.h>
#include <afs/afsutil.h>
+#include <des.h>
+#include <des_prototypes.h>
#include "kauth.h"
#include "kautils.h"
-#endif /* defined(UKERNEL) */
/* This defines the Andrew string_to_key function. It accepts a password
keybytes[i] = (unsigned char)(temp << 1);
}
}
- des_fixup_key_parity(key);
+ des_fixup_key_parity(ktc_to_cblock(key));
}
static void
struct ktc_encryptionKey *key)
{
des_key_schedule schedule;
- char temp_key[8];
+ unsigned char temp_key[8];
char ivec[8];
char password[BUFSIZ];
int passlen;
memcpy(temp_key, "kerberos", 8);
des_fixup_key_parity(temp_key);
des_key_sched(temp_key, schedule);
- des_cbc_cksum(password, ivec, passlen, schedule, ivec);
+ des_cbc_cksum(charptr_to_cblockptr(password), charptr_to_cblockptr(ivec), passlen, schedule, charptr_to_cblockptr(ivec));
memcpy(temp_key, ivec, 8);
des_fixup_key_parity(temp_key);
des_key_sched(temp_key, schedule);
- des_cbc_cksum(password, key, passlen, schedule, ivec);
+ des_cbc_cksum(charptr_to_cblockptr(password), ktc_to_cblockptr(key), passlen, schedule, charptr_to_cblockptr(ivec));
- des_fixup_key_parity(key);
+ des_fixup_key_parity(ktc_to_cblock(key));
}
void
/* This performs the backslash quoting defined by AC_ParseLoginName. */
static char
-map_char(str, ip)
- char *str;
- int *ip;
+map_char(char *str, int *ip)
{
char c = str[*ip];
if (c == '\\') {