NetBSD/lib/libc/hash/Makefile.inc
sjg 3a0c68edfd Add support for SHA1 hashed passwords.
The algorithm used is essentially PBKDF1 from RFC 2898 but using
hmac_sha1 rather than SHA1 directly (suggested by smb@research.att.com).

 * The format of the encrypted password is:
 * $<tag>$<iterations>$<salt>$<digest>
 *
 * where:
 *      <tag>           is "sha1"
 *      <iterations>    is an unsigned int identifying how many rounds
 *                      have been applied to <digest>.  The number
 *                      should vary slightly for each password to make
 *                      it harder to generate a dictionary of
 *                      pre-computed hashes.  See crypt_sha1_iterations.
 *      <salt>          up to 64 bytes of random data, 8 bytes is
 *                      currently considered more than enough.
 *      <digest>        the hashed password.

hmac.c implementes HMAC as defined in RFC 2104 and includes a unit
test for both hmac_sha1 and hmac_sha1 using a selection of the Known
Answer Tests from RFC 2202.

It is worth noting that to be FIPS compliant the hmac key (password)
should be 10-20 chars.
2004-07-02 00:05:23 +00:00

21 lines
657 B
Makefile

# $NetBSD: Makefile.inc,v 1.5 2004/07/02 00:05:23 sjg Exp $
# $OpenBSD: Makefile.inc,v 1.5 1997/07/17 06:02:42 millert Exp $
# hash functions
.PATH: ${ARCHDIR}/hash ${.CURDIR}/hash
SRCS+= rmd160.c rmd160hl.c sha1.c sha1hl.c
SRCS+= hmac_sha1.c hmac_md5.c
MAN+= sha1.3 rmd160.3
MLINKS+=sha1.3 SHA1Init.3 sha1.3 SHA1Update.3
MLINKS+=sha1.3 SHA1Final.3 sha1.3 SHA1Transform.3
MLINKS+=sha1.3 SHA1End.3 sha1.3 SHA1File.3
MLINKS+=sha1.3 SHA1Data.3
MLINKS+=rmd160.3 RMD160Init.3 rmd160.3 RMD160Update.3
MLINKS+=rmd160.3 RMD160Final.3 rmd160.3 RMD160Transform.3
MLINKS+=rmd160.3 RMD160End.3 rmd160.3 RMD160File.3
MLINKS+=rmd160.3 RMD160Data.3