summaryrefslogtreecommitdiff
path: root/lib/libc/crypt/bcrypt.c
AgeCommit message (Collapse)Author
2016-08-26Pull in <time.h> for clock_gettime()Philip Guenther
ok deraadt@
2016-06-26increase the minimum for auto rounds to 6. that was the previous low boundTed Unangst
for login.conf, and we don't want to go lower.
2015-09-13Wrap <pwd.h> so that calls go direct and the symbols are all weak.Philip Guenther
Hide bcrypt_autorounds(), prefixing with an underbar for static builds.
2015-09-13The number of rounds is just two digits in the salt. We've alreadyTodd C. Miller
verified that they are there via isdigit() so we can convert from ASCII to an int without using atoi(). OK guenther@ deraadt@
2015-07-18standards compliant error return (null). will make ruby happier, at least.Ted Unangst
ok deraadt jeremy
2015-01-28dial the time back to about 0.1s, closer to the original targets andTed Unangst
friendlier for users. requested by deraadt
2015-01-12rename blocks to words. bcrypt "blocks" are unrelated to blowfish blocks,Ted Unangst
nor are they the same size.
2015-01-07stupid me. need errno.hTed Unangst
2015-01-07set errno = EINVAL for invalid salts and hashes in most functions.Ted Unangst
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.
2015-01-05convert clock() to clock_gettime() for improved precision (and accuracy?)Ted Unangst
guenther suggested using thread time, which actually may improve accuracy if somebody puts this in a threaded program.
2014-12-30copy bcrypt autotune from encrypt(1) and expose via crypt_newhashTed Unangst
ok deraadt miod
2014-11-24introduce a hashspace define and check that there's enough space toTed Unangst
write out a hash. also simplify writing out the hash.
2014-07-20From ISO/IEC 9899:1999 and 9899:201x,Philip Guenther
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)
2014-05-17Add missing header needed by isdigit().Charles Longeau
While there, sort headers. ok tedu@
2014-05-06fix stupid commitTed Unangst
2014-05-06use explicit_bzeroTed Unangst
2014-05-03now that 5.5 has been released with compatibility for 2b hashes,Ted Unangst
switch to generating them by default. prodded by deraadt and sthen
2014-05-031. Drop support for no minor. This variant doesn't exist anymore.Ted Unangst
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
2014-04-19one small tweak to avoid ever going off the end of a string.Ted Unangst
2014-04-19improved checking for invalid hashes. from solar designerTed Unangst
2014-04-08use char * for strings, saving casts. add return codes to base64 functionsTed Unangst
2014-03-24oops, merge errorTed Unangst
2014-03-23clear stack variables, suggested by djmTed Unangst
2014-03-23some improvements suggested by djm.Ted Unangst
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
2014-03-23two functions don't need to be exportedTed Unangst
2014-03-23minimal change to implementation of bcrypt to not require static globals.Ted Unangst
add some friendlier functions. move the classic static data api into wrapper functions. a few more changes to come...
2014-03-22switch to shorter ISC license. this was ok with Niels Provos.Ted Unangst
2014-03-19consolidate the base64 code in one place, and remove inadequate test codeTed Unangst
2014-02-24solar's testsuite revealed insufficient validation of invalid input hashes.Ted Unangst
add a more complete check for the rounds parameter. ok deraadt
2014-02-17remove redundant testTed Unangst
2014-02-17sticking strlen into a char leads to wraparound at 256. fix this andTed Unangst
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
2013-12-19pseudo-code corrections from Solar Designer <solar@openwall.com>Theo de Raadt
2012-09-04arc4random_buf is the easy way to fill a buffer now. ok deraadtTed Unangst
2008-04-02Zero state buffers on return. OK deraadt@Todd C. Miller
2007-03-19Get rid of useless #if 0 block, especially since the code is includedRay Lai
immediately after. OK millert@.
2007-02-20Change hard coded numbers to sizeof(buf). Also change someRay Lai
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 millert@.
2006-07-04allocate gsalt large enough; from Matthew R. Dempsky <mrd at alkemioOtto Moerbeek
dot org>; ok djm@ deraadt@
2006-04-03be more careful with atoi() result; ok ottoTheo de Raadt
2004-12-22Test the upper limit for the max # of rounds to, to avoid wrapping and endingOtto Moerbeek
up with a low number of rounds. Spotted by mpech@; ok mpech@ millert@
2003-08-07ansiTheo de Raadt
2003-06-25protosTheo de Raadt
2002-02-19We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.Todd C. Miller
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor ↵Todd C. Miller
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2001-01-04grammer/spellingTodd T. Fries
2000-08-02return error if salt is too small; pr 1336Niels Provos
1998-08-10fix base64 encoding, this problem was reported byNiels Provos
Solar Designer <solar@false.com> some time ago.
1998-02-18#if __STDC__ -> #ifdef __STDC__, now all of them.Niels Provos
1997-09-10indentation cleanupTheo de Raadt
1997-07-25#if __STDC__ --> #ifdef __STDC__Michael Shalayeff
1997-07-23tabifykstailey