Tidy up UKERNEL includes
[openafs.git] / src / kauth / client.c
index 64f8f4e..7db7ba0 100644 (file)
@@ -8,29 +8,8 @@
  */
 
 #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>
@@ -38,23 +17,20 @@ RCSID
 #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
@@ -101,7 +77,7 @@ Andrew_StringToKey(char *str, char *cell,    /* cell for password */
            keybytes[i] = (unsigned char)(temp << 1);
        }
     }
-    des_fixup_key_parity(key);
+    des_fixup_key_parity(ktc_to_cblock(key));
 }
 
 static void
@@ -109,7 +85,7 @@ StringToKey(char *str, char *cell,   /* cell for password */
            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;
@@ -124,14 +100,14 @@ StringToKey(char *str, char *cell,        /* cell for password */
     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
@@ -189,9 +165,7 @@ ka_ReadPassword(char *prompt, int verify, char *cell,
 /* 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 == '\\') {