]> git.sur5r.net Git - openldap/blobdiff - clients/ud/string_to_key.c
Don't depend error handling on exact resultCode.
[openldap] / clients / ud / string_to_key.c
index 5e6f8a60f134f7e0709f16199a99dcf55ca5ed47..44f683c28369f84783c2a1c36eef19136df70540 100644 (file)
@@ -1,10 +1,12 @@
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 #include "portable.h"
 
-#if defined(HAVE_KERBEROS) && !defined(openbsd)
+#if defined(LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND) && !defined(openbsd)
 /*
- * $Source: /repo/OpenLDAP/pkg/ldap/clients/ud/string_to_key.c,v $
- * $Author: hallvard $
- *
  * 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
@@ -64,7 +69,7 @@ des_string_to_key( char *str, register des_cblock *key )
     /* 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 ",
@@ -75,7 +80,7 @@ des_string_to_key( char *str, register des_cblock *key )
     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
@@ -116,11 +121,13 @@ des_string_to_key( char *str, register des_cblock *key )
     /* 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 */