summaryrefslogtreecommitdiffstats
path: root/lib/libc/crypt
AgeCommit message (Collapse)AuthorFilesLines
2020-07-06Add support for timeconting in userland.pirofti1-3/+3
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
2019-09-29zap trailing whitespace;jmc1-3/+3
2019-09-28Xr random 4 in a better wayderaadt1-3/+5
2019-07-29correct mispellings of EACCES; from Kris Katterjohnderaadt1-3/+3
2019-03-24In the incredibly unbelievable circumstance where _rs_init() fails toderaadt1-2/+2
allocate pages, don't call abort() because of corefile data leakage concerns, but simply _exit(). The reasoning is _rs_init() will only fail if someone finds a way to apply specific pressure against this failure point, for the purpose of leaking information into a core which they can read. We don't need a corefile in this instance to debug that. So take this "lever" away from whoever in the future wants to do that.
2019-01-20include stdint.h over sys/types.hbcook1-2/+2
ok deraadt@ tedu@
2017-07-22zap trailing whitespace;jmc1-2/+2
2017-07-22rework the page a bit, clarify a few things, maybe better wordingtedu1-8/+13
2016-08-26Pull in <time.h> for clock_gettime()guenther1-1/+2
ok deraadt@
2016-06-26increase the minimum for auto rounds to 6. that was the previous low boundtedu1-2/+2
for login.conf, and we don't want to go lower.
2016-03-30for some time now mandoc has not required MLINKS to functionjmc1-8/+1
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2015-11-10update NAME section to include all documented functions,jmc1-3/+3
or otherwise change Dt to reflect the name of an existing function; feedback/ok schwarze
2015-09-13Wrap <pwd.h> so that calls go direct and the symbols are all weak.guenther2-7/+8
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 alreadymillert1-2/+2
verified that they are there via isdigit() so we can convert from ASCII to an int without using atoi(). OK guenther@ deraadt@
2015-09-13Wrap <stdlib.h> so that calls go direct and the symbols not in theguenther2-2/+5
C standard are all weak. Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
2015-09-12Wrap <unistd.h> so that internal calls go direct and they're all weak symbolsguenther2-2/+6
Delete unused 'fd' argument from internal function oldttyname()
2015-09-11Wrap blowfish, sha*, md5, and rmd160 so that internal calls go directguenther1-1/+14
ok deraadt@
2015-09-10Add support for building arc4random with MSVC.bcook1-7/+8
By default, MSVC's stdlib.h defines min(), so we need to spell out something less common to avoid picking it up. ok deraadt@ beck@ miod@
2015-07-23call it bcrypt in the man page tootedu1-3/+3
2015-07-23permit "bcrypt" as an alias for "blowfish". this is, after all, whattedu1-11/+27
99% of the world calls it. allow just "bcrypt" without params to mean auto-tune ("bcrypt,a"). default remains 8 rounds (for now) ok deraadt
2015-07-18Unbreak, add errno headerjeremy1-1/+2
OK tedu@
2015-07-18set errno in null cases, just in case.tedu1-2/+3
2015-07-18standards compliant error return (null). will make ruby happier, at least.tedu1-5/+2
ok deraadt jeremy
2015-05-13If crypt(3) is called with an unknown setting, return NULL insteadbluhm1-1/+3
of some undefined value. OK tedu@
2015-04-06bludgeon DES support out of crypt. long live the bcrypt.tedu2-761/+9
2015-02-24we don't let strtonum errors bleed through now.tedu1-4/+2
2015-02-24Set errno to EINVAL, instead of letting ERANGE escape out.tedu1-2/+4
Printing strerror() in that case will say result too large, even if rounds is actually too small. invalid is less specific, but less incorrect. ok millert
2015-02-11use a width specifier for lists, and Sq rather than Dq for single lettersjmc1-3/+3
to avoid swamping it;
2015-02-11the possible algos for pref should be documented heretedu1-4/+11
2015-01-28dial the time back to about 0.1s, closer to the original targets andtedu1-4/+4
friendlier for users. requested by deraadt
2015-01-16Move to the <limits.h> universe.deraadt2-4/+2
review by millert, binary checking process with doug, concept with guenther
2015-01-15remove unused variablechl1-2/+1
ok tedu@
2015-01-15back in september I did the large abstraction refactoring to allow thesederaadt2-2/+4
other systems to fit into the same mold, so add copyright
2015-01-12rename blocks to words. bcrypt "blocks" are unrelated to blowfish blocks,tedu1-9/+9
nor are they the same size.
2015-01-07stupid me. need errno.htedu1-1/+2
2015-01-07set errno = EINVAL for invalid salts and hashes in most functions.tedu1-12/+20
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?)tedu1-7/+9
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_newhashtedu2-5/+43
ok deraadt miod
2014-12-24simplify crypt_checkpass. The API promise is that this function doesn'ttedu1-11/+5
use global data. The simplest fix is to only check blowfish passwords, and implicitly lock out DES passwords. crypt_checkpass is currently only used in one place, passwd, to verify the local user's password, so this is probably acceptable. Gives people a little more time to migrate away from DES before introduing checkpass into more places.
2014-12-08delete documentation for deleted DES interfacestedu2-87/+3
2014-12-08remove setkey and encrypt interfaces. they are useless and dangerous.tedu3-116/+9
ok deraadt naddy
2014-12-02macro cleanup; kaspars at bankovskis dot netschwarze2-49/+55
2014-11-25rand48(3) not drand48(3) to align with the actual man page and Xrmillert1-3/+3
entries.
2014-11-25no need for md5 xrtedu1-3/+2
2014-11-25revert the bludgeoning of DES. if we need a thread safe crypt, maybe it'stedu1-31/+33
better to find one instead of continuing to mangle this mess.
2014-11-25push some global data down into functions to make this threadlier.tedu1-33/+31
only doing what's needed for crypt_hashpass. sigh.
2014-11-24introduce a hashspace define and check that there's enough space totedu1-15/+10
write out a hash. also simplify writing out the hash.
2014-11-24check crypt() for null. noticed by Jonas Termansentedu1-2/+2
2014-11-21space needed between macro args and punctuation;jmc1-2/+2
2014-11-21add ERRORS, HISTORY, AUTHORS, Copyright year, and some missing macros;schwarze1-6/+39
ok tedu@ on a previous version