Home | History | Annotate | Download | only in libcrypt
History log of /src/lib/libcrypt/crypt-sha1.c
RevisionDateAuthorComments
 1.11  23-Jul-2024  riastradh libcrypt: Nix trailing whitespace.

No functional change intended.

Prompted by tying up loose ends around PR lib/57895.
 1.10  29-Oct-2021  nia branches: 1.10.2; 1.10.4;
libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
iterations are specified.
 1.9  16-Oct-2021  nia libcrypt: Hide more private symbols by default. Fix style.
 1.8  28-Aug-2013  riastradh branches: 1.8.18; 1.8.28;
Publish explicit_memset and consttime_memequal in userland libc.

Remove the double-underscore from the userland versions, and do the
weak alias dance instead, now that these are public parts of libc.

As discussed on tech-userlevel:

https://mail-index.netbsd.org/tech-userlevel/2013/06/24/msg007843.html
(option 3)
 1.7  10-Aug-2013  dholland Silence -Wpointer-sign on crypt-sha1.c.
This requires casts, which is not entirely desirable; however, this way
at least no *more* pointer sign issues can creep in.

Output object files are unchanged on amd64.
 1.6  24-Jun-2013  riastradh Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.5  30-Aug-2012  drochner branches: 1.5.2;
Add "consttime_bcmp" and "explicit_bzero" functions for both kernel
abd userland, as proposed on tech-security, with explicit_bzero using
a volatile function pointer as suggested by Alan Barrett.
Both do what the name says. For userland, both are prefixed by "__"
to keep them out of the user namespace.
Change some memset/memcmp uses to the new functions where it makes
sense -- these are just some examples, more to come.
 1.4  09-May-2011  drochner branches: 1.4.4;
rearrange variable usage to kill __UNCONST
reviewed by sjg
 1.3  27-Oct-2006  drochner As discussed back in June, move the implementation of hmac_sha1 here
because this is not a public function and crypt-sha1.c is the only
place where it is used (It must have been that way formerly, because
there was a stale prototype in crypt.h all the time.)
Being here, do some RCSID and prototype cleanup, and add as much "const"
as needed to compile these files with WARNS=3.
 1.2  11-Jan-2005  christos use the standard __UNCONST
 1.1  02-Jul-2004  sjg 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.
 1.4.4.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.4.1  30-Oct-2012  yamt sync with head
 1.5.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.28.1  31-Oct-2021  martin Pull up following revision(s) (requested by nia in ticket #1370):

lib/libcrypt/crypt-sha1.c: revision 1.10

libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
iterations are specified.
 1.8.18.1  31-Oct-2021  martin Pull up following revision(s) (requested by nia in ticket #1705):

lib/libcrypt/crypt-sha1.c: revision 1.10

libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
iterations are specified.
 1.10.4.1  02-Aug-2025  perseant Sync with HEAD
 1.10.2.1  23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #794):

lib/libcrypt/crypt-argon2.c: revision 1.20
lib/libcrypt/crypt-argon2.c: revision 1.21
lib/libcrypt/crypt-argon2.c: revision 1.22
lib/libcrypt/md5crypt.c: revision 1.16
lib/libcrypt/hmac.c: revision 1.5
lib/libcrypt/crypt-sha1.c: revision 1.11
lib/libcrypt/pw_gensalt.c: revision 1.14
lib/libcrypt/crypt.c: revision 1.41

Don't use uninitialized variable.
Fixes PR 57895.

libcrypt/crypt-argon2.c: Add RCS id.
Noted in PR lib/57895.

libcrypt: Nix trailing whitespace.
No functional change intended.
Prompted by tying up loose ends around PR lib/57895.

RSS XML Feed