jmc
2ee2396122
zap trailing whitespace;
7 years ago
tedu
bce15ce0c1
rework the page a bit, clarify a few things, maybe better wording
7 years ago
guenther
d798523e75
Pull in <time.h> for clock_gettime()
ok deraadt@
8 years ago
tedu
81f4b4678c
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.
8 years ago
jmc
813a539cd3
for some time now mandoc has not required MLINKS to function
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
9 years ago
jmc
657bd2849a
update NAME section to include all documented functions,
or otherwise change Dt to reflect the name of an existing function;
feedback/ok schwarze
9 years ago
guenther
08d5782520
Wrap <pwd.h> so that calls go direct and the symbols are all weak.
Hide bcrypt_autorounds(), prefixing with an underbar for static builds.
9 years ago
millert
adeece9d95
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 guenther@ deraadt@
9 years ago
guenther
c8272cfe98
Wrap <stdlib.h> so that calls go direct and the symbols not in the
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.
9 years ago
guenther
c9c56d2879
Wrap <unistd.h> so that internal calls go direct and they're all weak symbols
Delete unused 'fd' argument from internal function oldttyname()
9 years ago
guenther
c34714da97
Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct
ok deraadt@
9 years ago
bcook
2c1adf355f
Add support for building arc4random with MSVC.
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@
9 years ago
tedu
a295a8a9de
call it bcrypt in the man page too
9 years ago
tedu
1b0313eadb
permit "bcrypt" as an alias for "blowfish". this is, after all, what
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
9 years ago
jeremy
a0ab23b345
Unbreak, add errno header
OK tedu@
9 years ago
tedu
8cf39d5a4a
set errno in null cases, just in case.
9 years ago
tedu
ece73ab6e1
standards compliant error return (null). will make ruby happier, at least.
ok deraadt jeremy
9 years ago
bluhm
4498258510
If crypt(3) is called with an unknown setting, return NULL instead
of some undefined value.
OK tedu@
10 years ago
tedu
bd36abfa7c
bludgeon DES support out of crypt. long live the bcrypt.
10 years ago
tedu
236787ace7
we don't let strtonum errors bleed through now.
10 years ago
tedu
6e172aaf1a
Set errno to EINVAL, instead of letting ERANGE escape out.
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
10 years ago
jmc
a4b14a72e4
use a width specifier for lists, and Sq rather than Dq for single letters
to avoid swamping it;
10 years ago
tedu
486708efb7
the possible algos for pref should be documented here
10 years ago
tedu
29b14402f1
dial the time back to about 0.1s, closer to the original targets and
friendlier for users. requested by deraadt
10 years ago
deraadt
75d428b273
Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther
10 years ago
chl
2c03498197
remove unused variable
ok tedu@
10 years ago
deraadt
345209bd2a
back in september I did the large abstraction refactoring to allow these
other systems to fit into the same mold, so add copyright
10 years ago
tedu
94520ae40e
rename blocks to words. bcrypt "blocks" are unrelated to blowfish blocks,
nor are they the same size.
10 years ago
tedu
3e66a761e0
stupid me. need errno.h
10 years ago
tedu
f2faceb1ea
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.
10 years ago
tedu
6758bf4952
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.
10 years ago
tedu
7387fe8b05
copy bcrypt autotune from encrypt(1) and expose via crypt_newhash
ok deraadt miod
10 years ago
tedu
6ae58cad45
simplify crypt_checkpass. The API promise is that this function doesn't
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.
10 years ago
tedu
b2b8428867
delete documentation for deleted DES interfaces
10 years ago
tedu
9898588ce8
remove setkey and encrypt interfaces. they are useless and dangerous.
ok deraadt naddy
10 years ago
schwarze
734e6f28a1
macro cleanup; kaspars at bankovskis dot net
10 years ago
millert
ecd6d9764c
rand48(3) not drand48(3) to align with the actual man page and Xr
entries.
10 years ago
tedu
db463cc6a3
no need for md5 xr
10 years ago
tedu
e536f2345b
revert the bludgeoning of DES. if we need a thread safe crypt, maybe it's
better to find one instead of continuing to mangle this mess.
10 years ago
tedu
5b2c645b15
push some global data down into functions to make this threadlier.
only doing what's needed for crypt_hashpass. sigh.
10 years ago
tedu
6c2dc6d7ef
introduce a hashspace define and check that there's enough space to
write out a hash. also simplify writing out the hash.
10 years ago
tedu
19e1186454
check crypt() for null. noticed by Jonas Termansen
10 years ago
jmc
70ce0b1d5a
space needed between macro args and punctuation;
10 years ago
schwarze
fb6bc18dba
add ERRORS, HISTORY, AUTHORS, Copyright year, and some missing macros;
ok tedu@ on a previous version
10 years ago
schwarze
bfe8beac85
Let crypt_checkpass() set EACCES after bcrypt_checkpass() failure;
ok tedu@
10 years ago
tedu
a5c612c089
change prototype for crypt_newhash. the login_cap_t is a holdover from its
pwd_gensalt origins, but a string argument works equally work and is more
friendly to consumers beyond local user accounts.
ok deraadt
10 years ago
tedu
85c5ea456a
split crypt_checkpass off into a new file
10 years ago
jmc
0b7e87f042
add crypt_newhash to NAME and add an MLINK;
10 years ago
tedu
572a59f1f0
add new function crypt_newhash to simplify creating new hashes.
does most of the work pwd_gensalt did, but also creates the hash.
(unused yet)
10 years ago
deraadt
0e76256cce
missing newline
10 years ago