Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Sep 1997 12:17:08 -0600 (MDT)
From:      Brandon Gillespie <brandon@roguetrader.com>
To:        freebsd-current@freebsd.org
Subject:   where to place new crypt() files?
Message-ID:  <Pine.BSF.3.96.970925120827.11101B-100000@roguetrader.com>

next in thread | raw e-mail | index | archive | help
Currently, we maintain two seperate copies of the crypt library files,
specifically at:

  Non-DES (i.e. MD5):
     lib/libcrypt/Makefile
     lib/libcrypt/crypt.c

  With-DES:
     secure/src/lib/libcrypt/Makefile
     secure/src/lib/libcrypt/README
     secure/src/lib/libcrypt/README.FreeBSD
     secure/src/lib/libcrypt/crypt-md5.c
     secure/src/lib/libcrypt/crypt.3
     secure/src/lib/libcrypt/crypt.c
     secure/src/lib/libcrypt/test/

This is mainly because in the current code, the actual crypt() function
varies.  My new code wraps this, however, and calls sub-functions based
off which crypt modules are available (i.e. crypt_des(), crypt_md5(),
etc), so the tree is now: 

     lib/libcrypt/Makefile
     lib/libcrypt/README
     lib/libcrypt/arc4random.3
     lib/libcrypt/arc4random.c
     lib/libcrypt/blf.h
     lib/libcrypt/blowfish.3
     lib/libcrypt/blowfish.c
     lib/libcrypt/crypt-blf.c
     lib/libcrypt/crypt-md5.c
     lib/libcrypt/crypt-shs.c
     lib/libcrypt/crypt.3
     lib/libcrypt/crypt.c
     lib/libcrypt/crypt.h
     lib/libcrypt/des.3
     lib/libcrypt/shs.3
     lib/libcrypt/shs.c
     lib/libcrypt/shs.h
     lib/libcrypt/test/

And the file:

     lib/libcrypt/crypt-des.c

In addition to the -DDES_CRYPT flag to make is all that is required to
include DES crypt in the brew.  I really don't think duplicating all of
the above files in both lib/libcrypt and secure/src/lib/libcrypt is a good
idea... 

Any suggestions?  The cleanest solution (imho) would be to have
secure/src/lib/libcrypt/[Makefile|crypt-des.c], and have the Makefile
create a softlink from secure/src/lib/libcrypt/crypt-des.c to
lib/libcrypt, then move to the lib/libcrypt directory and 'make
-DDES_CRYPT'

(the makefile in lib/libcrypt includes crypt-des.c and builds libdescrypt
if the DES_CRYPT option is specified, otherwise it excludes crypt-des.c
and builds libscrypt instead).

-Brandon Gillespie

(also for note... after I wrap this up I may go back and move the
blowfish and shs code outside of the crypt library)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.970925120827.11101B-100000>