use LSBFIRST and MSBFIRST to detect which version of DES we're using.
authorMark Eichin <eichin@mit.edu>
Fri, 10 Jun 1994 21:01:17 +0000 (21:01 +0000)
committerMark Eichin <eichin@mit.edu>
Fri, 10 Jun 1994 21:01:17 +0000 (21:01 +0000)
This is the only "invasive" autoconf vs. imake change...

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3733 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/des/key_sched.c

index 07bafe97a0fb15f057dfd2fcc484273256552344..465bcdf290810eaf89a3b26333fde60b57e4f52a 100644 (file)
@@ -54,6 +54,31 @@ static char rcsid_key_sched_c[] =
 
 #include <krb5/krb5.h>
 #include "des_int.h"
+#if !defined(LSBFIRST) && !defined(MSBFIRST)
+/* autoconf and Ferguson DES code */
+
+void make_key_sched PROTOTYPE((mit_des_cblock, mit_des_key_schedule));
+
+int
+mit_des_key_sched(k,schedule)
+    mit_des_cblock k;
+    mit_des_key_schedule schedule;
+{
+    if (!mit_des_check_key_parity(k))  /* bad parity --> return -1 */
+       return(-1);
+
+    if (mit_des_is_weak_key(k))
+       return(-2);
+
+    make_key_sched(k,schedule);
+
+    /* if key was good, return 0 */
+    return 0;
+}
+
+#else
+/* Imake and MIT DES code */
+
 #include "key_perm.h"
 
 extern int mit_des_debug;
@@ -258,3 +283,4 @@ make_key_sched(Key,Schedule)
     }
 #endif
 }
+#endif