History log of /freebsd-current/lib/libcrypt/Makefile
Revision Date Author Comments
# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 7d232d64 06-Dec-2021 Jessica Clarke <jrtc27@FreeBSD.org>

libcrypt: Drop inclusion of libutil.h

This was rendered obsolete in 2012 by a0ee974f0bad, since auth_getval
was the only reason the header was included.

MFC after: 1 week


# a7b5a3d48 05-Sep-2019 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Put a lot of binaries and lib in FreeBSD-runtime

All of them are needed to be able to boot to single user and be able
to repair a existing FreeBSD installation so put them directly into
FreeBSD-runtime.

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21503


# 8ff3cdd1 09-Jul-2018 Conrad Meyer <cem@FreeBSD.org>

Integrate SHA2-224 with userspace components

The double compilation of the kernel sources in libmd and libcrypt is
baffling, but add yet another define hack to prevent duplicate symbols.

Add documentation and SHA2-224 test cases to libmd.

Integrate with the md5(1) command, document, and add more test cases;
self-tests pass.


# c119e4a4 02-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Remove bogus bsd.subdir.mk .include

bsd.subdir.mk is included from bsd.obj.mk, which is included via bsd.lib.mk.

MFC after: 3 days


# d511b20a 02-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Add HAS_TESTS to all Makefiles that are currently using the
`SUBDIR.${MK_TESTS}+= tests` idiom.

This is a follow up to r321912.


# 4b330699 02-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after: 1 weeks


# 562cbd7bc 19-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon


# 5f521d7b 10-Aug-2016 Ed Schouten <ed@FreeBSD.org>

Make libcrypt thread-safe. Add crypt_r(3).

glibc has a pretty nice function called crypt_r(3), which is nothing
more than crypt(3), but thread-safe. It accomplishes this by introducing
a 'struct crypt_data' structure that contains a buffer that is large
enough to hold the resulting string.

Let's go ahead and also add this function. It would be a shame if a
useful function like this wouldn't be usable in multithreaded apps.
Refactor crypt.c and all of the backends to no longer declare static
arrays, but write their output in a provided buffer.

There is no need to do any buffer length computation here, as we'll just
need to ensure that 'struct crypt_data' is large enough, which it is.
_PASSWORD_LEN is defined to 128 bytes, but in this case I'm picking 256,
as this is going to be part of the actual ABI.

Differential Revision: https://reviews.freebsd.org/D7306


# cd9f4c59 01-Jun-2016 Allan Jude <allanjude@FreeBSD.org>

Skein was not meant to be connected to libcrypto

It is not a password hashing algorithm

Reported by: cem


# 1780e407 28-May-2016 Allan Jude <allanjude@FreeBSD.org>

Implement SHA-512 truncated (224 and 256 bits)

This implements SHA-512/256, which generates a 256 bit hash by
calculating the SHA-512 then truncating the result. A different initial
value is used, making the result different from the first 256 bits of
the SHA-512 of the same input. SHA-512 is ~50% faster than SHA-256 on
64bit platforms, so the result is a faster 256 bit hash.

The main goal of this implementation is to enable support for this
faster hashing algorithm in ZFS. The feature was introduced into ZFS
in r289422, but is disconnected because SHA-512/256 support was missing.
A further commit will enable it in ZFS.

This is the follow on to r292782

Reviewed by: cem
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D6061


# a70cba95 04-Feb-2016 Glen Barber <gjb@FreeBSD.org>

First pass through library packaging.

Sponsored by: The FreeBSD Foundation


# 7a3f5d11 27-Dec-2015 Allan Jude <allanjude@FreeBSD.org>

Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c

cperciva's libmd implementation is 5-30% faster

The same was done for SHA256 previously in r263218

cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation

Extend sbin/md5 to create sha384(1)

Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h}

Reviewed by: cperciva, des, delphij
Approved by: secteam, bapt (mentor)
MFC after: 2 weeks
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3929


