summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/recallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-07-05nits about trailing punctuation found with mandoc -Tlintschwarze1-4/+4
2017-07-05void functions don't return 0tb1-6/+2
From Klemens Nanni
2017-07-05fix cross references to self; found with mandoc -Tlintschwarze4-13/+12
2017-06-28.init stub creation doesn't need a jmp + .align to reach a branch target,deraadt1-3/+0
just fall into the code. The .align created a FILL zone in the .init section, which on i386 was filled with a NOP-sled, something we want to get away from. discussed with kettenis and tom
2017-06-22Use the tls_password_cb() callback with all PEM_read_bio_*() calls, so thatjsing4-11/+14
we can prevent libcrypto from going behind our back and trying to read passwords from standard input (which we may not be permitted to do). Found by jsg@ with httpd and password protected keys.
2017-06-22Fix incorrect indentation.jsing1-2/+2
2017-06-22Plug a memory leak in tls_keypair_cert_hash(), introduced in r1.60.jsing1-1/+3
2017-06-22Remove dead code that has remained hiding since ressl.c r1.14!jsing1-4/+1
2017-06-22Use the standard `rv' idiom in tls_keypair_load_cert(), rather thanjsing1-5/+4
duplicating clean up code.
2017-06-22Distinguish between self-issued certificates and self-signed certificates.jsing2-30/+40
The certificate verification code has special cases for self-signed certificates and without this change, self-issued certificates (which it seems are common place with openvpn/easyrsa) were also being included in this category. Based on BoringSSL. Thanks to Dale Ghent <daleg at elemental dot org> for assisting in identifying the issue and testing this fix. ok inoguchi@
2017-06-19port the RBT code to userland by making it part of libc.dlg1-10/+11
src/lib/libc/gen/tree.c is a copy of src/sys/kern/subr_tree.c, but with annotations for symbol visibility. changes to one should be reflected in the other. the malloc debug code that uses RB code is ported to RBT. because libc provides the RBT code, procmap doesn't have to reach into the kernel and build subr_tree.c itself now. mild enthusiasm from many ok guenther@
2017-06-16mark files as BUILDFIRST, or write explicit dependencies, so that mostespie1-1/+2
programs will build even without a make depend first. okay tb@ millert@
2017-06-11Continue the flattening of the pledge logic started in r1.184 and placetb1-8/+8
a blank space somewhere else. suggested by and ok jsing
2017-06-11Simple style(9) fixes from Juuso Lapinlampi, mostly whitespace andtb1-33/+35
omitting parentheses in return statements. Binary change because of return instead of exit(3) from main and because help() is now __dead. ok awolk
2017-06-10If -P and -c were given, a second pledge call tried to add "rpath" to thetb1-8/+5
first pledge promises, so nc exited with EPERM. To fix this, merge the pledge of the Pflag && usetls case into the first pledge block. This allows us to get rid of the second pledge block and thus to simplify the logic a bit. While there, add a missing blank to an error string. Joint effort by the #openbsd-daily code reading group, problem found and initial patch by <rain1 openmailbox org>. ok awolk
2017-06-10fix broken markup of callback arguments; found with mandoc -Tlintschwarze2-11/+8
2017-06-10repair broken markup of callback argument; found with mandoc -Tlintschwarze1-5/+3
2017-05-30Don't fall back to heapsort() if we would otherwise switch tomillert1-7/+7
insertion sort (when the number of elements is < 7).
2017-05-29Randomize link-order of libcrypto as we do with libc. This libraryderaadt1-1/+2
has many small functions without significant local storage, therefore less tail protection from -fstack-protector-strong to prevent their use as ROP gadgets. It is used in security contexts. Also many functions dribble pointers onto the stack, allowing discovery of gadgets via the fixed relative addresses, so let's randomly bias those. ok tedu jsing The rc script will soon need a strategy for skipping this step on machines with poor IO performance. Or maybe do it less often? However, I don't see many more libraries we'll do this with, these are the two most important ones.
2017-05-27Also test arrays of double and long long.millert1-142/+421
2017-05-26Synchronise chacha test cases with the referenced draft - this adds ajsing1-23/+23
missing test case, reassigns two of the labels and removes a test case that was from an earlier draft. Inconsistency noted by Steven Roberts <fenderq at gmail dot com>, some time ago...
2017-05-26Avoid a potential NULL pointer dereference in d2i_ECPrivateKey().jsing1-1/+7
Reported by Robert Swiecki, who found the issue using honggfuzz. ok bcook@
2017-05-26Fix gcc warnings triggered by WARNINGS=yes.bluhm1-9/+9
OK florian@
2017-05-25Add definitions for three OIDs used in EV certificates.jsing2-0/+9
From Kyle J. McKay <mackyle at gmail dot com>
2017-05-24Support swapping 32-bit aligned elements on 64-bit platforms.millert1-22/+63
Previously they would be swapped a byte at a time when sizeof(int) != sizeof(long). Idea from FreeBSD.
2017-05-22Add timing and test name options.millert1-12/+83
2017-05-22Instead of embedding pre-generated tables from McIlroy's "A Killermillert3-1538/+315
Adversary for Quicksort", just include the code to generate them. Also allow the number of elements to be specified on the command line.
2017-05-21correct a return value testjsg1-1/+1
ok millert@
2017-05-20Document that qsort falls back to heapsort() if the recursion depthmillert1-3/+13
exceeds 2 lg N and add a reference to the introsort paper.
2017-05-20Use David Musser's introsort algorithm to fall back to heapsort(3)millert2-14/+45
when the recursion depth reaches 2*lg(n + 1). This avoids quicksort's quadratic behavior for pathological input without appreciably changing the average run time.
2017-05-19Add input targeted at the Bentley and McIrlroy quicksort generatedmillert1-6/+1389
by McIlroy's "A Killer Adversary for Quicksort". This results in quadratic behavior and the test aborts before completion.
2017-05-18use mergesort instead of heapsort when comparing resultsmillert1-9/+17
2017-05-17Avoid running the "killer" tests multiple times with the samemillert1-10/+19
parameters.
2017-05-17Add "median of three" killer, as seen in "Introspective Sorting andmillert1-18/+44
Selection Algorithms" by David R Musser.
2017-05-17Approximate nlgn instead of using libm. The same approximation maymillert2-10/+8
be used in qsort.c in a later commit.
2017-05-17Add "killer" input from "algorithmic complexity attacks and libcmillert1-0/+12
qsort()". This causes quadratic behavior with the 4.4BSD qsort's "switch to insertion sort" optimization when the input appears to be mostly sorted. That optimization was removed in qsort.c r1.12 but it is worth having in the regress test too.
2017-05-17The BSD qsort() performs tail recursion elimination on the secondmillert1-10/+25
side of the array being partitioned to save on stack space. Greater savings can be gained by choosing recursion for the smaller side of the partition and eliminating recursion for the larger side. This also results in a small but measurable performance gain. OK otto@ schwarze@
2017-05-17There's no need to track the number of errors (and the counter mightmillert1-21/+30
wrap), make it a flag instead. Pointed out by schwarze@
2017-05-17Add qsort(3) regress based on Bentley & McIlroy's "Engineering a Sort Function"millert3-2/+278
2017-05-16Plug a memory leak. The main_cert needs to be X509_free()ed sinceclaudio1-0/+2
SSL_get_peer_certificate() increases the ref count whereas extra_certs do not because SSL_get_peer_cert_chain() won't increase ref counts. OK beck@
2017-05-16typo: ket -> key.tb1-3/+3
from "fenderq" on freenode via tj
2017-05-15Typo: freezeo -> freezerotb1-3/+3
From "fenderq" on freenode via tj@
2017-05-13- fix bug wrt posix_memalign(3) of blocks between half a page and a pageotto2-8/+18
- document posix_memalign() does not play nice with reacallocarray(3) and freezero(3)
2017-05-11Fix a problem introduced in freezero() conversion and usejsg1-2/+2
sizeof(struct) not sizeof(pointer). otto@ points out that on OpenBSD currently freezero() would have still zeroed the entire allocation, but this is not documented behaviour and may change in future. ok tom@
2017-05-10Implement nc -W recvlimit to terminate netcat after receiving abluhm2-8/+28
number of packets. This allows to send a UDP request, receive a reply and check the result on the command line. input jmc@; OK millert@
2017-05-08simplify startdate/enddate validationbeck1-27/+5
ok jsing@
2017-05-08Print size_t's correctly.beck1-3/+3
Fix from Jonas 'Sortie' Termansen <sortie@maxsi.org>
2017-05-08BUF_MEM_grow_clean() returns an int, not a size_t. Humourously, on successjsing1-3/+3
it returns "len", which is a size_t value, as an int...
2017-05-07Revise cipher suites in regress to match DSS cipher suite removal.jsing1-96/+82
2017-05-07Drop cipher suites with DSS authentication - there is no good reason tojsing1-197/+1
keep these around. ok beck@