guenther
3e2a03de0a
Add framework for resolving (pun intended) libc namespace issues, using
wrapper .h files and asm labels to let internal calls resolve directly and
not be overridable or use the PLT. Then, apply that framework to most of
the functions in stdio.h, string.h, err.h, and wchar.h. Delete the
should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here.
tests clean on i386, amd64, sparc64, powerpc, and mips64
naming feedback from kettenis@ and millert@
ok kettenis@
9 years ago
guenther
8858b239f2
Move the __rand48_* declarations into rand48.h, and then hide both them
and __dorand48() and __rand48_deterministic
ok deraadt@
9 years ago
deraadt
70232307a6
All these files include <stdlib.h>, so do not need to cast
malloc/calloc/realloc* returns.
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
millert
7b99cfa53d
Just return if nmemb is 0. Avoids a NULL dereference and is
consistent with the behavior of the other libc sort functions.
OK deraadt@
9 years ago
millert
482e9aac5b
Remove needless casts. There's no reason to cast delim to char *
when we can just make spanp const char * to match it. OK deraadt@
9 years ago
millert
4ab11614ee
Make index/rindex weak aliases of strchr/strrchr since they are not
part of the ISO C standard and have also been dropped from POSIX.
OK guenther@ kettenis@
9 years ago
bluhm
4498258510
If crypt(3) is called with an unknown setting, return NULL instead
of some undefined value.
OK tedu@
9 years ago
guenther
69ecb65582
Add dlclose(3) to SEE ALSO
ok millert@ jmc@ schwarze@
9 years ago
guenther
726c811e97
When checking flags that will be passed to open(), test the O_ACCMODE portion
separately to avoid false negatives.
ok miod@ millert@
9 years ago
nicm
fadf08888f
Another couple of commas in the wrong place, ok jmc
9 years ago
guenther
04a5d5b45d
Make pthread_atfork() track the DSO that called it like atexit() does,
unregistering callbacks if the DSO is unloaded. Move the callback
handling from libpthread to libc, though libpthread still overrides the
inner call to handle locking and thread-library reinitialization.
Major version bump for both libc and libpthread.
verification that this fixes various ports ajacoutot@
asm assistance miod@; ok millert@ deraadt@
9 years ago
tedu
bd36abfa7c
bludgeon DES support out of crypt. long live the bcrypt.
9 years ago
tedu
b4484c676a
improve realloc. when expanding a region, actually use the free page cache
instead of simply zapping it. this can save many syscalls in a program
that repeatedly grows and shrinks a buffer, as observed in the wild.
9 years ago
tedu
e87c880491
remove incorrect statement. the standard *does* require calloc to check
for overflow. stop talking about old broken systems, there's little use
for such info.
9 years ago
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