#if defined(HAVE_KERBEROS) && !defined(openbsd)
/*
* $Source: /repo/OpenLDAP/pkg/ldap/clients/ud/string_to_key.c,v $
- * $Author: kurt $
+ * $Author: kdz $
*
* Copyright 1985, 1986, 1987, 1988, 1989 by the Massachusetts Institute
* of Technology.
#include <stdio.h>
#include <ac/krb.h>
+#if defined( DEBUG ) && defined( HAVE_DES_DEBUG )
+#define USE_DES_DEBUG
extern int des_debug;
-extern int des_debug_print();
+#endif
+
extern void des_fixup_key_parity();
#ifndef HAVE_AFS_KERBEROS
/*
* convert an arbitrary length string to a DES key
*/
-int
+void
des_string_to_key( char *str, register des_cblock *key )
{
register char *in_str;
/* init key array for bits */
memset(k_char, 0, sizeof(k_char));
-#ifdef DEBUG
+#ifdef USE_DES_DEBUG
if (des_debug)
fprintf(stdout,
"\n\ninput str length = %d string = %s\nstring = 0x ",
for (i = 1; i <= length; i++) {
/* get next input key byte */
temp = (unsigned int) *str++;
-#ifdef DEBUG
+#ifdef USE_DES_DEBUG
if (des_debug)
fprintf(stdout,"%02x ",temp & 0xff);
#endif
/* now fix up key parity again */
des_fixup_key_parity(key);
+#ifdef USE_DES_DEBUG
if (des_debug)
fprintf(stdout,
- "\nResulting string_to_key = 0x%x 0x%x\n",
+ "\nResulting string_to_key = 0x%lx 0x%lx\n",
*((unsigned long *) key),
*((unsigned long *) key+1));
+#endif
}
#endif /* HAVE_KERBEROS_V */