]> asedeno.scripts.mit.edu Git - 1ts-debian.git/commitdiff
actualy pre-libzephyr4 tag origin/tags/zephyr-pre-libzephyr4
authorkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Thu, 25 Dec 2008 01:11:08 +0000 (01:11 +0000)
committerkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Thu, 25 Dec 2008 01:11:08 +0000 (01:11 +0000)
git-svn-id: svn://svn.1ts.org/debian/tags/zephyr-pre-libzephyr4@396 cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f

zephyr/configure
zephyr/configure.in
zephyr/h/config.h.in
zephyr/h/internal.h
zephyr/h/zephyr/zephyr.h
zephyr/lib/ZInit.c
zephyr/lib/Zinternal.c
zephyr/lib/quad_cksum.c
zephyr/server/bdump.c
zephyr/server/subscr.c
zephyr/server/zserver.h

index 90b740e03a668b551e83730f9cce892a2d8996b6..00d5e4284a0209d1741aca6ab888aeee79a1d385 100755 (executable)
@@ -860,6 +860,7 @@ TLIB
 RLIB
 SLIB
 KRB4_LIBS
+krb5config
 KRB5_LIBS
 HESIOD_LIBS
 REGEX_LIBS
@@ -1476,7 +1477,6 @@ Optional Packages:
                           both]
   --with-tags[=TAGS]      include additional configurations [automatic]
   --with-x                use the X Window System
-  --with-openssl=PREFIX      Use OpenSSL crypto
   --with-krb4=PREFIX      Use Kerberos 4
   --with-krb5=PREFIX      Use Kerberos 5
   --with-hesiod=PREFIX    Use Hesiod
 
 
 
