From owner-freebsd-bugs Tue Sep 15 16:00:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA00306 for freebsd-bugs-outgoing; Tue, 15 Sep 1998 16:00:18 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA00298 for ; Tue, 15 Sep 1998 16:00:17 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id QAA04947; Tue, 15 Sep 1998 16:00:01 -0700 (PDT) Received: from Sisyphos.MI.Uni-Koeln.DE (Sisyphos.MI.Uni-Koeln.DE [134.95.212.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA28608 for ; Tue, 15 Sep 1998 15:50:30 -0700 (PDT) (envelope-from se@dialup124.zpr.uni-koeln.de) Received: from dialup124.zpr.Uni-Koeln.DE (dialup124.zpr.Uni-Koeln.DE [134.95.219.124]) by Sisyphos.MI.Uni-Koeln.DE (8.8.7/8.8.7) with ESMTP id AAA06049 for ; Wed, 16 Sep 1998 00:49:44 +0200 (MET DST) Received: (from se@localhost) by dialup124.zpr.Uni-Koeln.DE (8.8.8/8.6.9) id AAA01952; Wed, 16 Sep 1998 00:03:57 +0200 (CEST) Message-Id: <199809152203.AAA01952@dialup124.zpr.Uni-Koeln.DE> Date: Wed, 16 Sep 1998 00:03:57 +0200 (CEST) From: Stefan Esser Reply-To: se@dialup124.zpr.uni-koeln.de To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/7941: FIX: keyserv with DES not ready for ELF Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7941 >Category: bin >Synopsis: FIX: keyserv with DES not ready for ELF >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 15 16:00:01 PDT 1998 >Last-Modified: >Originator: Stefan Esser >Organization: >Release: FreeBSD 3.0-CURRENT i386 >Environment: FreeBSD 3.0-current (ELF) >Description: There are no compilation errors if you build "keyserv" on an ELF system, but because of differences in the library names and symbol names, the resulting binary can't attach _des_crypt() from libdes.so and falls back to ARCFOUR. >How-To-Repeat: On a system with DES sources and ELF do: $ keyserv -v Watch the output of that command, it indicates that no DES support is available. >Fix: The following patch should not cause any trouble under -stable or under -current/aout, but fixes the ELF case. I was not sure, whether dlopen() should be called with "libdes.so" or with "libdes.so.3". I chose the latter ... Index: Makefile =================================================================== RCS file: /usr/cvs/src/usr.sbin/keyserv/Makefile,v retrieving revision 1.3 diff -C2 -r1.3 Makefile *** Makefile 1998/05/09 13:32:37 1.3 --- Makefile 1998/09/15 21:51:46 *************** *** 7,10 **** --- 7,13 ---- CFLAGS+= -DKEYSERV_RANDOM -DBROKEN_DES -I. + .if $(OBJFORMAT) == elf + CFLAGS+= -DOBJFORMAT_ELF + .endif DPADD= ${LIBMP} ${LIBRPCSVC} Index: crypt_server.c =================================================================== RCS file: /usr/cvs/src/usr.sbin/keyserv/crypt_server.c,v retrieving revision 1.3 diff -C2 -r1.3 crypt_server.c *** crypt_server.c 1997/09/23 06:36:26 1.3 --- crypt_server.c 1998/09/15 21:50:35 *************** *** 172,176 **** --- 172,180 ---- #ifndef LIBDES + #ifdef OBJFORMAT_ELF + #define LIBDES "libdes.so.3" + #else #define LIBDES "libdes.so.3." + #endif /* OBJFORMAT_ELF */ #endif *************** *** 186,189 **** --- 190,196 ---- if (libpath == NULL) { + #ifdef OBJFORMAT_ELF + snprintf(dlpath, sizeof(dlpath), "%s/%s", _PATH_USRLIB, LIBDES); + #else len = strlen(LIBDES); if ((dird = opendir(_PATH_USRLIB)) == NULL) *************** *** 204,212 **** --- 211,224 ---- closedir(dird); + #endif /* OBJFORMAT_ELF */ } else snprintf(dlpath, sizeof(dlpath), "%s", libpath); if (dlpath != NULL && (dlhandle = dlopen(dlpath, 0444)) != NULL) + #ifdef OBJFORMAT_ELF + _my_crypt = (int (*)())dlsym(dlhandle, "_des_crypt"); + #else _my_crypt = (int (*)())dlsym(dlhandle, "__des_crypt"); + #endif /* OBJFORMAT_ELF */ if (_my_crypt == NULL) { >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message