millert
9b1817bc73
Update comment to match code; Caspar Schutijser
9 years ago
tedu
236787ace7
we don't let strtonum errors bleed through now.
9 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
9 years ago
tedu
ade522ddbc
update siphash manpages to reflect change in return type spelling.
ok dlg
9 years ago
tedu
6b550eb5a9
Use standard spelling for types, and rename local variable from "free".
No actual change, but makes it easier to reuse the code elsewhere.
Suggested by Andre Smagin
9 years ago
tedu
f560a5c78d
lsearch and lfind return void *
9 years ago
jmc
a4b14a72e4
use a width specifier for lists, and Sq rather than Dq for single letters
to avoid swamping it;
9 years ago
tedu
486708efb7
the possible algos for pref should be documented here
9 years ago
dlg
eed98717a6
userland gets static on functions only used within a file.
ok tedu@
9 years ago
schwarze
cdb05c968a
macro fixes from Kaspars at Bankovskis dot net;
also fixing one typo in fts(3) while here
9 years ago
schwarze
72a38c830c
Use .Rv where appropriate, and move it to RETURN VALUES;
remove .Tn, and a few minor macro adjustments.
Patch from Kaspars at Bankovskis dot net.
9 years ago
tedu
29b14402f1
dial the time back to about 0.1s, closer to the original targets and
friendlier for users. requested by deraadt
9 years ago
tedu
dcb96ce7a3
Improve wording in alloca.
1. it's not a bug; it's a caveat.
2. "slightly unsafe" gives me the willies.
3. one .Xr to malloc should suffice
ok deraadt jmc
9 years ago
deraadt
75d428b273
Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther
9 years ago
chl
2c03498197
remove unused variable
ok tedu@
9 years ago
millert
1a5ffaf941
Use explicit_bzero instead of memset in hash Final and End functions.
OK deraadt@ djm@
9 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
9 years ago
millert
70272b819c
Make strlcpy/strlcat slightly easier to read.
9 years ago
tedu
94520ae40e
rename blocks to words. bcrypt "blocks" are unrelated to blowfish blocks,
nor are they the same size.
9 years ago
deraadt
8ab45b8557
missing , found by Dongsheng Song
9 years ago
tedu
3e66a761e0
stupid me. need errno.h
9 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.
9 years ago
tedu
06084f37f2
rename kern enter/exit macros to malloc enter/leave to better reflect
what's going on.
9 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.
9 years ago
tedu
7387fe8b05
copy bcrypt autotune from encrypt(1) and expose via crypt_newhash
ok deraadt miod
9 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
1b9ff6ebe7
be like the kernel and only unroll if not small
10 years ago
deraadt
0dc2c70460
i386 unrolling blows up the media in a big way, due to -Os for
ramdisk libc builds. there has to be a better way without #ifdef's
in gross places, but I don't see it yet.
10 years ago
tedu
29c323adc2
only unroll on i386 and amd64 (where confirmed to be much faster).
naddy found sparc64 gets a little slower when unrolled.
ok deraadt
10 years ago
tedu
b3da475e6b
unroll loops. much faster on amd64. ok deraadt millert
10 years ago
sthen
fc55253b4e
typo; ok deraadt
10 years ago
deraadt
eb5fb39e0c
warn for correct symbol
10 years ago
schwarze
493a019ded
catch up with swab.c rev. 1.9:
update SYNOPSIS and DESCRIPTION and add STANDARDS
10 years ago
tedu
628b1ad074
update swab() to match the current posix definition. "rationale: none."
rewrite the function to be simpler as well. the compiler can unroll the
loop for us if necessary.
ok schwarze
10 years ago
jmc
ddf1617c43
Xr and Ox fixes;
10 years ago
deraadt
bb5edfc4b2
random seed buffer must be unsigned
10 years ago
jmc
8554fcd94c
no more string(3);
10 years ago
jmc
f0df998b74
fix NAME;
10 years ago
deraadt
a03b475103
improve warnings from rand_r(), rand(), and random()
It may take a few iterations to get the tone right.
previously discussed with millert
10 years ago
deraadt
93087f5d74
In ingo's new world order, we do not want multiple manual pages describing
the same thingies. Therefore these "lists of functions" man pages can go
away.
Hurray! I've wanted these pages to die for around 10 years!
ok ingo (and i think jmc)
10 years ago
tedu
18089adc0a
more standardsier: cast to int to make sure we keep the negative numbers.
observed by jonas termansen
10 years ago
deraadt
c0b4a826d3
Oops, got the sense of the test backwards. Hilarious that we didn't spot it.
10 years ago
deraadt
75d4ae826b
Change rand(), random(), drand48(), lrand48(), mrand48(), and srand48()
to returning strong random by default, source from arc4random(3).
Parameters to the seeding functions are ignored, and the subsystems remain
in strong random mode. If you wish the standardized deterministic mode,
call srand_deterministic(), srandom_determistic(), srand48_deterministic(),
seed48_deterministic() or lcong48_deterministic() instead.
The re-entrant functions rand_r(), erand48(), nrand48(), jrand48() are
unaffected by this change and remain in deterministic mode (for now).
Verified as a good roadmap forward by auditing 8800 pieces of software.
Roughly 60 pieces of software will need adaptation to request the
deterministic mode.
Violates POSIX and C89, which violate best practice in this century.
ok guenther tedu millert
10 years ago
deraadt
b92eebc641
typo
10 years ago
tedu
06e68c2549
more libc, less kernel documentation
10 years ago
tedu
9338c00a6c
tweak recommendation to use arc4random_buf
10 years ago
tedu
b2b8428867
delete documentation for deleted DES interfaces
10 years ago
tedu
5ce122171f
remove cfree from documentation
10 years ago
tedu
ad69399057
delete obsolete sunos cfree function. ok deraadt millert naddy
10 years ago
tedu
10f5d66e90
add siphash from the kernel to libc
10 years ago