# c2a55def 25-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

META MODE: Avoid dirdep dependency on lib/libmd.

This avoids using the staged headers for sys/crypto/sha2/*.h, such as sha256.h,
which added an unneeded pre-build dependency on libmd to libcrypt. This
header is an INCS in lib/libmd, but found via .PATH in sys/crypto/sha2.
Since the libcrypt build was already using the in-src libmd headers
directly, just teach it how to find the sha256.h header as well.

Sponsored by: EMC / Isilon Storage Division


# 18b2ee82 15-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Revert r284417 it is not necessary anymore


# 4232f826 15-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Enforce overwritting SHLIBDIR

Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading
bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere.

This makes /lib being populated again.

Reported by: many


# 478290db 30-Sep-2014 Enji Cooper <ngie@FreeBSD.org>

Check in first src/tests snapshot from NetBSD anoncvs

Sources were obtained like so:

% export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot"
% cvs -z9 co -D "09/30/2014 20:45" -P src/tests
% mv src/tests/* tests/dist/.

'*CVS*' has been added to svn:ignore to ease updating periodically from
upstream

Some line ending issues had to be resolved with test outputs and scripts
via dos2unix and by deleting the eol-style property set in usr.bin/sort

Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division


# c6063d0d 05-May-2014 Warner Losh <imp@FreeBSD.org>

Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.


# 8083f14f 15-Mar-2014 John-Mark Gurney <jmg@FreeBSD.org>

replace the kernel's version w/ cperciva's implementation... In all
my tests, it is faster ~20%, even on an old IXP425 533MHz it is ~45%
faster... This is partly due to loop unrolling, so the code size does
significantly increase... I do plan on committing a version that
rolls up the loops again for smaller code size for embedded systems
where size is more important than absolute performance (it'll save ~6k
code)...

The kernel implementation is now shared w/ userland's libcrypt and
libmd...

We drop support for sha256 from sha2.c, so now sha2.c only contains
sha384 and sha512...

Reviewed by: secteam@


# e2197f80 24-Oct-2013 Rui Paulo <rpaulo@FreeBSD.org>

Set up the /usr/tests hierarchy.

Populate /usr/tests with the only test programs that currently live
in the tree (those in lib/libcrypt/tests/) and add all the build
machinery to accompany this change.

In particular:

- Add a WITHOUT_TESTS variable that users can define to request that
no tests be put in /usr/tests.
- Add a top-level Kyuafile for /usr/tests and a way to create similar
Kyuafiles in top-level subdirectories.
- Add a BSD.tests.dist file to define the directory layout of
/usr/tests.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks


# a0ee974f 12-Jun-2012 Dag-Erling Smørgrav <des@FreeBSD.org>

Stop using auth_getval() now that it always returns NULL. Instead,
hardcode the default to what it would be if we didn't hardcode it,
i.e. DES if supported and MD5 otherwise.

MFC after: 3 weeks


# ce8679e4 27-Apr-2011 David E. O'Brien <obrien@FreeBSD.org>

Protect the reachover built symbols after the SHA256/512 crypt(3) addition.


# 3d6f63c0 09-Apr-2011 Mark Murray <markm@FreeBSD.org>

Add SHA256/512 ($5$ and $6$) to crypt(3). Used in linux-world, doesn't
hurt us.

PR: misc/124164
Submitted by: KIMURA Yasuhiro < yasu utahime org >
MFC after: 1 month


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# daaf5759 02-Jan-2010 Ed Schouten <ed@FreeBSD.org>

Build lib/ with WARNS=6 by default.

Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and
lower it when needed.

I'm setting WARNS?=0 for secure/. It seems secure/ includes the
Makefile.inc provided by lib/. I'm not going to touch that directory.
Most of the code there is contributed anyway.


# 3ca3047a 19-Jul-2009 Ken Smith <kensmith@FreeBSD.org>

Bump the version of all non-symbol-versioned shared libraries in
preparation for 8.0-RELEASE. Add the previous version of those
libraries to ObsoleteFiles.inc and bump __FreeBSD_Version.

Reviewed by: kib
Approved by: re (rwatson)


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 419ecd5d 20-May-2007 Daniel Eischen <deischen@FreeBSD.org>

Bump library versions in preparation for 7.0.

Ok'd by: kan


# fcaa4668 18-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Provide alternate default for SHLIBDIR before bsd.own.mk does this.

Reported by: phk


# e1fe3dba 17-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Reimplementation of world/kernel build options. For details, see:

http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by: imp, jhb, kris, phk, ru (all bugs are mine)


# a84020c2 22-Jul-2005 Ken Smith <kensmith@FreeBSD.org>

Bump the shared library version number of all libraries that have not
been bumped since RELENG_5.

Reviewed by: ru
Approved by: re (not needed for commit check but in principle...)


# a2161735 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOCRYPT -> NO_CRYPT


# a35d8893 24-Oct-2004 Ruslan Ermilov <ru@FreeBSD.org>

For variables that are only checked with defined(), don't provide
any fake value.


# 41d8423f 17-Aug-2003 Gordon Tetlow <gordon@FreeBSD.org>

Stage 3 of dynamic root support. Make all the libraries needed to run
binaries in /bin and /sbin installed in /lib. Only the versioned files
reside in /lib, the .so symlink continues to live /usr/lib so the
toolchain doesn't need to be modified.


# bf513f69 02-Jun-2003 Mark Murray <markm@FreeBSD.org>

Add a new hash type. This "NT-hash" is compatible with the password
hashing scheme used in Microsoft's NT machines. IT IS NOT SECURE!
DON'T USE IT! This is for the use of competent sysadmins only!

Submitted by: Michael Bretterklieber


# 7691f66a 19-May-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Retire the useless NOSECURE knob.

Approved by: re (scottl)


# 4a558355 27-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

MAN[1-9] -> MAN.


# db5882e7 21-Mar-2001 Peter Wemm <peter@FreeBSD.org>

Help standalone builds by getting libutil.h from src/lib/libutil


# 5c129616 11-Mar-2001 Mark Murray <markm@FreeBSD.org>

Add OpenBSD-style blowfish password hashing. This makes one less
gratuitous difference between us and our sister project.

This was given to me _ages_ ago. May apologies to Paul for the length
of time its taken me to commit.

Obtained from: Niels Provos <provos@physnet.uni-hamburg.de>/OpenBSD
Submitted by: Paul Herman <pherman@frenchfries.net>


# 9886bcdf 28-Dec-2000 Peter Wemm <peter@FreeBSD.org>

Merge into a single US-exportable libcrypt, which only provides
one-way hash functions for authentication purposes. There is no more
"set the libcrypt->libXXXcrypt" nightmare.
- Undo the libmd.so hack, use -D to hide the md5c.c internals.
- Remove the symlink hacks in release/Makefile
- the algorthm is set by set_crypt_format() as before. If this is
not called, it tries to heuristically figure out the hash format, and
if all else fails, it uses the optional auth.conf entry to chose the
overall default hash.
- Since source has non-hidden crypto in it there may be some issues with
having the source it in some countries, so preserve the "secure/*"
division. You can still build a des-free libcrypt library if you want
to badly enough. This should not be a problem in the US or exporting
from the US as freebsd.org had notified BXA some time ago. That makes
this stuff re-exportable by anyone.
- For consistancy, the default in absence of any other clues is md5. This
is to try and minimize POLA across buildworld where folk may suddenly
be activating des-crypt()-hash support. Since the des hash may not
always be present, it seemed sensible to make the stronger md5 algorithm
the default.
All things being equal, no functionality is lost.

Reviewed-by: jkh

(flame-proof suit on)


# 3a1030f4 21-Aug-2000 Brian Feldman <green@FreeBSD.org>

How did you sneak in...


# 04c9749f 21-Aug-2000 Brian Feldman <green@FreeBSD.org>

Add working and easy crypt(3)-switching. Yes, we need a whole new API
for crypt(3) by now. In any case:

Add crypt_set_format(3) + documentation to -lcrypt.
Add login_setcryptfmt(3) + documentation to -lutil.
Support for switching crypt formats in passwd(8).
Support for switching crypt formats in pw(8).

The simple synopsis is:
edit login.conf; add a passwd_format field set to "des" or "md5"; go nuts :)

Reviewed by: peter


# 0ade301d 06-Jan-2000 Kris Kennaway <kris@FreeBSD.org>

Zap SHA1 password support. This will be re-implemented at a later date.


# 1f4aad4d 17-Dec-1999 Peter Wemm <peter@FreeBSD.org>

Remove -lmd. Use dlopen() and dlsym() instead for calls to the MD5* and
SHA* routines so that callers of libcrypt are not exposed to the internal
implementation.


# 462da152 21-Sep-1999 Dmitrij Tejblum <dt@FreeBSD.org>

Someone changed major numbers of the libraries from 2 to 3 for 0 (zero) reasons.
Revert the major number back to 2.

libcrypt only export one function, before the recent changes and now:
char *crypt(const char *key, const char *salt);
The prototype didn't changed. Internal representation of `char' and `char *'
didn't changed. Therefore, there is no reason to change the version number.


# 6b0e02e5 21-Sep-1999 Peter Wemm <peter@FreeBSD.org>

Somebody deleted the SONAME override causing the symlink to be expanded
at link time and the target name compiled into the binaries. ie:
everything used libscrypt or libdescrypt explicitly.


# e9a56ad5 19-Sep-1999 Mark Murray <markm@FreeBSD.org>

Big code cleanup. (Inspired by Brandon Gillespie). Also move as
much as possible away from secure/ to make extending easier.


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 3c697e0a 22-Mar-1999 Bruce Evans <bde@FreeBSD.org>

Simplified using new SYMLINKS macro, mainly to test this macro. The
ifdefs are too ugly for this to be much of a simplification. The
existence tests are even uglier now. Note that the previous commit
was not submitted by me. It missed the point and just added a second
layer of unused removals.

Fixed hard-coded "libcrypt"s. The LCRYPTBASE macro mainly makes
things hard to read, but use it while we have it.


# 1b340441 24-Jan-1999 Mark Murray <markm@FreeBSD.org>

Fix symlinking. Without the -f "force" option, the wrong version
can be found.
Submitted by: Bruce


# 4fdd3d54 23-Jan-1999 Mark Murray <markm@FreeBSD.org>

The new crypt code broke "make world". Back it out.


# da5c7089 21-Jan-1999 Brandon Gillespie <brandon@FreeBSD.org>

Rewrite of crypt library to be more modular, and addition of the
Secure Hashing Algorithm - 1 (SHA-1), along with the further
refinement of what $x$salt$hash means. With this new crypt the
following are all acceptable:

$1$
$MD5$
$SHA1$

Note: $2$ is used by OpenBSD's Blowfish, which I considered adding
as $BF$, but there is no actual need for it with SHA-1. However,
somebody wishing to add OpenBSD password support could easilly add
it in now.

There is also a malloc_crypt() available in the library now, which
behaves exactly the same as crypt(), but it uses a malloced buffer
instead of a static buffer. However, this is not standard so will
likely not be used much (at all).

Also, for those interested I did a brief speed test Pentium 166/MMX,
which shows the DES crypt to do approximately 2640 crypts a CPU second,
MD5 to do about 62 crypts a CPU second and SHA1 to do about 18 crypts
a CPU second.

Reviewed by: Mark Murray


# cb997c92 02-Sep-1998 Bruce Evans <bde@FreeBSD.org>

Fixed the elf case of the creation of the libcrypt.so -> libscrypt->so
link. Shared libraries are in ${SHLIBDIR}, not necessarily in ${LIBDIR}.


# 839de40e 29-Aug-1998 John Birrell <jb@FreeBSD.org>

BINFORMAT -> OBJFORMAT ready for E-day.


# 8deb7ff0 29-Aug-1998 John Birrell <jb@FreeBSD.org>

BINFORMAT -> OBJFORMAT ready for E-day.


# c4a04f55 27-May-1998 Peter Wemm <peter@FreeBSD.org>

Turn on the rcsid storage so that it's easier to tell the difference
between libscrypt.a and libdescrypt.a


# a9c87f32 04-Sep-1997 Peter Wemm <peter@FreeBSD.org>

When compiling under elf, use correct library naming conventions. Also
add the required extra symlink. Set the -soname to libcrypt.so so that
the symlink is used at runtime rather than resolved at compile time.


# 7e546392 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 6c06b4e2 29-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# 643c0031 13-Nov-1994 Bruce Evans <bde@FreeBSD.org>

Install shared libraries in ${DESTDIR}${SHLIBDIR} instead of in
$(DESTDIR)/$(LIBDIR) (I need SHLIBDIR. The / was a bug and the
$(...) style was inconsistent.)

Install ordinary libraries in ${DESTDIR}${LIBDIR} instead of in
$(DESTDIR)/$(LIBDIR).

Change remaining $(...) to ${...}.


# 3b2b7f71 07-Nov-1994 Poul-Henning Kamp <phk@FreeBSD.org>

*** ATTENTION *** YOU MIGHT BE ABOUT TO BE HOSED *** ATTENTION ***

This effectively changes the non-DES password algoritm.

If you have the "securedist" installed you will have no problems with this.
(Though you might want to consider using this password-encryption instead
of the DES-based if your system is likely to be hacked)

If you are running a -current system without the "securedist" installed:
YOU WILL NEED TO CHANGE ALL PASSWORDS !! There is no backwards mode.

Suggested procedure is:
Update your sources
cd /usr/src/lib/libcrypt
make clean
make all
make install
passwd root
<set roots new password>
change password for any other users on the system.

This algorithm is expected to be much better than the traditional DES-
based algorithm. It uses the MD5 algorithm at what it is best at, as
opposed to the DES algorithm at something it isn't good at at all. The
algorithm is designed such that it should very hard to shortcut the
calculations needed to build a dictionary, and to make partial knowledge
(Hmm, his password starts with a 'P'...) useless. Of course if somebody
breaks the MD5 algorithm this looses too.

The salt is 48 bits (8 char @ base64).
The encrypted password is 128 bits.

And I am positively delighted to say that it takes 34 msec to crypt() a
password on a Pentium/60Mhz, so building a dictionary is not really an
option for hackers at the moment.


# c8023944 20-Aug-1994 Geoff Rehmet <csgr@FreeBSD.org>

Fix afterinstall rule for generating links to the real libcrypt
Submitted by: geoff


# a54d9395 12-Aug-1994 Geoff Rehmet <csgr@FreeBSD.org>

Fix afterinstall rule for NOSHARED case
Submitted by: Geoff Rehmet


# f5db7b1c 09-Aug-1994 Geoff Rehmet <csgr@FreeBSD.org>

The password scrambler now becomes libscrypt, and libcrypt is
a symlink to it. (The real libcrypt will be installed as libdescrypt.)
Submitted by: Geoff.


# 0e27b8d5 09-Aug-1994 Geoff Rehmet <csgr@FreeBSD.org>

Nates password scrambler, from FreebSD 1.1.5, but with everything except
crypt() ripped out
Reviewed by: Geoff Rehmet
Submitted by: Nate Williams