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

No functional change intended.

Prompted by tying up loose ends around PR lib/57895.
 1.15  16-Oct-2021  nia branches: 1.15.2; 1.15.4;
libcrypt: Hide more private symbols by default. Fix style.
 1.14  28-Aug-2013  riastradh 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.13  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.12  30-Aug-2012  drochner branches: 1.12.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.11  29-Nov-2011  drochner remove the option to build this against openssl - this hasn't been used
in the NetBSD build
since the libc version of MD5Final zeroes out the context, replace
the bzero introduced in the previous commit by comments telling that
 1.10  29-Nov-2011  drochner zero out hash context after use, to avoid traces in RAM
(hint from "Solar Designer")
 1.9  17-Jan-2007  hubertf branches: 1.9.34;
Remove more duplicate #includes, and a few spurious whitespaces at EOL
From Slava Semushin <slava.semushin@gmail.com>
 1.8  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.7  06-Aug-2003  jdolecek make itoa64[] const
 1.6  14-Jul-2003  itojun use strlcat
 1.5  17-Apr-2003  thorpej If libcrypto is defined, use the MD5 routines from libcrypto, rather
than from libc.
 1.4  10-Sep-2001  ad branches: 1.4.2;
Ensure that the salt is always terminated properly with '$'. Makes Cyrus'
pwcheck (which either modifies the buffer or was passing bad password
strings) happy. Noted by Cillian Sharkey <cns@redbrick.dcu.ie>.
 1.3  03-Dec-2000  ad Fix comment.
 1.2  03-Aug-2000  ad Cosmetic nits.
 1.1  06-Jul-2000  ad Add __md5crypt(), for internal use by libcrypt. This behaves for the most
part like crypt() but uses a proprietry encryption scheme that utilises MD5.
From FreeBSD via OpenBSD.
 1.4.2.2  22-Jan-2002  he Pull up revisions 1.1-1.4 (new, requested by jonathan):
Add support for MD5-hashed passwords.
 1.4.2.1  10-Sep-2001  he file md5crypt.c was added on branch netbsd-1-5 on 2002-01-22 19:31:59 +0000
 1.9.34.3  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.9.34.2  30-Oct-2012  yamt sync with head
 1.9.34.1  17-Apr-2012  yamt sync with head
 1.12.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.4.1  02-Aug-2025  perseant Sync with HEAD
 1.15.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