The NetBSD Project

CVS log for src/lib/libcrypt/crypt.c

[BACK] Up to [cvs.NetBSD.org] / src / lib / libcrypt

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.38 / (download) - annotate - [select for diffs], Sat Feb 22 10:29:17 2020 UTC (5 months, 2 weeks ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, HEAD
Changes since 1.37: +4 -4 lines
Diff to previous 1.37 (colored)

Avoid undefined behavior in left shift

crypt.c:772:11, left shift of 1363235140 by 1 places cannot be represented
in type 'int32_t' (aka 'int')

Revision 1.37 / (download) - annotate - [select for diffs], Sat Feb 22 10:22:32 2020 UTC (5 months, 2 weeks ago) by kamil
Branch: MAIN
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored)

Avoid undefined behavior in bit shift operations

crypt.c:839:40, left shift of negative value -1197182952
crypt.c:840:40, left shift of negative value -264997776

Revision 1.36 / (download) - annotate - [select for diffs], Mon Oct 21 02:36:48 2019 UTC (9 months, 3 weeks ago) by jhigh
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.35: +15 -2 lines
Diff to previous 1.35 (colored)

adding argon2 support to libcrypt. argon2 user authentication now
available via MKARGON2=yes (3 variants supported; argon2id recommended)
before using, please read argon2 paper at
https://github.com/P-H-C/phc-winner-argon2

Revision 1.35 / (download) - annotate - [select for diffs], Sat Oct 5 18:06:16 2019 UTC (10 months ago) by jhigh
Branch: MAIN
Changes since 1.34: +65 -7 lines
Diff to previous 1.34 (colored)

adding full scheme comparison to libcrypt:crypt and pwhash tests

