Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Sep 1998 00:03:57 +0200 (CEST)
From:      Stefan Esser <se@dialup124.zpr.uni-koeln.de>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/7941: FIX: keyserv with DES not ready for ELF
Message-ID:  <199809152203.AAA01952@dialup124.zpr.Uni-Koeln.DE>

next in thread | raw e-mail | index | archive | help

>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809152203.AAA01952>