diff options
author | Jörg Mayer <jmayer@loplof.de> | 2004-03-17 18:20:58 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2004-03-17 18:20:58 +0000 |
commit | 9920ca911230473e90a785e6f83ac4ed74c25d8f (patch) | |
tree | 5cfc37fcd743e91f9b41d09d6b272dad3d8c97e3 | |
parent | 0e4e864b488943d4c423bac6e790db91c01d38c9 (diff) | |
download | wireshark-9920ca911230473e90a785e6f83ac4ed74c25d8f.tar.gz wireshark-9920ca911230473e90a785e6f83ac4ed74c25d8f.tar.bz2 wireshark-9920ca911230473e90a785e6f83ac4ed74c25d8f.zip |
Experimental Heimdal Kerberos detection.
As this is experimental and does not yet work reliably this feature is
off by default. Enable it by using --with-krb5 during configure.
Please do not yet make use of this feature (i.e. please do not *use* the
defines provided by this option), until it has received further testing
and fixing.
Please run and check what the configure says.
svn path=/trunk/; revision=10395
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | acinclude.m4 | 119 | ||||
-rw-r--r-- | configure.in | 46 | ||||
-rw-r--r-- | epan/acinclude.m4 | 119 | ||||
-rw-r--r-- | epan/configure.in | 39 |
5 files changed, 321 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am index 7850f9c5e9..21d990c2ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ # Makefile.am # Automake file for Ethereal # -# $Id: Makefile.am,v 1.721 2004/03/14 08:07:16 jmayer Exp $ +# $Id: Makefile.am,v 1.722 2004/03/17 18:20:57 jmayer Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs <gerald@ethereal.com> @@ -369,6 +369,7 @@ EXTRA_DIST = \ README.hpux \ README.irix \ README.linux \ + REAMDE.macos \ README.tru64 \ README.vmware \ README.win32 \ diff --git a/acinclude.m4 b/acinclude.m4 index f9999480a9..f4fb656391 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2,7 +2,7 @@ dnl Macros that test for specific features. dnl This file is part of the Autoconf packaging for Ethereal. dnl Copyright (C) 1998-2000 by Gerald Combs. dnl -dnl $Id: acinclude.m4,v 1.68 2004/02/26 09:39:43 guy Exp $ +dnl $Id: acinclude.m4,v 1.69 2004/03/17 18:20:57 jmayer Exp $ dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -849,3 +849,120 @@ changequote([, ])dnl AC_MSG_RESULT(not required) fi ]) + + +# +# AC_ETHEREAL_KRB5_CHECK +# +AC_DEFUN(AC_ETHEREAL_KRB5_CHECK, +[ + if test "x$krb5_dir" != "x" + then + # + # The user specified a directory in which kerberos resides, + # so add the "include" subdirectory of that directory to + # the include file search path and the "lib" subdirectory + # of that directory to the library search path. + # + # XXX - if there's also a kerberos in a directory that's + # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't + # make us find the version in the specified directory, + # as the compiler and/or linker will search that other + # directory before it searches the specified directory. + # + ethereal_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -I$krb5_dir/include" + ethereal_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$krb5_dir/include" + ethereal_save_LIBS="$LIBS" + LIBS="$LIBS -lkrb5 -lasn1 -lcrypto -lroken -lcrypt -lresolv" + ethereal_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$krb5_dir/lib" + else + AC_PATH_PROG(KRB5_CONFIG, krb5-config) + if test -x $KRB5_CONFIG + then + KRB5_FLAGS=`$KRB5_CONFIG --cflags` + CFLAGS="$CFLAGS $KRB5_FLAGS" + CPPFLAGS="$CPPFLAGS $KRB5_FLAGS" + KRB5_LIBS=`$KRB5_CONFIG --libs` + LIBS="$LIBS $KRB5_LIBS" + ac_krb5_version=`$KRB5_CONFIG --version | head -n 1 | sed 's/^.*heimdal.*$/HEIMDAL/i'` + fi + fi + + # + # Make sure we have "krb5.h". If we don't, it means we probably + # don't have kerberos, so don't use it. + # + AC_CHECK_HEADER(krb5.h,, + [ + if test "x$krb5_dir" != "x" + then + # + # The user used "--with-krb5=" to specify a directory + # containing kerberos, but we didn't find the header file + # there; that either means they didn't specify the + # right directory or are confused about whether kerberos + # is, in fact, installed. Report the error and give up. + # + AC_MSG_ERROR([kerberos header not found in directory specified in --with-krb5]) + else + if test "x$want_krb5" = "xyes" + then + # + # The user tried to force us to use the library, but we + # couldn't find the header file; report an error. + # + AC_MSG_ERROR(Header file krb5.h not found.) + else + # + # We couldn't find the header file; don't use the + # library, as it's probably not present. + # + want_krb5=no + fi + fi + ]) + + if test "x$want_krb5" != "xno" -a "x$ac_krb5_version" = "xHEIMDAL" + then + # + # Well, we at least have the krb5 header file. + # + AC_CHECK_LIB(krb5, krb5_kt_resolve, + [ + if test "x$krb5_dir" != "x" + then + # + # Put the "-I" and "-L" flags for pcre at + # the beginning of CFLAGS, CPPFLAGS, + # LDFLAGS, and LIBS. + # + KRB5_LIBS="-L$krb5_dir/lib $KRB5_LIBS" + fi + AC_DEFINE(HAVE_KERBEROS, 1, [Define to use kerberos]) + AC_DEFINE(HAVE_HEIMDAL_KERBEROS, 1, [Define to use heimdal kerberos]) + ],[ + if test "x$krb5_dir" != "x" + then + # + # Restore the versions of CFLAGS, CPPFLAGS, + # LDFLAGS, and LIBS before we added the + # "--with-krb5=" directory, as we didn't + # actually find kerberos there. + # + CFLAGS="$ethereal_save_CFLAGS" + CPPFLAGS="$ethereal_save_CPPFLAGS" + LDFLAGS="$ethereal_save_LDFLAGS" + LIBS="$ethereal_save_LIBS" + KRB5_LIBS="" + fi + want_krb5=no + ]) + AC_SUBST(KRB5_LIBS) + else + want_krb5=no + fi +]) + diff --git a/configure.in b/configure.in index b39c13dd3a..47154905bd 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.250 2004/03/04 06:28:42 guy Exp $ +# $Id: configure.in,v 1.251 2004/03/17 18:20:57 jmayer Exp $ # AC_INIT(etypes.h) @@ -701,6 +701,43 @@ fi AC_SUBST(SNMP_LIBS) + +dnl kerberos/heimdal check +AC_MSG_CHECKING(whether to use kerberos/heimdal) + +AC_ARG_WITH(krb5, +changequote(<<, >>)dnl +<< --with-krb5[=DIR] use kerberos/heimdal (located in directory DIR, if supplied) to use in kerberos dissection [default=no]>>, +changequote([, ])dnl +[ + if test $withval = no + then + want_krb5=no + elif test $withval = yes + then + want_krb5=yes + else + want_krb5=no + krb5_dir=$withval + fi +],[ + # + # Use kerberos/heimdal if it's present, otherwise don't. + # + want_krb5=no + krb5_dir= +]) +if test "x$want_krb5" = "xno" ; then + AC_MSG_RESULT(no) +else + AC_MSG_RESULT(yes) + AC_ETHEREAL_KRB5_CHECK + if test "x$want_krb5" = "xno" ; then + AC_MSG_RESULT(heimdal not found - disabling dissection for some kerberos data in packet decoding) + fi +fi + + dnl ADNS Check ADNS_LIBS='' AC_MSG_CHECKING(whether to use the GNU ADNS library if available) @@ -916,6 +953,12 @@ else pcre_message="yes" fi +if test "x$want_krb5" = "xno" ; then + krb5_message="no" +else + krb5_message="yes (heimdal)" +fi + if test "x$have_good_adns" = "xyes" ; then adns_message="yes" else @@ -951,6 +994,7 @@ fi echo " Use pcap library : $want_pcap" echo " Use zlib library : $zlib_message" echo " Use pcre library : $pcre_message" +echo " Use kerberos library : $krb5_message" echo " Use GNU ADNS library : $adns_message" echo " Use IPv6 name resolution : $enable_ipv6" echo " Use UCD SNMP/NET-SNMP library : $snmp_libs_message" diff --git a/epan/acinclude.m4 b/epan/acinclude.m4 index 3c0207ab6d..7974c61e17 100644 --- a/epan/acinclude.m4 +++ b/epan/acinclude.m4 @@ -2,7 +2,7 @@ dnl Macros that test for specific features. dnl This file is part of the Autoconf packaging for Ethereal. dnl Copyright (C) 1998-2000 by Gerald Combs. dnl -dnl $Id: acinclude.m4,v 1.6 2003/12/17 02:41:04 guy Exp $ +dnl $Id: acinclude.m4,v 1.7 2004/03/17 18:20:58 jmayer Exp $ dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -288,3 +288,120 @@ AC_DEFUN(AC_ETHEREAL_LIBPCRE_CHECK, AC_SUBST(PCRE_LIBS) fi ]) + + +# +# AC_ETHEREAL_KRB5_CHECK +# +AC_DEFUN(AC_ETHEREAL_KRB5_CHECK, +[ + if test "x$krb5_dir" != "x" + then + # + # The user specified a directory in which kerberos resides, + # so add the "include" subdirectory of that directory to + # the include file search path and the "lib" subdirectory + # of that directory to the library search path. + # + # XXX - if there's also a kerberos in a directory that's + # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't + # make us find the version in the specified directory, + # as the compiler and/or linker will search that other + # directory before it searches the specified directory. + # + ethereal_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -I$krb5_dir/include" + ethereal_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$krb5_dir/include" + ethereal_save_LIBS="$LIBS" + LIBS="$LIBS -lkrb5 -lasn1 -lcrypto -lroken -lcrypt -lresolv" + ethereal_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$krb5_dir/lib" + else + AC_PATH_PROG(KRB5_CONFIG, krb5-config) + if test -x $KRB5_CONFIG + then + KRB5_FLAGS=`$KRB5_CONFIG --cflags` + CFLAGS="$CFLAGS $KRB5_FLAGS" + CPPFLAGS="$CPPFLAGS $KRB5_FLAGS" + KRB5_LIBS=`$KRB5_CONFIG --libs` + LIBS="$LIBS $KRB5_LIBS" + ac_krb5_version=`$KRB5_CONFIG --version | head -n 1 | sed 's/^.*heimdal.*$/HEIMDAL/i'` + fi + fi + + # + # Make sure we have "krb5.h". If we don't, it means we probably + # don't have kerberos, so don't use it. + # + AC_CHECK_HEADER(krb5.h,, + [ + if test "x$krb5_dir" != "x" + then + # + # The user used "--with-krb5=" to specify a directory + # containing kerberos, but we didn't find the header file + # there; that either means they didn't specify the + # right directory or are confused about whether kerberos + # is, in fact, installed. Report the error and give up. + # + AC_MSG_ERROR([kerberos header not found in directory specified in --with-krb5]) + else + if test "x$want_krb5" = "xyes" + then + # + # The user tried to force us to use the library, but we + # couldn't find the header file; report an error. + # + AC_MSG_ERROR(Header file krb5.h not found.) + else + # + # We couldn't find the header file; don't use the + # library, as it's probably not present. + # + want_krb5=no + fi + fi + ]) + + if test "x$want_krb5" != "xno" -a "x$ac_krb5_version" = "xHEIMDAL" + then + # + # Well, we at least have the krb5 header file. + # + AC_CHECK_LIB(krb5, krb5_kt_resolve, + [ + if test "x$krb5_dir" != "x" + then + # + # Put the "-I" and "-L" flags for pcre at + # the beginning of CFLAGS, CPPFLAGS, + # LDFLAGS, and LIBS. + # + KRB5_LIBS="-L$krb5_dir/lib $KRB5_LIBS" + fi + AC_DEFINE(HAVE_KERBEROS, 1, [Define to use kerberos]) + AC_DEFINE(HAVE_HEIMDAL_KERBEROS, 1, [Define to use heimdal kerberos]) + ],[ + if test "x$krb5_dir" != "x" + then + # + # Restore the versions of CFLAGS, CPPFLAGS, + # LDFLAGS, and LIBS before we added the + # "--with-krb5=" directory, as we didn't + # actually find kerberos there. + # + CFLAGS="$ethereal_save_CFLAGS" + CPPFLAGS="$ethereal_save_CPPFLAGS" + LDFLAGS="$ethereal_save_LDFLAGS" + LIBS="$ethereal_save_LIBS" + KRB5_LIBS="" + fi + want_krb5=no + ]) + AC_SUBST(KRB5_LIBS) + else + want_krb5=no + fi +]) + diff --git a/epan/configure.in b/epan/configure.in index 9c9e2edc21..0e200ef69e 100644 --- a/epan/configure.in +++ b/epan/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.66 2004/03/13 10:15:35 jmayer Exp $ +# $Id: configure.in,v 1.67 2004/03/17 18:20:58 jmayer Exp $ # AC_INIT(epan.c) @@ -178,6 +178,43 @@ else AC_ETHEREAL_IPV6_STACK fi + +dnl kerberos/heimdal check +AC_MSG_CHECKING(whether to use kerberos/heimdal) + +AC_ARG_WITH(krb5, +changequote(<<, >>)dnl +<< --with-krb5[=DIR] use kerberos/heimdal (located in directory DIR, if supplied) to use in kerberos dissection [default=no]>>, +changequote([, ])dnl +[ + if test $withval = no + then + want_krb5=no + elif test $withval = yes + then + want_krb5=yes + else + want_krb5=no + krb5_dir=$withval + fi +],[ + # + # Use kerberos/heimdal if it's present, otherwise don't. + # + want_krb5=no + krb5_dir= +]) +if test "x$want_krb5" = "xno" ; then + AC_MSG_RESULT(no) +else + AC_MSG_RESULT(yes) + AC_ETHEREAL_KRB5_CHECK + if test "x$want_krb5" = "xno" ; then + AC_MSG_RESULT(heimdal not found - disabling dissection for some kerberos data in packet decoding) + fi +fi + + AC_CHECK_FUNC(inet_aton, INET_ATON_O="", INET_ATON_O="inet_aton.lo") if test "$ac_cv_func_inet_aton" = no ; then |