Date: Tue, 10 Aug 2004 13:58:46 +0100 From: Gareth McCaughan <gmccaughan@synaptics-uk.com> To: freebsd-questions@freebsd.org Subject: DES functions, net-snmp, and ethereal Message-ID: <200408101358.46819.gmccaughan@synaptics-uk.com>
next in thread | raw e-mail | index | archive | help
Executive summary: I'm getting "undefined reference to `des_cbc_encrypt'" and similar errors when trying to compile ethereal. How can I fix this? Details: I'm running 4.5-STABLE from April 2002, with a recently cvsupped ports collection. When I attempt to build ethereal (version 0.10.5) the compilation ends as follows (with apologies for grossly overlong lines...) | /bin/sh /usr/local/bin/libtool15 --mode=3Dlink cc -DINET6 -D_U_=3D"__a= ttribute__((unused))" -Wall -W -O -pipe -I/usr/local/include -D_THREAD_SAF= E -I/usr/local/include/atk-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/l= ib/glib-2.0/include -I/usr/X11R6/include/gtk-2.0 -I/usr/X11R6/lib/gtk-2.0/i= nclude -I/usr/X11R6/include -I/usr/X11R6/include/pango-1.0 -I/usr/local/inc= lude/freetype2 -I/usr/local/include -I/usr/X11R6/include -I/usr/local/lib= /include -DINET6 -O -pipe -Dfreebsd4 -I/usr/libdata/perl/5.00503/mach/CORE = =2DI. -I/usr/local/include -I/usr/include -L/usr/local/lib -L/usr/local/l= ib/lib -L/usr/lib -L/usr/local/lib/lib -o ethereal -export-dynamic pcap-uti= l-unix.o capture_stop_conditions.o cfile.o conditions.o disabled_protos.o = pcap-util.o range.o ringbuffer.o timestats.o version_info.o alert_box.o = capture.o file.o filters.o g711.o merge.o proto_hier_stats.o summary.o = gtk/libui.a wiretap/libwiretap.la epan/libethereal.la -L= /usr/local/lib -lnetsnmp -lcrypto -lm -lkvm -ldevstat -lcrypto = "-dlopen" self "-dlopen" plugins/acn/acn.la "-dlopen" plugins/artnet= /artnet.la "-dlopen" plugins/asn1/asn1.la "-dlopen" plugins/ciscosm/cisco= sm.la "-dlopen" plugins/docsis/docsis.la "-dlopen" plugins/enttec/enttec.= la "-dlopen" plugins/giop/cosnaming.la "-dlopen" plugins/giop/coseventcom= m.la "-dlopen" plugins/gryphon/gryphon.la "-dlopen" plugins/irda/irda.la = "-dlopen" plugins/lwres/lwres.la "-dlopen" plugins/megaco/megaco.la "-dl= open" plugins/mgcp/mgcp.la "-dlopen" plugins/pcli/pcli.la "-dlopen" plugi= ns/rdm/rdm.la "-dlopen" plugins/rlm/rlm.la "-dlopen" plugins/rtnet/rtnet.= la "-dlopen" plugins/rudp/rudp.la "-dlopen" plugins/v5ua/v5ua.la = -L/usr/local/lib/lib -lpcre -lz -lpcap -Wl,--export-dynami= c -pthread -L/usr/local/lib -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -l= Xrandr -lXi -lXinerama -lXcursor -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-= 1.0 -lXft -lfreetype -lz -lXrender -lXext -lfontconfig -lpangox-1.0 -lX11 -= lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -liconv -= ladns -lz -lpcre | rm -f .libs/ethereal.nm .libs/ethereal.nmS .libs/ethereal.nmT | creating .libs/etherealS.c | (cd .libs && cc -c -fno-builtin -fno-rtti -fno-exceptions "etherealS.c") | rm -f .libs/etherealS.c .libs/ethereal.nm .libs/ethereal.nmS .libs/ethe= real.nmT | cc -DINET6 "-D_U_=3D__attribute__((unused))" -Wall -W -O -pipe -I/usr/l= ocal/include -D_THREAD_SAFE -I/usr/local/include/atk-1.0 -I/usr/local/inclu= de/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/X11R6/include/gtk-2.0 = =2DI/usr/X11R6/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/X11R6/includ= e/pango-1.0 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/X11R= 6/include -I/usr/local/lib/include -DINET6 -O -pipe -Dfreebsd4 -I/usr/libda= ta/perl/5.00503/mach/CORE -I. -I/usr/local/include -I/usr/include -o .libs/= ethereal pcap-util-unix.o capture_stop_conditions.o cfile.o conditions.o di= sabled_protos.o pcap-util.o range.o ringbuffer.o timestats.o version_info.o= alert_box.o capture.o file.o filters.o g711.o merge.o proto_hier_stats.o s= ummary.o .libs/etherealS.o -Wl,--export-dynamic -Wl,--export-dynamic -L/us= r/local/lib -L/usr/local/lib/lib -L/usr/lib gtk/libui.a wiretap/.libs/libwi= retap.so epan/.libs/libethereal.so -lnetsnmp -lkvm -ldevstat -lcrypto -lpca= p -pthread -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lXrandr -lXi -lXin= erama -lXcursor -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lXft /usr/lo= cal/lib/libfreetype.so -lXrender -lXext -lfontconfig -lpangox-1.0 -lX11 -lp= ango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -liconv -ladn= s -lz -lpcre -Wl,--rpath -Wl,/usr/X11R6/lib -Wl,--rpath -Wl,/usr/local/lib | /usr/lib/libc.so.4: WARNING! setkey(3) not present in the system! | /usr/lib/libc.so.4: warning: this program uses gets(), which is unsafe. | /usr/lib/libc.so.4: warning: mktemp() possibly used unsafely; consider = using mkstemp() | /usr/lib/libc.so.4: WARNING! des_setkey(3) not present in the system! | /usr/lib/libc.so.4: WARNING! encrypt(3) not present in the system! | /usr/lib/libc.so.4: warning: tmpnam() possibly used unsafely; consider = using mkstemp() | /usr/lib/libc.so.4: warning: this program uses f_prealloc(), which is n= ot recommended. | /usr/lib/libc.so.4: WARNING! des_cipher(3) not present in the system! | /usr/lib/libc.so.4: warning: tempnam() possibly used unsafely; consider= using mkstemp() | /usr/local/lib/libnetsnmp.so: undefined reference to `des_cbc_encrypt' | /usr/local/lib/libnetsnmp.so: undefined reference to `des_key_sched' | /usr/local/lib/libnetsnmp.so: undefined reference to `des_ncbc_encrypt' at which point "make" gives up. "nm /usr/local/lib/libnetsnmp.so | egrep des_key_sched" produces only "U des_key_sched". I'd naively have expected the des_... functions to be in libcrypto. According to "ldconfig -r" I have three different versions of libcrypto, in three different places. | 50:-lcrypto.2 =3D> /usr/lib/libcrypto.so.2 | 91:-lcrypto.1 =3D> /usr/lib/compat/libcrypto.so.1 | 169:-lcrypto.3 =3D> /usr/local/lib/libcrypto.so.3 Let's have a look inside those libraries. I'll ignore the /usr/lib/compat one because it seems obviously irrelevant. | $ for x in /usr/lib/libcrypto.so.2 usr/local/lib/libcrypto.so.3; do ech= o $x; nm --dynamic $x | egrep -i des_key_sched; done | /usr/lib/libcrypto.so.2 | 0004f154 T des_key_sched | /usr/local/lib/libcrypto.so.3 | 0003e338 T DES_key_sched | 00044f78 T _ossl_old_des_key_sched My installed version of OpenSSL is (in FreeBSD-ports-speak) 0.9.7d_1, and my installed version of net-snmp is 5.1.1_6. I'm outside the USA (and, more directly relevant, don't have USA_RESIDENT defined in /etc/defaults/make.conf), if that makes a difference to what crypto stuff I have installed where. At this point I run out of shared-library-fu, not to mention libtool-fu. Maybe I could coerce ethereal into building by diddling with that command line until the linker consents to use the older version of libcrypto, or by renaming the newer version out of the way, but that all seems like obviously the Wrong Thing. (Well, actually, I just tried the latter, and it worked. To get ethereal to actually install, it was also necessary to work around a bit of breakage in the version of "sed" I have, which has presumably been repaired in more recent 4.x releases. Anyway, this still seems to me like the Wrong Thing, which is why I'm still asking this question.) Can anyone enlighten me as to (1) exactly what's going on here and (2) what I should do about it? Many thanks! =2D-=20 Gareth McCaughan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408101358.46819.gmccaughan>