]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
aklog: Fix weak_crypto tests
authorSimon Wilkinson <sxw@your-file-system.com>
Mon, 6 Sep 2010 08:37:23 +0000 (09:37 +0100)
committerDerrick Brashear <shadow@dementia.org>
Fri, 18 Feb 2011 14:14:49 +0000 (06:14 -0800)
The tests for the various ways of enabling weak cryptography fail
with current Heimdal master, because it defines krb5_allow_weak_crypto
but does not prototype it.

Fix this by testing for the Heimdal version (which MIT does not provide)
first, and only if that's not available, try to use allow_weak_crypto.

Reviewed-on: http://gerrit.openafs.org/2739
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 696e1c015eeef259451c101813b9e930e402cb49)

Change-Id: Ia69e1899f1e3d058271f147d33b58383ca35b4ec
Reviewed-on: http://gerrit.openafs.org/3985
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/aklog/aklog.c
src/aklog/klog.c

index 492649002e170f8e0c1e4cb681bff7487b1803c9..d1d437cf679cb25cb13feb9ff0a582ae7947c18b 100644 (file)
@@ -1523,12 +1523,12 @@ main(int argc, char *argv[])
      * krb5_allow_weak_crypto is MIT Kerberos 1.8.  krb5_enctype_enable is
      * Heimdal.
      */
-#if defined(HAVE_KRB5_ALLOW_WEAK_CRYPTO)
-    krb5_allow_weak_crypto(context, 1);
-#elif defined(HAVE_KRB5_ENCTYPE_ENABLE)
+#if defined(HAVE_KRB5_ENCTYPE_ENABLE)
     i = krb5_enctype_valid(context, ETYPE_DES_CBC_CRC);
     if (i)
         krb5_enctype_enable(context, ETYPE_DES_CBC_CRC);
+#elif defined(HAVE_KRB5_ALLOW_WEAK_CRYPTO)
+    krb5_allow_weak_crypto(context, 1);
 #endif
 
     /* Initialize list of cells to which we have authenticated */
index 02cdeaa9f0ec74af8558c7a0de06ccd0e20b0e67..b6defa4fc6fa44ec0e0717ee8cdf9ca4984cbebc 100644 (file)
@@ -445,12 +445,12 @@ CommandProc(struct cmd_syndesc *as, void *arock)
      * krb5_allow_weak_crypto is MIT Kerberos 1.8.  krb5_enctype_enable is
      * Heimdal.
      */
-#if defined(HAVE_KRB5_ALLOW_WEAK_CRYPTO)
-    krb5_allow_weak_crypto(k5context, 1);
-#elif defined(HAVE_KRB5_ENCTYPE_ENABLE)
+#if defined(HAVE_KRB5_ENCTYPE_ENABLE)
     i = krb5_enctype_valid(k5context, ETYPE_DES_CBC_CRC);
     if (i)
         krb5_enctype_enable(k5context, ETYPE_DES_CBC_CRC);
+#elif defined(HAVE_KRB5_ALLOW_WEAK_CRYPTO)
+    krb5_allow_weak_crypto(k5context, 1);
 #endif
 
     /* Parse remaining arguments. */