This website does readability filtering of other pages. All styles, scripts, forms and ads are stripped. If you want your website excluded or have other feedback, use this form.

CVS log for src/lib/libc/crypt/bcrypt.c

CVS log for src/lib/libc/crypt/bcrypt.c


Up to [local] / src / lib / libc / crypt

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.57 / (download) - annotate - [select for diffs], Fri Aug 26 08:25:02 2016 UTC (16 months, 3 weeks ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, HEAD
Changes since 1.56: +2 -1 lines
Diff to previous 1.56 (colored)

Pull in <time.h> for clock_gettime()

ok [email protected]

Revision 1.56 / (download) - annotate - [select for diffs], Sun Jun 26 21:04:08 2016 UTC (18 months, 3 weeks ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

increase the minimum for auto rounds to 6. that was the previous low bound
for login.conf, and we don't want to go lower.

Revision 1.55 / (download) - annotate - [select for diffs], Sun Sep 13 15:33:48 2015 UTC (2 years, 4 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.54: +5 -2 lines
Diff to previous 1.54 (colored)

Wrap <pwd.h> so that calls go direct and the symbols are all weak.
Hide bcrypt_autorounds(), prefixing with an underbar for static builds.

Revision 1.54 / (download) - annotate - [select for diffs], Sun Sep 13 12:42:39 2015 UTC (2 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

The number of rounds is just two digits in the salt.  We've already
verified that they are there via isdigit() so we can convert from
ASCII to an int without using atoi().  OK [email protected] [email protected]

Revision 1.53 / (download) - annotate - [select for diffs], Sat Jul 18 00:56:37 2015 UTC (2 years, 6 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.52: +2 -5 lines
Diff to previous 1.52 (colored)

standards compliant error return (null). will make ruby happier, at least.
ok deraadt jeremy

Revision 1.52 / (download) - annotate - [select for diffs], Wed Jan 28 23:33:52 2015 UTC (2 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.51: +4 -4 lines
Diff to previous 1.51 (colored)

dial the time back to about 0.1s, closer to the original targets and
friendlier for users. requested by deraadt

Revision 1.51 / (download) - annotate - [select for diffs], Mon Jan 12 03:20:04 2015 UTC (3 years ago) by tedu
Branch: MAIN
Changes since 1.50: +9 -9 lines
Diff to previous 1.50 (colored)

rename blocks to words. bcrypt "blocks" are unrelated to blowfish blocks,
nor are they the same size.

Revision 1.50 / (download) - annotate - [select for diffs], Wed Jan 7 16:05:28 2015 UTC (3 years ago) by tedu
Branch: MAIN
Changes since 1.49: +2 -1 lines
Diff to previous 1.49 (colored)

stupid me. need errno.h

Revision 1.49 / (download) - annotate - [select for diffs], Wed Jan 7 15:46:23 2015 UTC (3 years ago) by tedu
Branch: MAIN
Changes since 1.48: +20 -12 lines
Diff to previous 1.48 (colored)

set errno = EINVAL for invalid salts and hashes in most functions.
remember to set EACCES in bcrypt_checkpass for hash differences.
the higher level crypt_checkpass function will reset errno to EACCES in
all cases, which is probably the right behavior, but this change gives code
working with the lower level functions the correct errno if they care.

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jan 5 13:10:10 2015 UTC (3 years ago) by tedu
Branch: MAIN
Changes since 1.47: +9 -7 lines
Diff to previous 1.47 (colored)

convert clock() to clock_gettime() for improved precision (and accuracy?)
guenther suggested using thread time, which actually may improve accuracy
if somebody puts this in a threaded program.

Revision 1.47 / (download) - annotate - [select for diffs], Tue Dec 30 10:27:24 2014 UTC (3 years ago) by tedu
Branch: MAIN
Changes since 1.46: +33 -1 lines
Diff to previous 1.46 (colored)

copy bcrypt autotune from encrypt(1) and expose via crypt_newhash
ok deraadt miod

Revision 1.46 / (download) - annotate - [select for diffs], Mon Nov 24 22:47:01 2014 UTC (3 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.45: +10 -15 lines
Diff to previous 1.45 (colored)

introduce a hashspace define and check that there's enough space to
write out a hash. also simplify writing out the hash.

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jul 20 04:22:34 2014 UTC (3 years, 5 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

From ISO/IEC 9899:1999 and 9899:201x,
6.11.5 - Storage-class specifiers:
    The placement of a storage-class specifier other than at the
    beginning of the declaration specifiers in a declaration is
    an obsolescent feature.

Diff from Jean-Philippe Ouellet (jean-philippe (at) ouellet.biz)

Revision 1.44 / (download) - annotate - [select for diffs], Sat May 17 15:18:06 2014 UTC (3 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.43: +5 -4 lines
Diff to previous 1.43 (colored)

Add missing header needed by isdigit().
While there, sort headers.

ok [email protected]

Revision 1.43 / (download) - annotate - [select for diffs], Tue May 6 15:59:24 2014 UTC (3 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.42: +5 -5 lines
Diff to previous 1.42 (colored)

fix stupid commit

Revision 1.42 / (download) - annotate - [select for diffs], Tue May 6 15:38:49 2014 UTC (3 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.41: +5 -5 lines
Diff to previous 1.41 (colored)

use explicit_bzero

Revision 1.41 / (download) - annotate - [select for diffs], Sat May 3 17:12:53 2014 UTC (3 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

now that 5.5 has been released with compatibility for 2b hashes,
switch to generating them by default. prodded by deraadt and sthen

Revision 1.40 / (download) - annotate - [select for diffs], Sat May 3 16:33:35 2014 UTC (3 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.39: +30 -44 lines
Diff to previous 1.39 (colored)

1. Drop support for no minor. This variant doesn't exist anymore.
2. Pull up the actual minor processing code into the switch that
parses it.
3. atoi is actually simpler than strtonum in this case, but check the
input beforehand so we don't get unexpected results.
4. Slightly more consistent style between various parse and check and
increment operations on salt.
ok deraadt

Revision 1.39 / (download) - annotate - [select for diffs], Sat Apr 19 15:19:20 2014 UTC (3 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.38: +6 -4 lines
Diff to previous 1.38 (colored)

one small tweak to avoid ever going off the end of a string.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Apr 19 15:17:59 2014 UTC (3 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.37: +10 -6 lines
Diff to previous 1.37 (colored)

improved checking for invalid hashes. from solar designer

Revision 1.37 / (download) - annotate - [select for diffs], Tue Apr 8 20:14:25 2014 UTC (3 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.36: +26 -15 lines
Diff to previous 1.36 (colored)

use char * for strings, saving casts. add return codes to base64 functions

Revision 1.36 / (download) - annotate - [select for diffs], Mon Mar 24 00:00:29 2014 UTC (3 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

oops, merge error

Revision 1.35 / (download) - annotate - [select for diffs], Sun Mar 23 23:27:52 2014 UTC (3 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.34: +4 -1 lines
Diff to previous 1.34 (colored)

clear stack variables, suggested by djm

Revision 1.34 / (download) - annotate - [select for diffs], Sun Mar 23 23:25:05 2014 UTC (3 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.33: +6 -4 lines
Diff to previous 1.33 (colored)

some improvements suggested by djm.
use better constant for salt size.
always copy ":" to gerror, in case somebody is dumb enough to overwrite it
timingsafe_bcmp before somebody whines about strcmp

Revision 1.33 / (download) - annotate - [select for diffs], Sun Mar 23 23:20:12 2014 UTC (3 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

two functions don't need to be exported

Revision 1.32 / (download) - annotate - [select for diffs], Sun Mar 23 23:19:21 2014 UTC (3 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.31: +88 -39 lines
Diff to previous 1.31 (colored)

minimal change to implementation of bcrypt to not require static globals.
add some friendlier functions.
move the classic static data api into wrapper functions.
a few more changes to come...

Revision 1.31 / (download) - annotate - [select for diffs], Sat Mar 22 23:02:03 2014 UTC (3 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.30: +12 -27 lines
Diff to previous 1.30 (colored)

switch to shorter ISC license. this was ok with Niels Provos.

Revision 1.30 / (download) - annotate - [select for diffs], Wed Mar 19 02:43:03 2014 UTC (3 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.29: +56 -86 lines
Diff to previous 1.29 (colored)

consolidate the base64 code in one place, and remove inadequate test code

Revision 1.29 / (download) - annotate - [select for diffs], Mon Feb 24 19:45:43 2014 UTC (3 years, 10 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.28: +10 -8 lines
Diff to previous 1.28 (colored)

solar's testsuite revealed insufficient validation of invalid input hashes.
add a more complete check for the rounds parameter. ok deraadt

Revision 1.28 / (download) - annotate - [select for diffs], Mon Feb 17 09:00:20 2014 UTC (3 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.27: +2 -3 lines
Diff to previous 1.27 (colored)

remove redundant test

Revision 1.27 / (download) - annotate - [select for diffs], Mon Feb 17 08:58:50 2014 UTC (3 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.26: +18 -5 lines
Diff to previous 1.26 (colored)

sticking strlen into a char leads to wraparound at 256. fix this and
introduce a new 'b' hash minor. still generate 'a' minors for now.
reported by solar designer. diff by some combination of solar and jca.
ok deraadt

Revision 1.26 / (download) - annotate - [select for diffs], Thu Dec 19 14:31:07 2013 UTC (4 years ago) by deraadt
Branch: MAIN
Changes since 1.25: +4 -4 lines
Diff to previous 1.25 (colored)

pseudo-code corrections from Solar Designer <[email protected]>

Revision 1.25 / (download) - annotate - [select for diffs], Tue Sep 4 22:16:17 2012 UTC (5 years, 4 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.24: +2 -9 lines
Diff to previous 1.24 (colored)

arc4random_buf is the easy way to fill a buffer now.  ok deraadt

Revision 1.24 / (download) - annotate - [select for diffs], Wed Apr 2 19:54:05 2008 UTC (9 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.23: +5 -1 lines
Diff to previous 1.23 (colored)

Zero state buffers on return.  OK [email protected]

Revision 1.23 / (download) - annotate - [select for diffs], Mon Mar 19 05:18:32 2007 UTC (10 years, 10 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.22: +1 -5 lines
Diff to previous 1.22 (colored)

Get rid of useless #if 0 block, especially since the code is included
immediately after.

OK [email protected]

Revision 1.22 / (download) - annotate - [select for diffs], Tue Feb 20 01:44:16 2007 UTC (10 years, 10 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

Change hard coded numbers to sizeof(buf).  Also change some
sizeof(buf) - 1 to sizeof(buf), since fgets takes the whole buffer size.

Based on diff from Charles Longeau <chl at tuxfamily dot org> long ago.

OK [email protected]

Revision 1.21 / (download) - annotate - [select for diffs], Tue Jul 4 19:06:00 2006 UTC (11 years, 6 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

allocate gsalt large enough; from Matthew R. Dempsky <mrd at alkemio
dot org>; ok [email protected] [email protected]

Revision 1.20 / (download) - annotate - [select for diffs], Mon Apr 3 19:55:49 2006 UTC (11 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.19: +5 -3 lines
Diff to previous 1.19 (colored)

be more careful with atoi() result; ok otto

Revision 1.19 / (download) - annotate - [select for diffs], Wed Dec 22 17:33:25 2004 UTC (13 years ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.18: +7 -2 lines
Diff to previous 1.18 (colored)

Test the upper limit for the max # of rounds to, to avoid wrapping and ending
up with a low number of rounds. Spotted by [email protected]; ok [email protected] [email protected]

Revision 1.18 / (download) - annotate - [select for diffs], Thu Aug 7 00:28:45 2003 UTC (14 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.17: +3 -8 lines
Diff to previous 1.17 (colored)

ansi

Revision 1.17 / (download) - annotate - [select for diffs], Wed Jun 25 21:16:47 2003 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.16: +3 -1 lines
Diff to previous 1.16 (colored)

protos

Revision 1.16 / (download) - annotate - [select for diffs], Tue Feb 19 19:39:36 2002 UTC (15 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.15: +1 -32 lines
Diff to previous 1.15 (colored)

We live in an ANSI C world.  Remove lots of gratuitous #ifdef __STDC__ cruft.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:21 2002 UTC (15 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.14: +5 -5 lines
Diff to previous 1.14 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Jan 4 21:45:30 2001 UTC (17 years ago) by todd
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

grammer/spelling

Revision 1.13 / (download) - annotate - [select for diffs], Wed Aug 2 15:09:41 2000 UTC (17 years, 5 months ago) by provos
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.12: +4 -1 lines
Diff to previous 1.12 (colored)

return error if salt is too small; pr 1336

Revision 1.12 / (download) - annotate - [select for diffs], Mon Aug 10 18:33:07 1998 UTC (19 years, 5 months ago) by provos
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.11: +6 -6 lines
Diff to previous 1.11 (colored)

fix base64 encoding, this problem was reported by
Solar Designer <[email protected]> some time ago.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Feb 18 16:10:53 1998 UTC (19 years, 11 months ago) by provos
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored)

#if __STDC__ -> #ifdef __STDC__, now all of them.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Sep 10 23:15:42 1997 UTC (20 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

indentation cleanup

Revision 1.9 / (download) - annotate - [select for diffs], Fri Jul 25 20:29:59 1997 UTC (20 years, 5 months ago) by mickey
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

#if __STDC__ --> #ifdef __STDC__

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jul 23 20:58:26 1997 UTC (20 years, 5 months ago) by kstailey
Branch: MAIN
Changes since 1.7: +7 -7 lines
Diff to previous 1.7 (colored)

tabify

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jul 9 01:08:18 1997 UTC (20 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.6: +3 -1 lines
Diff to previous 1.6 (colored)

Clean up some -Wall flowers.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jul 1 20:12:43 1997 UTC (20 years, 6 months ago) by provos
Branch: MAIN
Changes since 1.5: +32 -12 lines
Diff to previous 1.5 (colored)

fix that repeating passwords yield same hash + increment minor

Revision 1.5 / (download) - annotate - [select for diffs], Wed Apr 30 05:57:04 1997 UTC (20 years, 8 months ago) by tholo
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.4: +24 -4 lines
Diff to previous 1.4 (colored)

Be more careful about possible type promotion

Revision 1.4 / (download) - annotate - [select for diffs], Thu Mar 27 01:09:38 1997 UTC (20 years, 9 months ago) by provos
Branch: MAIN
Changes since 1.3: +3 -4 lines
Diff to previous 1.3 (colored)

yet another random() converted to arc4random()

Revision 1.3 / (download) - annotate - [select for diffs], Sun Feb 16 20:58:15 1997 UTC (20 years, 11 months ago) by provos
Branch: MAIN
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (colored)

prelim manpage, cleanup, fixed crippled plaintext: sed does a nice
job on replacing everything, just wouldnt skip it

Revision 1.2 / (download) - annotate - [select for diffs], Fri Feb 14 18:40:14 1997 UTC (20 years, 11 months ago) by provos
Branch: MAIN
Changes since 1.1: +26 -5 lines
Diff to previous 1.1 (colored)

header update

Revision 1.1 / (download) - annotate - [select for diffs], Thu Feb 13 16:31:16 1997 UTC (20 years, 11 months ago) by provos
Branch: MAIN

password hashing algorithm using blowfish

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.