| 1 |
Description: disable libcrypto due to bug/licensing isssues |
| 2 |
Author: David Lichteblau <[email protected]> |
| 3 |
|
| 4 |
Index: ldapvi-1.7/config.h.in |
| 5 |
=================================================================== |
| 6 |
--- ldapvi-1.7.orig/config.h.in |
| 7 |
+++ ldapvi-1.7/config.h.in |
| 8 |
@@ -5,5 +5,6 @@ |
| 9 |
#undef HAVE_OPENSSL |
| 10 |
#undef HAVE_GNUTLS |
| 11 |
#undef HAVE_SHA1 |
| 12 |
+#undef HAVE_MD5 |
| 13 |
#undef RAND_PSEUDO_BYTES |
| 14 |
#undef HAVE_SASL |
| 15 |
Index: ldapvi-1.7/configure |
| 16 |
=================================================================== |
| 17 |
--- ldapvi-1.7.orig/configure |
| 18 |
+++ ldapvi-1.7/configure |
| 19 |
@@ -4836,6 +4836,8 @@ _ACEOF |
| 20 |
_ACEOF |
| 21 |
|
| 22 |
;; |
| 23 |
+ none) |
| 24 |
+ ;; |
| 25 |
*) |
| 26 |
{ { echo "$as_me:$LINENO: error: invalid value --with-libcrypto=$with_libcrypto, expected openssl or gnutls" >&5 |
| 27 |
echo "$as_me: error: invalid value --with-libcrypto=$with_libcrypto, expected openssl or gnutls" >&2;} |
| 28 |
@@ -4937,6 +4939,100 @@ fi |
| 29 |
done |
| 30 |
|
| 31 |
|
| 32 |
+for ac_func in MD5 |
| 33 |
+do |
| 34 |
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` |
| 35 |
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5 |
| 36 |
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } |
| 37 |
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then |
| 38 |
+ echo $ECHO_N "(cached) $ECHO_C" >&6 |
| 39 |
+else |
| 40 |
+ cat >conftest.$ac_ext <<_ACEOF |
| 41 |
+/* confdefs.h. */ |
| 42 |
+_ACEOF |
| 43 |
+cat confdefs.h >>conftest.$ac_ext |
| 44 |
+cat >>conftest.$ac_ext <<_ACEOF |
| 45 |
+/* end confdefs.h. */ |
| 46 |
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. |
| 47 |
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */ |
| 48 |
+#define $ac_func innocuous_$ac_func |
| 49 |
+ |
| 50 |
+/* System header to define __stub macros and hopefully few prototypes, |
| 51 |
+ which can conflict with char $ac_func (); below. |
| 52 |
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since |
| 53 |
+ <limits.h> exists even on freestanding compilers. */ |
| 54 |
+ |
| 55 |
+#ifdef __STDC__ |
| 56 |
+# include <limits.h> |
| 57 |
+#else |
| 58 |
+# include <assert.h> |
| 59 |
+#endif |
| 60 |
+ |
| 61 |
+#undef $ac_func |
| 62 |
+ |
| 63 |
+/* Override any GCC internal prototype to avoid an error. |
| 64 |
+ Use char because int might match the return type of a GCC |
| 65 |
+ builtin and then its argument prototype would still apply. */ |
| 66 |
+#ifdef __cplusplus |
| 67 |
+extern "C" |
| 68 |
+#endif |
| 69 |
+char $ac_func (); |
| 70 |
+/* The GNU C library defines this for functions which it implements |
| 71 |
+ to always fail with ENOSYS. Some functions are actually named |
| 72 |
+ something starting with __ and the normal name is an alias. */ |
| 73 |
+#if defined __stub_$ac_func || defined __stub___$ac_func |
| 74 |
+choke me |
| 75 |
+#endif |
| 76 |
+ |
| 77 |
+int |
| 78 |
+main () |
| 79 |
+{ |
| 80 |
+return $ac_func (); |
| 81 |
+ ; |
| 82 |
+ return 0; |
| 83 |
+} |
| 84 |
+_ACEOF |
| 85 |
+rm -f conftest.$ac_objext conftest$ac_exeext |
| 86 |
+if { (ac_try="$ac_link" |
| 87 |
+case "(($ac_try" in |
| 88 |
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
| 89 |
+ *) ac_try_echo=$ac_try;; |
| 90 |
+esac |
| 91 |
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 |
| 92 |
+ (eval "$ac_link") 2>conftest.er1 |
| 93 |
+ ac_status=$? |
| 94 |
+ grep -v '^ *+' conftest.er1 >conftest.err |
| 95 |
+ rm -f conftest.er1 |
| 96 |
+ cat conftest.err >&5 |
| 97 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
| 98 |
+ (exit $ac_status); } && { |
| 99 |
+ test -z "$ac_c_werror_flag" || |
| 100 |
+ test ! -s conftest.err |
| 101 |
+ } && test -s conftest$ac_exeext && |
| 102 |
+ $as_test_x conftest$ac_exeext; then |
| 103 |
+ eval "$as_ac_var=yes" |
| 104 |
+else |
| 105 |
+ echo "$as_me: failed program was:" >&5 |
| 106 |
+sed 's/^/| /' conftest.$ac_ext >&5 |
| 107 |
+ |
| 108 |
+ eval "$as_ac_var=no" |
| 109 |
+fi |
| 110 |
+ |
| 111 |
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ |
| 112 |
+ conftest$ac_exeext conftest.$ac_ext |
| 113 |
+fi |
| 114 |
+ac_res=`eval echo '${'$as_ac_var'}'` |
| 115 |
+ { echo "$as_me:$LINENO: result: $ac_res" >&5 |
| 116 |
+echo "${ECHO_T}$ac_res" >&6; } |
| 117 |
+if test `eval echo '${'$as_ac_var'}'` = yes; then |
| 118 |
+ cat >>confdefs.h <<_ACEOF |
| 119 |
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 |
| 120 |
+_ACEOF |
| 121 |
+ |
| 122 |
+fi |
| 123 |
+done |
| 124 |
+ |
| 125 |
+ |
| 126 |
for ac_func in RAND_pseudo_bytes |
| 127 |
do |
| 128 |
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` |
| 129 |
Index: ldapvi-1.7/configure.in |
| 130 |
=================================================================== |
| 131 |
--- ldapvi-1.7.orig/configure.in |
| 132 |
+++ ldapvi-1.7/configure.in |
| 133 |
@@ -73,11 +73,14 @@ case $with_libcrypto in |
| 134 |
AC_DEFINE(HAVE_GNUTLS) |
| 135 |
AC_DEFINE(SHA_DIGEST_LENGTH,20) |
| 136 |
;; |
| 137 |
+ none) |
| 138 |
+ ;; |
| 139 |
*) |
| 140 |
AC_MSG_ERROR([invalid value --with-libcrypto=$with_libcrypto, expected openssl or gnutls]) |
| 141 |
;; |
| 142 |
esac |
| 143 |
AC_CHECK_FUNCS([SHA1]) |
| 144 |
+AC_CHECK_FUNCS([MD5]) |
| 145 |
AC_CHECK_FUNCS([RAND_pseudo_bytes]) |
| 146 |
|
| 147 |
AC_CHECK_LIB([crypt],[main]) |
| 148 |
Index: ldapvi-1.7/port.c |
| 149 |
=================================================================== |
| 150 |
--- ldapvi-1.7.orig/port.c |
| 151 |
+++ ldapvi-1.7/port.c |
| 152 |
@@ -39,7 +39,7 @@ |
| 153 |
#include <gnutls/gnutls.h> |
| 154 |
#include <gnutls/openssl.h> |
| 155 |
#else |
| 156 |
-#error oops |
| 157 |
+#warning Compiling without cryptographic routines. |
| 158 |
#endif |
| 159 |
|
| 160 |
#ifndef HAVE_RAND_PSEUDO_BYTES |
| 161 |
@@ -148,15 +148,21 @@ g_string_append_ssha(GString *string, ch |
| 162 |
int |
| 163 |
g_string_append_md5(GString *string, char *key) |
| 164 |
{ |
| 165 |
+#ifdef HAVE_MD5 |
| 166 |
unsigned char tmp[MD5_DIGEST_LENGTH]; |
| 167 |
MD5((unsigned char *) key, strlen(key), tmp); |
| 168 |
g_string_append_base64(string, tmp, sizeof(tmp)); |
| 169 |
return 1; |
| 170 |
+#else |
| 171 |
+ puts("Sorry, MD5 support not linked into ldapvi."); |
| 172 |
+ return 0; |
| 173 |
+#endif |
| 174 |
} |
| 175 |
|
| 176 |
int |
| 177 |
g_string_append_smd5(GString *string, char *key) |
| 178 |
{ |
| 179 |
+#ifdef HAVE_MD5 |
| 180 |
unsigned char rand[4]; |
| 181 |
unsigned char tmp[MD5_DIGEST_LENGTH + sizeof(rand)]; |
| 182 |
MD5_CTX MD5context; |
| 183 |
@@ -172,4 +178,8 @@ g_string_append_smd5(GString *string, ch |
| 184 |
g_string_append_base64(string, tmp, sizeof(tmp)); |
| 185 |
|
| 186 |
return 1; |
| 187 |
+#else |
| 188 |
+ puts("Sorry, SMD5 support not linked into ldapvi."); |
| 189 |
+ return 0; |
| 190 |
+#endif |
| 191 |
} |