-# Check whether --with-openssl was given.
-if test "${with_openssl+set}" = set; then
-  withval=$with_openssl; openssl="$withval"
-else
-  openssl=no
-fi
-
-if test "$openssl" != no; then
-   { echo "$as_me:$LINENO: checking for DES_ecb_encrypt in -lcrypto" >&5
-echo $ECHO_N "checking for DES_ecb_encrypt in -lcrypto... $ECHO_C" >&6; }
-if test "${ac_cv_lib_crypto_DES_ecb_encrypt+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char DES_ecb_encrypt ();
-int
-main ()
-{
-return DES_ecb_encrypt ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_crypto_DES_ecb_encrypt=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_crypto_DES_ecb_encrypt=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_DES_ecb_encrypt" >&5
-echo "${ECHO_T}$ac_cv_lib_crypto_DES_ecb_encrypt" >&6; }
-if test $ac_cv_lib_crypto_DES_ecb_encrypt = yes; then
-  OPENSSL_LIBS=-lcrypto
-               cat >>confdefs.h <<\_ACEOF
-#define HAVE_OPENSSL 1
-_ACEOF
-
-else
-  { { echo "$as_me:$LINENO: error: Openssl requested but not found" >&5
-echo "$as_me: error: Openssl requested but not found" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-fi
-
-
 # Check whether --with-krb4 was given.
 if test "${with_krb4+set}" = set; then
   withval=$with_krb4; krb4="$withval"
@@ -24102,6 +24018,379 @@ _ACEOF
 fi
 
 
+
+# Check whether --with-krb5 was given.
+if test "${with_krb5+set}" = set; then
+  withval=$with_krb5; krb5="$withval"
+else
+  krb5=no
+fi
+
+if test "$krb5" != no; then
+   { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
+echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; }
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_gethostbyname=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_gethostbyname+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+  :
+else
+  ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+   { echo "$as_me:$LINENO: checking for library containing socket" >&5
+echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; }
+if test "${ac_cv_search_socket+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_socket=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_socket+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_socket+set}" = set; then
+  :
+else
+  ac_cv_search_socket=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
+echo "${ECHO_T}$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for compile in -lgen" >&5
+echo $ECHO_N "checking for compile in -lgen... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gen_compile+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgen  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char compile ();
+int
+main ()
+{
+return compile ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_gen_compile=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_gen_compile=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gen_compile" >&5
+echo "${ECHO_T}$ac_cv_lib_gen_compile" >&6; }
+if test $ac_cv_lib_gen_compile = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGEN 1
+_ACEOF
+
+  LIBS="-lgen $LIBS"
+
+fi
+
+   if test "$krb5" != yes; then
+      PATH="$PATH:$krb5/bin"
+   fi
+   # Extract the first word of "krb5-config", so it can be a program name with args.
+set dummy krb5-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_krb5config+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$krb5config"; then
+  ac_cv_prog_krb5config="$krb5config" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_krb5config="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+krb5config=$ac_cv_prog_krb5config
+if test -n "$krb5config"; then
+  { echo "$as_me:$LINENO: result: $krb5config" >&5
+echo "${ECHO_T}$krb5config" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+   if test "$krb5config" == yes; then
+      CPPFLAGS="$CPPFLAGS $(krb5-config --cflags krb5)"
+      KRB5_LIBS="$(krb5-config --libs krb5)"
+   else
+      if test "$krb5" != yes; then
+        CPPFLAGS="$CPPFLAGS -I$krb5/include"
+        LDFLAGS="$LDFLAGS -L$krb5/lib"
+      fi
+      { echo "$as_me:$LINENO: checking for krb5_init_context in -lkrb5" >&5
+echo $ECHO_N "checking for krb5_init_context in -lkrb5... $ECHO_C" >&6; }
+if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb5 -lk5crypto -lcom_err $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_init_context ();
+int
+main ()
+{
+return krb5_init_context ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_krb5_krb5_init_context=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_krb5_krb5_init_context=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_init_context" >&5
+echo "${ECHO_T}$ac_cv_lib_krb5_krb5_init_context" >&6; }
+if test $ac_cv_lib_krb5_krb5_init_context = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Kerberos 5 libraries not found" >&5
+echo "$as_me: error: Kerberos 5 libraries not found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+      KRB5_LIBS="-lkrb5 -l5crypto -lcom_err"
+   fi
+   cat >>confdefs.h <<\_ACEOF
+#define HAVE_KRB5 1
+_ACEOF
+
+fi
+
+
+
 # Check whether --with-krb5 was given.
 if test "${with_krb5+set}" = set; then
   withval=$with_krb5; krb5="$withval"
@@ -24357,7 +24646,7 @@ if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkrb5 -lk5crypto -lcom_err $LIBS"
+LIBS="-lkrb5  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24420,7 +24709,7 @@ echo "$as_me: error: Kerberos 5 libraries not found" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-       KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err"
+       KRB5_LIBS="-lkrb5"
        cat >>confdefs.h <<\_ACEOF
 #define HAVE_KRB5 1
 _ACEOF
@@ -25409,7 +25698,7 @@ else
 echo "$as_me: error: This package requires ss." >&2;}
    { (exit 1); exit 1; }; }
 fi
-LIBS="$OPENSSL_LIBS $KRB5_LIBS $KRB4_LIBS $HESIOD_LIBS $LIBS"
+LIBS="$KRB5_LIBS $KRB4_LIBS $HESIOD_LIBS $LIBS"
 
 if test $ac_cv_c_compiler_gnu = yes; then
     { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
 done
 
 
+for ac_func in krb5_crypto_init
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
 { echo "$as_me:$LINENO: checking for krb5_auth_con_getauthenticator taking double pointer" >&5
 echo $ECHO_N "checking for krb5_auth_con_getauthenticator taking double pointer... $ECHO_C" >&6; }
 if test "${ac_cv_krb5_auth_con_getauthenticator_takes_double_pointer+set}" = set; then
@@ -26989,10 +27372,10 @@ TLIB!$TLIB$ac_delim
 RLIB!$RLIB$ac_delim
 SLIB!$SLIB$ac_delim
 KRB4_LIBS!$KRB4_LIBS$ac_delim
+krb5config!$krb5config$ac_delim
 KRB5_LIBS!$KRB5_LIBS$ac_delim
 HESIOD_LIBS!$HESIOD_LIBS$ac_delim
 REGEX_LIBS!$REGEX_LIBS$ac_delim
-ARES_LIBS!$ARES_LIBS$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -27034,11 +27417,12 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+ARES_LIBS!$ARES_LIBS$ac_delim
 LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 2; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 3; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index d24a891395c9794bd09834d8718b60cee0423c83..7768afa6e4366484bbb12f6cd1e007c703c6c7f9 100644 (file)
@@ -84,23 +84,43 @@ AC_SUBST(TLIB)
 AC_SUBST(RLIB)
 AC_SUBST(SLIB)
 
-AC_ARG_WITH(openssl,
-       [  --with-openssl=PREFIX      Use OpenSSL crypto],
-       [openssl="$withval"], [openssl=no])
-if test "$openssl" != no; then
-   AC_CHECK_LIB(crypto, DES_ecb_encrypt, [OPENSSL_LIBS=-lcrypto
-               AC_DEFINE(HAVE_OPENSSL)],
-               [AC_MSG_ERROR(Openssl requested but not found)])
+ATHENA_KRB4
+
+AC_ARG_WITH(krb5,
+           [  --with-krb5=PREFIX      Use Kerberos 5],
+           [krb5="$withval"], [krb5=no])
+if test "$krb5" != no; then
+   AC_SEARCH_LIBS(gethostbyname, nsl)
+   AC_SEARCH_LIBS(socket, socket)
+   AC_CHECK_LIB(gen, compile)
+   if test "$krb5" != yes; then
+      PATH="$PATH:$krb5/bin"
+   fi
+   AC_CHECK_PROG(krb5config, krb5-config,yes)
+   if test "$krb5config" == yes; then
+      CPPFLAGS="$CPPFLAGS $(krb5-config --cflags krb5)"
+      KRB5_LIBS="$(krb5-config --libs krb5)"
+   else
+      if test "$krb5" != yes; then
+        CPPFLAGS="$CPPFLAGS -I$krb5/include"
+        LDFLAGS="$LDFLAGS -L$krb5/lib"
+      fi
+      AC_CHECK_LIB(krb5, krb5_init_context, :,
+                  [AC_MSG_ERROR(Kerberos 5 libraries not found)],
+                  -lk5crypto -lcom_err)
+      KRB5_LIBS="-lkrb5 -l5crypto -lcom_err"
+   fi
+   AC_DEFINE(HAVE_KRB5)
 fi
+AC_SUBST(KRB5_LIBS)
 
-ATHENA_KRB4
 ATHENA_KRB5
 ATHENA_HESIOD
 ATHENA_REGEXP
 ATHENA_ARES
 ATHENA_UTIL_COM_ERR
 ATHENA_UTIL_SS
-LIBS="$OPENSSL_LIBS $KRB5_LIBS $KRB4_LIBS $HESIOD_LIBS $LIBS"
+LIBS="$KRB5_LIBS $KRB4_LIBS $HESIOD_LIBS $LIBS"
 
 dnl Checks for library functions.
 AC_PROG_GCC_TRADITIONAL
@@ -110,6 +130,7 @@ AC_FUNC_SETPGRP
 AC_CHECK_FUNCS(putenv strchr memcpy memmove waitpid getlogin strerror random)
 AC_CHECK_FUNCS(lrand48 gethostid getsid getpgid krb_get_err_text krb_log)
 AC_CHECK_FUNCS(krb5_free_data krb5_c_make_checksum krb5_cc_set_default_name)
+AC_CHECK_FUNCS(krb5_crypto_init)
 
 AC_MSG_CHECKING(for krb5_auth_con_getauthenticator taking double pointer)
 AC_CACHE_VAL(ac_cv_krb5_auth_con_getauthenticator_takes_double_pointer, [
index 688870f1387242cfeb023afa22da810f04026da0..ec4faad78eebe1eb30d2173bf35f336a0113a250 100644 (file)
@@ -20,6 +20,9 @@
 /* Define to 1 if you have the `krb5_cc_set_default_name' function. */
 #undef HAVE_KRB5_CC_SET_DEFAULT_NAME
 
+/* Define to 1 if you have the `krb5_crypto_init' function. */
+#undef HAVE_KRB5_CRYPTO_INIT
+
 /* Define to 1 if `krb5_auth_con_getauthenticator' takes a double pointer third arg. */
 #undef KRB5_AUTH_CON_GETAUTHENTICATOR_TAKES_DOUBLE_POINTER
 
 
 /* Define to `int' if <sys/types.h> doesn't define. */
 #undef uid_t
-
-/* Wether we have the openssl library about */
-#undef HAVE_OPENSSL
index 62a467d1d4fb4415f60e7d598732dfe6c136aea6..28695437a32afd070dc49e23edf6ca30995cc159 100644 (file)
@@ -93,6 +93,10 @@ extern int __subscriptions_next;
 
 extern int __Zephyr_port;              /* Port number */
 extern struct in_addr __My_addr;
+extern int __Zephyr_fd;
+extern int __Q_CompleteLength;
+extern struct sockaddr_in __HM_addr;
+extern char __Zephyr_realm[];
 
 typedef Code_t (*Z_SendProc) (ZNotice_t *, char *, int, int);
 
@@ -142,7 +146,7 @@ Code_t Z_InsertZcodeChecksum(krb5_keyblock *keyblock, ZNotice_t *notice,
                              char *cksum_start, int cksum_len, 
                              char *cstart, char *cend, int buffer_len,
                              int *length_ajdust);
-unsigned long z_quad_cksum(const unsigned char *, krb5_ui_4 *, long,
+unsigned long z_quad_cksum(const unsigned char *, u_int32_t *, long,
                           int, unsigned char *);
 #endif
 
index 230074486cb40c6d7ed7a0eaa5d329ac7746036d..0346e0550cd9360a641a5356f98e459d8ac8132e 100644 (file)
@@ -224,16 +224,11 @@ void Z_debug(const char *, ...);
 /* Compatibility */
 #define        ZNewLocateUser ZLocateUser
 
-/* Macros to retrieve Zephyr library values. */
-extern int __Zephyr_fd;
-extern int __Q_CompleteLength;
-extern struct sockaddr_in __HM_addr;
-extern char __Zephyr_realm[];
-#define ZGetFD()       __Zephyr_fd
-#define ZQLength()     __Q_CompleteLength
-#define ZGetDestAddr() __HM_addr
-
+/* Not macros to retrieve Zephyr library values. */
 const char *ZGetRealm(void);
+int ZGetFD (void);
+int ZQLength (void);
+struct sockaddr_in ZGetDestAddr (void);
 
 
 #ifdef Z_DEBUG
index 0c840683c2fbcc4fb3d7f53e083288f9bf5b7ccc..8f642571be177c65ffc78e9f62b01632e784e4b9 100644 (file)
@@ -194,4 +194,19 @@ ZInitialize(void)
     return (ZERR_NONE);
 }
 
-const char * ZGetRealm (void) { return __Zephyr_realm; }
+const char * ZGetRealm (void) {
+    return __Zephyr_realm;
+}
+
+int ZGetFD (void) {
+    return __Zephyr_fd;
+}
+
+int ZQLength (void) {
+    return __Q_CompleteLength;
+}
+
+struct sockaddr_in ZGetDestAddr (void) {
+    return __HM_addr;
+}
+
index 1edb8917298def9529f87646990910ef8a1d7e08..504a9a8f13ec4764d863f3542906c68f52a7e744 100644 (file)
@@ -1261,15 +1261,6 @@ ZSetDebug(void (*proc) __P((const char *, va_list, void *)),
 }
 #endif /* Z_DEBUG */
 
-#undef ZGetFD
-int ZGetFD (void) { return __Zephyr_fd; }
-
-#undef ZQLength
-int ZQLength (void) { return __Q_CompleteLength; }
-
-#undef ZGetDestAddr
-struct sockaddr_in ZGetDestAddr (void) { return __HM_addr; }
-
 #ifdef HAVE_KRB5
 Code_t
 Z_Checksum(krb5_data *cksumbuf,
@@ -1281,14 +1272,14 @@ Z_Checksum(krb5_data *cksumbuf,
     krb5_error_code result;
     unsigned char *data;
     int len;
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
     krb5_checksum checksum;
 #else
     Checksum checksum;
     krb5_crypto cryptctx;
 #endif
     
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
     /* Create the checksum -- MIT crypto API */
     result = krb5_c_make_checksum(Z_krb5_ctx, cksumtype,
                                  keyblock, Z_KEYUSAGE_CLT_CKSUM,
@@ -1326,7 +1317,7 @@ Z_Checksum(krb5_data *cksumbuf,
     memcpy(*asn1_data, data, len);
     *asn1_len = len;
 
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
     krb5_free_checksum_contents(Z_krb5_ctx, &checksum);
 #else
     free_Checksum(&checksum);
@@ -1423,7 +1414,7 @@ Z_krb5_verify_cksum(krb5_keyblock *keyblock,
                     int asn1_len)
 {
     krb5_error_code result;
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
     krb5_checksum checksum;
     krb5_boolean valid;
 #else
@@ -1433,7 +1424,7 @@ Z_krb5_verify_cksum(krb5_keyblock *keyblock,
 #endif
 
     memset(&checksum, 0, sizeof(checksum));
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
     /* Verify the checksum -- MIT crypto API */
     checksum.length = asn1_len;
     checksum.contents = asn1_data;
index 5d06440e270b79b7e844443d1e38a007a0067562..dc43e4635136c98c64c986987c61d5324926ec5f 100644 (file)
 
 
 /* System include files */
+#include <sys/types.h>
 #include <stdio.h>
 #include <errno.h>
 
 #ifdef HAVE_KRB5
 unsigned long
 z_quad_cksum(const unsigned char *in,  /* input block */
-            krb5_ui_4 *out,            /* optional longer output */
+            u_int32_t *out,            /* optional longer output */
             long length,               /* original length in bytes */
             int out_count,             /* number of iterations */
             unsigned char *c_seed      /* secret seed, 8 bytes */
@@ -137,12 +138,12 @@ z_quad_cksum(const unsigned char *in,     /* input block */
      * checksum is written unto the address pointed to.
      */
 
-    register krb5_ui_4 z;
-    register krb5_ui_4 z2;
-    register krb5_ui_4 x;
-    register krb5_ui_4 x2;
+    register u_int32_t z;
+    register u_int32_t z2;
+    register u_int32_t x;
+    register u_int32_t x2;
     const unsigned char *p;
-    register krb5_int32 len;
+    register int32_t len;
     register int i;
 
     /* use all 8 bytes of seed */
index 39b4cd8ec27a20475a407a338197fea19a5c80f9..490c2777ce64065fbbb8eb2c945d88217fc9c830 100644 (file)
@@ -102,6 +102,9 @@ static int setup_file_pointers(void);
 static void shutdown_file_pointers(void);
 static void cleanup(Server *server);
 
+#if defined(HAVE_KRB4) || defined(HAVE_KRB5)
+static int des_service_decrypt(unsigned char *in, unsigned char *out);
+#endif
 #ifdef HAVE_KRB5
 static long ticket5_time;
 #define TKT5LIFETIME 8*60*60
@@ -116,10 +119,13 @@ static long ticket_time;
 
 #endif /* HAVE_KRB4 */
 
-#if defined(HAVE_KRB4) || defined(HAVE_OPENSSL)
+#if defined(HAVE_KRB4)
 extern C_Block serv_key;
 extern Sched   serv_ksched;
 #endif
+#if defined(HAVE_KRB5) && !defined(HAVE_KRB4)
+krb5_keyblock  *server_key;
+#endif
 
 static Timer *bdump_timer;
 static int live_socket = -1;
@@ -997,7 +1003,9 @@ int got_des = 0;
 unsigned int enctypes[] = {ENCTYPE_DES_CBC_CRC,
                           ENCTYPE_DES_CBC_MD4,
                           ENCTYPE_DES_CBC_MD5,
+#ifdef ENCTYPE_DES_CBC_RAW
                           ENCTYPE_DES_CBC_RAW,
+#endif
                           0};
 #endif
 
@@ -1081,7 +1089,7 @@ get_tgt(void)
                                             0,
                                             NULL,
                                             &opt);
-#if defined(HAVE_OPENSSL) && !defined(HAVE_KRB4)
+#ifndef HAVE_KRB4
        if (retval) {
            krb5_free_principal(Z_krb5_ctx, principal);
            krb5_kt_close(Z_krb5_ctx, kt);
@@ -1095,21 +1103,24 @@ get_tgt(void)
                break;
        }
        if (!retval) {
-           retval = krb5_copy_keyblock(Z_krb5_ctx, &kt_ent.key, &serv_key);
+#ifdef HAVE_KRB5_CRYPTO_INIT
+           retval = krb5_copy_keyblock(Z_krb5_ctx, &kt_ent.keyblock,
+                                       &server_key);
+#else
+           retval = krb5_copy_keyblock(Z_krb5_ctx, &kt_ent.key, &server_key);
+#endif
            if (retval) {
                krb5_free_principal(Z_krb5_ctx, principal);
                krb5_kt_close(Z_krb5_ctx, kt);
                return(1);
            }
        
-           des_key_sched(serv_key, serv_ksched.s);
-
            got_des = 1;
        }
 #endif
        krb5_free_principal(Z_krb5_ctx, principal);
        krb5_kt_close(Z_krb5_ctx, kt);
-#if defined(HAVE_OPENSSL) && !defined(HAVE_KRB4)
+#ifndef HAVE_KRB4
        if (retval) return(1);
 #endif
 
@@ -1168,7 +1179,11 @@ bdump_recv_loop(Server *server)
 #endif
 #if defined(HAVE_KRB4) || defined(HAVE_KRB5)    
     char *cp;
+#ifndef HAVE_KRB4
+    unsigned char cblock[8];
+#else
     C_Block cblock;
+#endif
 #endif
     ZRealm *realm = NULL;
  
@@ -1268,32 +1283,31 @@ bdump_recv_loop(Server *server)
            if (*notice.z_class_inst) {
                /* check out this session key I found */
                cp = notice.z_message + strlen(notice.z_message) + 1;
-               switch (*cp) {
-#if defined(HAVE_KRB4) || defined(HAVE_OPENSSL)
-                   if (got_des) {
-                       /* ****ing netascii; this is an encrypted DES keyblock
-                          XXX this code should be conditionalized for server
-                          transitions   */
-                       retval = Z_krb5_init_keyblock(Z_krb5_ctx, ENCTYPE_DES_CBC_CRC,
-                                                     sizeof(C_Block),
-                                                     &client->session_keyblock);
+               if (*cp == '0' && got_des) {
+                   /* ****ing netascii; this is an encrypted DES keyblock
+                      XXX this code should be conditionalized for server
+                      transitions   */
+                   retval = Z_krb5_init_keyblock(Z_krb5_ctx, ENCTYPE_DES_CBC_CRC,
+                                                 sizeof(cblock),
+                                                 &client->session_keyblock);
+                   if (retval) {
+                       syslog(LOG_ERR, "brl failed to allocate DES keyblock: %s",
+                              error_message(retval));
+                       return retval;
+                   }
+                   retval = ZReadAscii(cp, strlen(cp), cblock, sizeof(cblock));
+                   if (retval != ZERR_NONE) {
+                       syslog(LOG_ERR,"brl bad cblk read: %s (%s)",
+                              error_message(retval), cp);
+                   } else {
+                       retval = des_service_decrypt(cblock, Z_keydata(client->session_keyblock));
                        if (retval) {
-                           syslog(LOG_ERR, "brl failed to allocate DES keyblock: %s",
+                           syslog(LOG_ERR, "brl failed to decyrpt DES session key: %s",
                                   error_message(retval));
                            return retval;
                        }
-                       retval = ZReadAscii(cp, strlen(cp), cblock, sizeof(C_Block));
-                       if (retval != ZERR_NONE) {
-                           syslog(LOG_ERR,"brl bad cblk read: %s (%s)",
-                              error_message(retval), cp);
-                       } else {
-                           des_ecb_encrypt((C_Block *)cblock, (C_Block *)Z_keydata(client->session_keyblock),
-                                           serv_ksched.s, DES_DECRYPT);
-                       }
                    }
-                   break;
-#endif
-               case 'Z':
+               } else if (*cp == 'Z') {
                    /* Zcode! Long live the new flesh! */
                    retval = ZReadZcode((unsigned char *)cp, buf, sizeof(buf), &blen);
                    if (retval != ZERR_NONE) {
@@ -1312,7 +1326,6 @@ bdump_recv_loop(Server *server)
                        memcpy(Z_keydata(client->session_keyblock), &buf[8],
                               Z_keylen(client->session_keyblock));
                    }
-                   break;
                }
            }
 #else
@@ -1659,3 +1672,28 @@ setup_file_pointers (void)
 
     return 0;
 }
+
+#ifdef HAVE_KRB5
+static int des_service_decrypt(unsigned char *in, unsigned char *out) {
+#ifndef HAVE_KRB4
+    krb5_data dout;
+    krb5_enc_data din;
+
+    dout.length = 8;
+    dout.data = out;
+
+    din.ciphertext.length = 8;
+    din.ciphertext.data = in;
+    din.enctype = Z_enctype(server_key);
+
+#ifdef HAVE_KRB5_CRYPTO_INIT
+    return krb5_c_decrypt(Z_krb5_ctx, *server_key, 0, 0, &din, &dout);
+#else
+    return krb5_c_decrypt(Z_krb5_ctx, server_key, 0, 0, &din, &dout);
+#endif
+#else
+    des_ecb_encrypt((C_Block *)in, (C_Block *)out, serv_ksched.s, DES_DECRYPT);
+    return 0; /* sigh */
+#endif
+}
+#endif
index 8515644a4f9b08cb1bea3618dc9f628df17d0e8e..63b71095b1cf92a1ae760791246ebfd1fb084d67 100644 (file)
@@ -61,7 +61,7 @@ static const char rcsid_subscr_c[] = "$Id$";
  *
  */
 
-#if defined(HAVE_KRB4) || defined(HAVE_OPENSSL)
+#if defined(HAVE_KRB4)
 C_Block        serv_key;
 Sched  serv_ksched;
 #endif
index 54a56e66b2b9e7fc51e7f7b9f1d80165bd420b36..078a8a7df30c56f1c8a6e2072f12e081f19ab2b5 100644 (file)
@@ -61,12 +61,7 @@ extern C_Block __Zephyr_session;
 /* Current time as cached by main(); use instead of time(). */
 #define NOW t_local.tv_sec
 
-#if defined(HAVE_OPENSSL) & !defined(HAVE_KRB4)
-#define OPENSSL_DES_LIBDES_COMPATIBILITY
-#include <openssl/des.h>
-#endif
-
-#if defined(HAVE_KRB4) || defined(HAVE_OPENSSL)
+#ifdef HAVE_KRB4
 /* Kerberos shouldn't stick us with array types... */
 typedef struct {
     des_key_schedule s;