Revision 1.34 / (download) - annotate - [select for diffs], Wed Jun 17 00:15:26 2015 UTC (5 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20190609, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi
Changes since 1.33: +8 -6 lines
Diff to previous 1.33 (colored)

fix error messages

Revision 1.33 / (download) - annotate - [select for diffs], Wed Dec 28 03:13:09 2011 UTC (8 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, agc-symver-base, agc-symver
Changes since 1.32: +3 -4 lines
Diff to previous 1.32 (colored)

make __crypt static

Revision 1.32 / (download) - annotate - [select for diffs], Tue Dec 27 23:34:13 2011 UTC (8 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.31: +14 -4 lines
Diff to previous 1.31 (colored)

wrap crypt() to a function that returns *0 and *1 on error.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Dec 27 01:20:45 2011 UTC (8 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

perform the check for all salts > 2.

Revision 1.30 / (download) - annotate - [select for diffs], Mon Dec 26 22:58:45 2011 UTC (8 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.29: +46 -20 lines
Diff to previous 1.29 (colored)

Provide a safer salting method that does not turn invalid salts to '.'.
Be more sensitive to bad salts and counts. From:
http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/glibc/crypt_freesec.c
From Solar Designer

Revision 1.29 / (download) - annotate - [select for diffs], Mon Dec 26 16:03:42 2011 UTC (8 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.28: +5 -4 lines
Diff to previous 1.28 (colored)

avoid accessing array over its bound, from Solar Designer

Revision 1.28 / (download) - annotate - [select for diffs], Fri May 1 00:28:17 2009 UTC (11 years, 3 months ago) by perry
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, matt-premerge-20091211, matt-mips64-premerge-20101231, jym-xensuspend-nbase, jym-xensuspend-base, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache
Changes since 1.27: +13 -32 lines
Diff to previous 1.27 (colored)

ANSI function prototypes

Revision 1.27 / (download) - annotate - [select for diffs], Fri May 1 00:20:08 2009 UTC (11 years, 3 months ago) by perry
Branch: MAIN
Changes since 1.26: +7 -7 lines
Diff to previous 1.26 (colored)

de-__P

Revision 1.26 / (download) - annotate - [select for diffs], Wed Jan 17 23:24:22 2007 UTC (13 years, 6 months ago) by hubertf
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, mjf-devfs2, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Branch point for: jym-xensuspend
Changes since 1.25: +3 -4 lines
Diff to previous 1.25 (colored)

Remove more duplicate #includes, and a few spurious whitespaces at EOL
From Slava Semushin <slava.semushin@gmail.com>

Revision 1.25 / (download) - annotate - [select for diffs], Sat Nov 25 17:55:48 2006 UTC (13 years, 8 months ago) by freza
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4
Changes since 1.24: +4 -4 lines
Diff to previous 1.24 (colored)

Constify prtab() argument, fixes MKDEBUGLIB build.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Oct 27 19:39:11 2006 UTC (13 years, 9 months ago) by drochner
Branch: MAIN
Changes since 1.23: +16 -15 lines
Diff to previous 1.23 (colored)

gently add some "const", and avoid some casts
compiles with WARNS=4 now (on i386 and alpha)

Revision 1.23 / (download) - annotate - [select for diffs], Sat Apr 8 23:24:44 2006 UTC (14 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.22: +5 -2 lines
Diff to previous 1.22 (colored)

Need stdio.h if debug.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Jul 2 00:05:23 2004 UTC (16 years, 1 month ago) by sjg
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.21: +21 -5 lines
Diff to previous 1.21 (colored)

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.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Aug 7 16:44:17 2003 UTC (17 years ago) by agc
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.20: +3 -7 lines
Diff to previous 1.20 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Aug 6 08:44:22 2003 UTC (17 years ago) by jdolecek
Branch: MAIN
Changes since 1.19: +11 -11 lines
Diff to previous 1.19 (colored)

make the read-only arrays const

Revision 1.19 / (download) - annotate - [select for diffs], Fri May 24 04:02:49 2002 UTC (18 years, 2 months ago) by itojun
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

support bcrypt password.  can be chosen by "blowfish" keyword in passwd.conf.
from openbsd

Revision 1.18 / (download) - annotate - [select for diffs], Thu Mar 1 14:37:35 2001 UTC (19 years, 5 months ago) by wiz
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Branch point for: netbsd-1-6
Changes since 1.17: +6 -6 lines
Diff to previous 1.17 (colored)

Four casts for lint.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jan 5 23:11:13 2001 UTC (19 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.16: +4 -3 lines
Diff to previous 1.16 (colored)

fix nested extern declaration.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jul 6 11:13:49 2000 UTC (20 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.15: +16 -2 lines
Diff to previous 1.15 (colored)

Handle non-DES encrypted passwords; currently only MD5.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jun 16 16:27:32 2000 UTC (20 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2
Branch point for: netbsd-1-5
Changes since 1.14: +5 -3 lines
Diff to previous 1.14 (colored)

Enable decryption in crypt(), from cryptosrc-intl, and lift the updated
manual page (which describes decryption) from cryptosrc-us.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Mar 13 22:59:22 2000 UTC (20 years, 5 months ago) by soren
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

Fix doubled 'the's.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Oct 20 02:02:30 1998 UTC (21 years, 9 months ago) by matt
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.12: +4 -4 lines
Diff to previous 1.12 (colored)

vax -> __vax__

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jun 1 20:25:24 1998 UTC (22 years, 2 months ago) by kleink
Branch: MAIN
Changes since 1.11: +3 -2 lines
Diff to previous 1.11 (colored)

Need <stdlib.h> for setkey() prototype.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Feb 4 06:39:33 1998 UTC (22 years, 6 months ago) by mikel
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

don't kill 'register' in comments!

Revision 1.10 / (download) - annotate - [select for diffs], Tue Feb 3 19:12:14 1998 UTC (22 years, 6 months ago) by perry
Branch: MAIN
Changes since 1.9: +7 -7 lines
Diff to previous 1.9 (colored)

remove obsolete register declarations

Revision 1.9 / (download) - annotate - [select for diffs], Tue Nov 4 03:31:45 1997 UTC (22 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

specify array sizes in init_perm prototype.  One of the array specifications
was "C_block [][]", which isn't valid (or sensible!) C (only the last
dimension may be omitted).  However, all of the dimensions are known
so they might as well be specified.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Oct 10 08:22:30 1997 UTC (22 years, 10 months ago) by mikel
Branch: MAIN
CVS Tags: netbsd-1-3-base
Branch point for: netbsd-1-3
Changes since 1.7: +6 -3 lines
Diff to previous 1.7 (colored)

don't let prototypes disappear if LARGEDATA is defined

Revision 1.7 / (download) - annotate - [select for diffs], Thu Oct 9 10:28:43 1997 UTC (22 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.6: +37 -30 lines
Diff to previous 1.6 (colored)

rcsid police, deprecate some use of register

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jul 2 04:55:41 1997 UTC (23 years, 1 month ago) by mikel
Branch: MAIN
Changes since 1.5: +41 -37 lines
Diff to previous 1.5 (colored)

add explicit return types and braces for gcc -Wall, some minor KNF
existing differences between exportable and domestic versions were
  preserved.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Feb 19 12:19:03 1995 UTC (25 years, 5 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.4: +10 -8 lines
Diff to previous 1.4 (colored)

use the (broken) crypt.c from the 4.4BSD-Lite Foreign distribution, that
can encrypt passwords but _cannot_ decrypt anything.  "real" (i.e. two-way,
unbroken) crypt() now lives in /usr/src/domestic.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Dec 20 16:00:32 1994 UTC (25 years, 7 months ago) by cgd
Branch: MAIN
Changes since 1.3: +16 -27 lines
Diff to previous 1.3 (colored)

type sanity

Revision 1.3 / (download) - annotate - [select for diffs], Wed Oct 19 03:01:18 1994 UTC (25 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

cast for quiet.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 18:36:03 1993 UTC (27 years ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

Add RCS identifiers.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Apr 26 12:45:01 1993 UTC (27 years, 3 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9

made libcrypt, so exportable vs. non-exportable packages can be
handled easliy.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>