openbsd
9 years agoReimplement the audio driver in a simpler way, removing unused/unusable
ratchov [Thu, 25 Jun 2015 06:43:45 +0000 (06:43 +0000)]
Reimplement the audio driver in a simpler way, removing unused/unusable
functionality. Same API and ABI except for the removed bits and no
behaviour change for programs using libsndio. With help from armani@
and mpi@, thanks.

9 years agoFixed a use-after-free. When handing the L2TP Proxy-LCP, a timer was used
yasuoka [Thu, 25 Jun 2015 02:32:48 +0000 (02:32 +0000)]
Fixed a use-after-free.  When handing the L2TP Proxy-LCP, a timer was used
to open LCP.  If the PPP session is terminated before the timer fires, the
timer had been fired with the freed context.  Stop using the timer to open
LCP.

9 years agoReset the LCP option state for dialin-proxy only if re-negotiation is
yasuoka [Thu, 25 Jun 2015 02:25:33 +0000 (02:25 +0000)]
Reset the LCP option state for dialin-proxy only if re-negotiation is
enabled.

9 years agoPut fts_close() where missing.
uebayasi [Thu, 25 Jun 2015 02:04:07 +0000 (02:04 +0000)]
Put fts_close() where missing.

Not bugs in short-lived commands that call exit() -> _exit() immediately,
but for idempotency.

Originally found in ls(1) by Valgrind.  Changes for other commands are
from deraadt@.  Reviewed by me, tested in snapshots.

OK deraadt@

9 years agoyou need to include ddb/db_output.h so you know how to call db_printf
dlg [Thu, 25 Jun 2015 00:58:49 +0000 (00:58 +0000)]
you need to include ddb/db_output.h so you know how to call db_printf
inside MP_LOCKDEBUG.

9 years agofix format string in MP_LOCKDEBUG code
dlg [Thu, 25 Jun 2015 00:53:19 +0000 (00:53 +0000)]
fix format string in MP_LOCKDEBUG code

9 years agocorrect test to sshkey_sign(); spotted by Albert S.
djm [Wed, 24 Jun 2015 23:47:23 +0000 (23:47 +0000)]
correct test to sshkey_sign(); spotted by Albert S.

9 years agoMake ARM_KERNEL_BASE explicitely unsigned
miod [Wed, 24 Jun 2015 21:35:00 +0000 (21:35 +0000)]
Make ARM_KERNEL_BASE explicitely unsigned

9 years agoRemove unused KERNEL_PD_SIZE macro which performs unsafe signed shift of
miod [Wed, 24 Jun 2015 21:26:04 +0000 (21:26 +0000)]
Remove unused KERNEL_PD_SIZE macro which performs unsafe signed shift of
KERNEL_BASE.

9 years agoUninitialized variables; pedro@
miod [Wed, 24 Jun 2015 20:50:39 +0000 (20:50 +0000)]
Uninitialized variables; pedro@

9 years agoAllow uvideo_mmap_queue() to fail gracefully when the mmap queue is full;
miod [Wed, 24 Jun 2015 20:17:28 +0000 (20:17 +0000)]
Allow uvideo_mmap_queue() to fail gracefully when the mmap queue is full;
found the hard way by sebastia@ four years ago, and I'd been sitting on that
diff since.

The initial diff was more aggressive and would free the mmap queue upon error,
but jakemsr@ had objections against this behaviour; this diff only fails
gracefully instead of panic'ing.

9 years ago#undef HZ before defining it such that compiling a kernel with -DHZ=xxx works.
kettenis [Wed, 24 Jun 2015 19:01:51 +0000 (19:01 +0000)]
#undef HZ before defining it such that compiling a kernel with -DHZ=xxx works.

9 years agofauls -> faults
miod [Wed, 24 Jun 2015 18:41:58 +0000 (18:41 +0000)]
fauls -> faults

9 years agoLinux jiffies and OpenBSD ticks are the same thing.
kettenis [Wed, 24 Jun 2015 17:59:42 +0000 (17:59 +0000)]
Linux jiffies and OpenBSD ticks are the same thing.

ok jsg@

9 years agoAttempt to explain how this device works. Based upon a private mail I wrote
miod [Wed, 24 Jun 2015 16:52:52 +0000 (16:52 +0000)]
Attempt to explain how this device works. Based upon a private mail I wrote
6 years ago when asked about this.

9 years agoDo not quiesce the firmware on Quad G5 to let it manage the fans.
mpi [Wed, 24 Jun 2015 14:09:32 +0000 (14:09 +0000)]
Do not quiesce the firmware on Quad G5 to let it manage the fans.

This also unbreak "bsd -cd" on such machine since we use OpenFirmware's
input at this stage of the boot process.

9 years agoIPL_MPSAFE bits for macppc with openpic(4).
mpi [Wed, 24 Jun 2015 11:58:06 +0000 (11:58 +0000)]
IPL_MPSAFE bits for macppc with openpic(4).

9 years agoQuirk needed for SuperTop IDE bridge from frantisek holop.
mpi [Wed, 24 Jun 2015 11:32:37 +0000 (11:32 +0000)]
Quirk needed for SuperTop IDE bridge from frantisek holop.

9 years agoregen
mpi [Wed, 24 Jun 2015 11:31:49 +0000 (11:31 +0000)]
regen

9 years agoSuperTop IDE bridge from frantisek holop.
mpi [Wed, 24 Jun 2015 11:31:04 +0000 (11:31 +0000)]
SuperTop IDE bridge from frantisek holop.

9 years agotweak previous;
jmc [Wed, 24 Jun 2015 10:09:32 +0000 (10:09 +0000)]
tweak previous;

9 years agoPut BUF_memdup() and BUF_reverse() under #ifndef LIBRESSL_INTERNAL.
jsing [Wed, 24 Jun 2015 10:05:14 +0000 (10:05 +0000)]
Put BUF_memdup() and BUF_reverse() under #ifndef LIBRESSL_INTERNAL.

9 years agoStop garbgage collecting mbufs from the ARP, IPv4 and IPv6 queues when
mpi [Wed, 24 Jun 2015 09:56:51 +0000 (09:56 +0000)]
Stop garbgage collecting mbufs from the ARP, IPv4 and IPv6 queues when
an interface is destroyed or removed.

Since the introduction of ph_ifidx, as soon as a mbuf with an invalid
interface index is dequeued it will be freed.

ok claudio@, dlg@

9 years agoStop using BUF_memdup() within the LibreSSL code base - it is correctly
jsing [Wed, 24 Jun 2015 09:44:18 +0000 (09:44 +0000)]
Stop using BUF_memdup() within the LibreSSL code base - it is correctly
spelt malloc+memcpy, which is what is used in all except two places.

ok deraadt@ doug@

9 years agoIncrement if_ipackets in if_input().
mpi [Wed, 24 Jun 2015 09:40:53 +0000 (09:40 +0000)]
Increment if_ipackets in if_input().

Note that pseudo-drivers not using if_input() are not affected by this
conversion.

ok mikeb@, kettenis@, claudio@, dlg@

9 years agoIntroduce Linux work queue APIs and use them. As a side-effect, this will
kettenis [Wed, 24 Jun 2015 08:32:39 +0000 (08:32 +0000)]
Introduce Linux work queue APIs and use them.  As a side-effect, this will
move some of the work from the system task queue to the driver-specific
task queue.

ok jsg@

9 years agoRemove a couple of unused and old #defines that discussed phys and virt
mlarkin [Wed, 24 Jun 2015 07:18:13 +0000 (07:18 +0000)]
Remove a couple of unused and old #defines that discussed phys and virt
address widths in 1st-gen amd64 cpus.

ok kettenis, deraadt, guenther

9 years agoFix npppd to terminate all PPP sessions properly even in case the
yasuoka [Wed, 24 Jun 2015 05:20:16 +0000 (05:20 +0000)]
Fix npppd to terminate all PPP sessions properly even in case the
sending window for L2TP control is full when the control is terminating
(by a L2TP keepalive failure or other reasons).  In that case, if the
L2TP peer didn't respond at all, npppd had kept some PPP sessions
forever.

9 years agosync
deraadt [Wed, 24 Jun 2015 05:18:19 +0000 (05:18 +0000)]
sync

9 years agoUse the return value of event_loop() properly. Also abort(3) if
yasuoka [Wed, 24 Jun 2015 04:57:55 +0000 (04:57 +0000)]
Use the return value of event_loop() properly.  Also abort(3) if
event_loop() returns abnormally which is unexpected.

diff from Yuuichi Someya

9 years agoImprove and fix typo in the comment.
yasuoka [Wed, 24 Jun 2015 04:45:20 +0000 (04:45 +0000)]
Improve and fix typo in the comment.

9 years agoMention that pipex should be also configured by sysctl.
yasuoka [Wed, 24 Jun 2015 04:34:31 +0000 (04:34 +0000)]
Mention that pipex should be also configured by sysctl.

9 years agoreenable the pool gc task.
dlg [Wed, 24 Jun 2015 03:42:08 +0000 (03:42 +0000)]
reenable the pool gc task.

the problems it tickled by working outside the biglock on archs
with mutex and clock interaction have been fixed, as evidenced by
the softnet taskq.

ok deraadt@

9 years agoApply normal handling to atfd+path args to chflagsat(2)
guenther [Wed, 24 Jun 2015 03:38:51 +0000 (03:38 +0000)]
Apply normal handling to atfd+path args to chflagsat(2)

Problem noted by patrick keshishian (sidster (at) boxsoft.com)
ok deraadt@

9 years agoRevert previous commit. We still want to call setgroups in the case where
dtucker [Wed, 24 Jun 2015 01:49:19 +0000 (01:49 +0000)]
Revert previous commit.  We still want to call setgroups in the case where
there are zero groups to remove any that we might otherwise inherit (as
pointed out by grawity at gmail.com) and since the 2nd argument to
setgroups is always a static global it's always valid to dereference in
this case.  ok deraadt@ djm@

9 years agoAdd regress test for multiple negation characters.
millert [Tue, 23 Jun 2015 22:53:14 +0000 (22:53 +0000)]
Add regress test for multiple negation characters.

9 years agoPOSIX specifies that that multiple '!' characters preceding a
millert [Tue, 23 Jun 2015 22:52:55 +0000 (22:52 +0000)]
POSIX specifies that that multiple '!' characters preceding a
function should be treated as a single negation.  From FreeBSD
via Liviu Daia.

9 years agoDisable some of the pmap_emulate_reference() DEBUG checks if option
miod [Tue, 23 Jun 2015 19:50:48 +0000 (19:50 +0000)]
Disable some of the pmap_emulate_reference() DEBUG checks if option
MULTIPROCESSOR, and quote the alpha ARM to explain why; while there, make the
failure messages a bit more detailed.

9 years agoIn the copy(9) function, make sure to remember curproc accross the bcopy()
miod [Tue, 23 Jun 2015 19:49:41 +0000 (19:49 +0000)]
In the copy(9) function, make sure to remember curproc accross the bcopy()
call, instead of &curproc. The copy routine may sleep and we may resume on
a different processor. This has been plaguing the alpha MULTIPROCESSOR kernels
since the very beginning; it's amazing this did not cause more havoc.

Joint debugging and hair pulling with dlg@ and deraadt@; ok dlg@

9 years agoFix the optional lua patterns test with obj and different versions.
reyk [Tue, 23 Jun 2015 19:33:06 +0000 (19:33 +0000)]
Fix the optional lua patterns test with obj and different versions.

9 years agoadd httpd regress
semarie [Tue, 23 Jun 2015 18:04:29 +0000 (18:04 +0000)]
add httpd regress

9 years agoadd regress tests for httpd
semarie [Tue, 23 Jun 2015 18:03:09 +0000 (18:03 +0000)]
add regress tests for httpd

- this testsuite covers patterns

9 years agovarious tweaks;
jmc [Tue, 23 Jun 2015 17:29:19 +0000 (17:29 +0000)]
various tweaks;

9 years agoescape the matched substrings before using it in expansion.
semarie [Tue, 23 Jun 2015 17:25:01 +0000 (17:25 +0000)]
escape the matched substrings before using it in expansion.

ok reyk@

9 years agoremove a deprecated character class.
semarie [Tue, 23 Jun 2015 15:35:20 +0000 (15:35 +0000)]
remove a deprecated character class.

it was deprecated in lua code, but here the code is new. The documentation
don't mention it either.

ok reyk@

9 years agoAdd STANDARDS section; isblank(3) was specified in C99.
bentley [Tue, 23 Jun 2015 15:31:02 +0000 (15:31 +0000)]
Add STANDARDS section; isblank(3) was specified in C99.

ok jung@ jmc@

9 years agoAdd initial support for pattern matching using Lua's pattern matching code.
reyk [Tue, 23 Jun 2015 15:23:14 +0000 (15:23 +0000)]
Add initial support for pattern matching using Lua's pattern matching code.

With important help on the pattern matcher from semarie@

OK semarie@

9 years agoThis patch ensure that when an error is detected, the freed variables in
semarie [Tue, 23 Jun 2015 15:16:34 +0000 (15:16 +0000)]
This patch ensure that when an error is detected, the freed variables in
elf_symloadx() are reinitialised.

Else show_file() in nm.c will used these variables, even if they has
just been freed. (nm.c +689).

Problem found by afl.

ok miod@

9 years agoThis patch ensure that e_shentsize (sections header's size in bytes) is
semarie [Tue, 23 Jun 2015 15:13:29 +0000 (15:13 +0000)]
This patch ensure that e_shentsize (sections header's size in bytes) is
big enough to fill at least one Elf_Shdr.

While here, inverts calloc() arguments to be calloc(nmemb, size),
according to fread() call after.

This problem was found with afl, with e_shentsize=1.

ok miod@

9 years agocorrects a read after bound that occurs in strcmp (line just
semarie [Tue, 23 Jun 2015 15:02:58 +0000 (15:02 +0000)]
corrects a read after bound that occurs in strcmp (line just
after the added bound check).

Found with afl.

ok miod@

9 years agoIf the kernel symbols fit completely into the 2 MB alignment hole
bluhm [Tue, 23 Jun 2015 14:19:21 +0000 (14:19 +0000)]
If the kernel symbols fit completely into the 2 MB alignment hole
after kernel bss but before end of the image, the page tables used
the read-only mapping of the hole.  When booting a small non-generic
kernel, this resulted in a crash, while writing to the page tables
later.
Make sure that the page tables are created after esym and after
end.
OK mlarkin@ deraadt@

9 years agoadd some check before accessing data:
semarie [Tue, 23 Jun 2015 13:43:08 +0000 (13:43 +0000)]
add some check before accessing data:
 - if section header table is be present
 - consistency of section header table size

ok miod@

9 years agoPass a "struct ifnet *" instead of a "struct arpcom *" to arpresolve().
mpi [Tue, 23 Jun 2015 13:20:17 +0000 (13:20 +0000)]
Pass a "struct ifnet *" instead of a "struct arpcom *" to arpresolve().

Most of the ARP layer already take an ifp pointer and this makes clear
wich chunks of code are messing with ac_enaddr.

Note that our Ethernet code assume that these pointer are interchangeable
since the first element of the "struct arpcom" is a "struct ifnet".

9 years agofix emacs pkg names
giovanni [Tue, 23 Jun 2015 13:11:27 +0000 (13:11 +0000)]
fix emacs pkg names

9 years agodelete more p==NULL checks; discussed with miod, kettenis, dlg before
deraadt [Tue, 23 Jun 2015 12:29:46 +0000 (12:29 +0000)]
delete more p==NULL checks; discussed with miod, kettenis, dlg before

9 years agoAdapt bridge(4) to the new if_input() framework.
mpi [Tue, 23 Jun 2015 09:42:23 +0000 (09:42 +0000)]
Adapt bridge(4) to the new if_input() framework.

Move bridge_input() outside of ether_input() in order to duplicate packets
flowing through a bridge port before applying any transformation on mbufs.

This saves a various m_adj(9)/M_PREPEND(9) dances and remove the bridge(4)
hack from vlan(4).

Tested by mxb <mxb AT alumni DOT chalmers DOT se> and kettenis@

ok bluhm@

9 years agoFix npppd to check the size of received GRE packets properly.
yasuoka [Tue, 23 Jun 2015 07:07:33 +0000 (07:07 +0000)]
Fix npppd to check the size of received GRE packets properly.

9 years agoFix the problem when npppd receives a zero length 1701/udp packet. If
yasuoka [Tue, 23 Jun 2015 06:59:54 +0000 (06:59 +0000)]
Fix the problem when npppd receives a zero length 1701/udp packet.  If
it receives such packets when the errno is not EAGAIN or EINTR, it had
closed all L2TP sessions and stoppped the L2TP server.  Also fix the
receiving GRE packet since it potentially has the same problem.

9 years agoFix the links to pppx(4).
yasuoka [Tue, 23 Jun 2015 06:21:53 +0000 (06:21 +0000)]
Fix the links to pppx(4).

diff from Fabian Raetz.

9 years agoChange CBS_dup() to also sync the offset.
doug [Tue, 23 Jun 2015 05:58:28 +0000 (05:58 +0000)]
Change CBS_dup() to also sync the offset.

Previously, CBS_dup() had its own offset.  However, it is more consistent
to copy everything.

ok miod@ jsing@

9 years agoConvert bytestringtest to individual checks and don't short circuit.
doug [Tue, 23 Jun 2015 01:20:24 +0000 (01:20 +0000)]
Convert bytestringtest to individual checks and don't short circuit.

The statements were chained together with OR which makes it more annoying
to debug.  Also, it was short circuiting all tests as soon as one function
failed.  Since the functions are independent, they should each run until
error.

Discussed with miod@ and jsing@

9 years agoRemove unnecessary regress target.
doug [Tue, 23 Jun 2015 00:02:01 +0000 (00:02 +0000)]
Remove unnecessary regress target.

9 years agoDon't count successful partial authentication as failures in monitor;
djm [Mon, 22 Jun 2015 23:42:16 +0000 (23:42 +0000)]
Don't count successful partial authentication as failures in monitor;
this may have caused the monitor to refuse multiple authentications
that would otherwise have successfully completed; ok markus@

9 years agoAdd an #ifdef HIBERNATE to allow to build a kernel without hibernate but
bluhm [Mon, 22 Jun 2015 20:06:11 +0000 (20:06 +0000)]
Add an #ifdef HIBERNATE to allow to build a kernel without hibernate but
with acpi.
OK mlarkin@

9 years agoMake it possible to create write combing mappings through /dev/mem. This is
kettenis [Mon, 22 Jun 2015 18:57:26 +0000 (18:57 +0000)]
Make it possible to create write combing mappings through /dev/mem.  This is
done by introducining a magic offset.  Pages below this offset are mapped
with default memory attributes.  Above this offset pages are mapped write
combining.

ok mlarkin@

9 years agodocument that boot.conf can contain comments;
jmc [Mon, 22 Jun 2015 18:31:48 +0000 (18:31 +0000)]
document that boot.conf can contain comments;
from tilo stritzky

thanks miod for help with the diff, and who also noted that
leading whitespace gets stripped too;

9 years agoIncrement rule counters only after successful state insertion
mikeb [Mon, 22 Jun 2015 15:58:23 +0000 (15:58 +0000)]
Increment rule counters only after successful state insertion

Do rule counter increments after state has been successfully
installed.  This has an additional benefit of making error
handling a bit simpler.

OK mpi, bluhm

9 years agoFlush out another small diff to reduce the diffs with Linux.
kettenis [Mon, 22 Jun 2015 15:20:43 +0000 (15:20 +0000)]
Flush out another small diff to reduce the diffs with Linux.

9 years agotheo buehler points out that posix specifies a prompt defined using -p
jmc [Mon, 22 Jun 2015 14:46:59 +0000 (14:46 +0000)]
theo buehler points out that posix specifies a prompt defined using -p
be reinstated when toggled off then on again; this seems to make sense,
but posix is not explicit.

we know that gnu ed and freebsd do reinstate the user defined prompt, but
we do not. no one has yet stepped up to change this, so i'm adding a note
to this effect until such a time as we do/

i have not tweaked the text for -p or "P" to allow for an easy back out
if behaviour does change;

9 years agoDo not update frame lengths to reflect what has really been transfered
mpi [Mon, 22 Jun 2015 12:56:55 +0000 (12:56 +0000)]
Do not update frame lengths to reflect what has really been transfered
when an isochronous transfer is done.

Frame lengths are just input values and no driver mess with them.

ok ratchov@, jmatthew@

9 years agoDon't call setgroups if we have zero groups; there's no guarantee that it
dtucker [Mon, 22 Jun 2015 12:29:57 +0000 (12:29 +0000)]
Don't call setgroups if we have zero groups; there's no guarantee that it
won't try to deref the pointer.  Based on a patch from mail at quitesimple.org,
ok djm deraadt

9 years agoAfter the last change, we also have to url_encode $SERVER_NAME and
reyk [Mon, 22 Jun 2015 11:46:06 +0000 (11:46 +0000)]
After the last change, we also have to url_encode $SERVER_NAME and
$REMOTE_USER before using them in the Location.

From Sebastien Marie (semarie)

9 years agoMake xhci(4)'s root hub report the same status bits as physical USB3 hubs.
mpi [Mon, 22 Jun 2015 10:29:18 +0000 (10:29 +0000)]
Make xhci(4)'s root hub report the same status bits as physical USB3 hubs.

There's not bit to indicate the speed of a USB3.0 device attached to a hub
port so do not abuse the PORT_TEST bit.  Instead make the xhci(4) root hub
report the PORT_POWER_SS bit when appropriate and use it to determin the
speed of a new device.

While here make the root hub report the link state and config error, from
FreeBSD.

9 years agortrequest1(9) error code path cleanup.
mpi [Mon, 22 Jun 2015 09:07:11 +0000 (09:07 +0000)]
rtrequest1(9) error code path cleanup.

Pass the length to free(9), do not violate the radix/route layer and
set the gateway of a route a bit later to simplify error code path.

ok claudio@

9 years agoApparently some BIOSes not supporting xHCI natively switch USB ports
mpi [Mon, 22 Jun 2015 08:43:27 +0000 (08:43 +0000)]
Apparently some BIOSes not supporting xHCI natively switch USB ports
back to EHCI at suspend.  So route the ports back to xHCI at resume.

Problem reported by Adam Wolk, thanks!

9 years agoDon't use uninitialized data as a return value.
krw [Sun, 21 Jun 2015 21:22:27 +0000 (21:22 +0000)]
Don't use uninitialized data as a return value.

From Brainy via Maxime Villard via tech@.

ok kettenis@

9 years agoDon't leak mem if wsfont_rotate() fails.
jca [Sun, 21 Jun 2015 20:49:18 +0000 (20:49 +0000)]
Don't leak mem if wsfont_rotate() fails.

Problem reported by Maxime Villard, ok miod@

9 years agoCount transmitted packets.
kettenis [Sun, 21 Jun 2015 20:04:30 +0000 (20:04 +0000)]
Count transmitted packets.

9 years agosync
deraadt [Sun, 21 Jun 2015 18:13:11 +0000 (18:13 +0000)]
sync

9 years agosync
deraadt [Sun, 21 Jun 2015 18:11:58 +0000 (18:11 +0000)]
sync

9 years ago5.9 base key
deraadt [Sun, 21 Jun 2015 18:10:02 +0000 (18:10 +0000)]
5.9 base key

9 years agoCheck for failure with CBB_init() in bs_ber.c.
doug [Sun, 21 Jun 2015 16:10:45 +0000 (16:10 +0000)]
Check for failure with CBB_init() in bs_ber.c.

From BoringSSL commit 3fa65f0f05f67615d9daf48940e07f84d094ac6e.

9 years agoWhen encoding the Location url, only encode the query and path
reyk [Sun, 21 Jun 2015 13:08:36 +0000 (13:08 +0000)]
When encoding the Location url, only encode the query and path
elements from the user input and not the constants from the
configuration.  This makes it possible to specify chars like '?' in
the uri.

OK Sebastien Marie

9 years agoThere is a race between sending notifications to the SE and getting a new
claudio [Sun, 21 Jun 2015 12:16:29 +0000 (12:16 +0000)]
There is a race between sending notifications to the SE and getting a new
peer_up event in the RDE. This can be triggered by graceful restart. So
remove the panic and replace it with roughly what peer_down does.
OK phessler and henning

9 years agoAdd .mkv (video/x-matroska).
reyk [Sun, 21 Jun 2015 12:15:09 +0000 (12:15 +0000)]
Add .mkv (video/x-matroska).

From David Hill

ok halex@

9 years agoThere is no need to include sys/ucred.h. Only sys/file.h is needed for the
claudio [Sun, 21 Jun 2015 12:11:13 +0000 (12:11 +0000)]
There is no need to include sys/ucred.h. Only sys/file.h is needed for the
DTYPE defines.

9 years agoJust return if nmemb is 0. Avoids a NULL dereference and is
millert [Sun, 21 Jun 2015 03:20:56 +0000 (03:20 +0000)]
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 agomemory leak on failure; from Maxime Villard
deraadt [Sun, 21 Jun 2015 00:15:12 +0000 (00:15 +0000)]
memory leak on failure; from Maxime Villard

9 years agoFix a bug that causes uvm_pmr_get1page() to fail for allocations that
kettenis [Sat, 20 Jun 2015 20:20:08 +0000 (20:20 +0000)]
Fix a bug that causes uvm_pmr_get1page() to fail for allocations that
specify an address constraint even when free pages that meet the constraint
are still available.  This happens because the old code was using the root
of the size tree as a starting point for a search down the address tree.
This meant only part of the address tree was searched, and that part could
very well not contain any of the pages that met the constraint.  Instead,
always walk the address tree from its root if the list of single pages is
empty and the root of the size tree doesn't meet our constraints.

From Visa Hankala.

ok deraadt@

9 years agoConvert ssl3_get_new_session_ticket to CBS.
doug [Sat, 20 Jun 2015 18:19:56 +0000 (18:19 +0000)]
Convert ssl3_get_new_session_ticket to CBS.

tweak + ok miod@ jsing@

9 years agoConvert ssl3_get_next_proto to CBS.
doug [Sat, 20 Jun 2015 17:04:07 +0000 (17:04 +0000)]
Convert ssl3_get_next_proto to CBS.

tweak + ok miod@ jsing@

9 years agoConvert ssl_parse_serverhello_renegotiate_ext to CBS.
doug [Sat, 20 Jun 2015 16:42:48 +0000 (16:42 +0000)]
Convert ssl_parse_serverhello_renegotiate_ext to CBS.

ok miod@ jsing@

9 years agoHandle NIST curve names in openssl(1) ecparam.
jsing [Sat, 20 Jun 2015 14:24:49 +0000 (14:24 +0000)]
Handle NIST curve names in openssl(1) ecparam.

From OpenSSL.

9 years agoHandle NIST curve names.
jsing [Sat, 20 Jun 2015 14:19:39 +0000 (14:19 +0000)]
Handle NIST curve names.

From OpenSSL.

ok miod@ (a while ago)

9 years agoHave ECPKParameters_print() include the NIST curve name, if known.
jsing [Sat, 20 Jun 2015 14:17:07 +0000 (14:17 +0000)]
Have ECPKParameters_print() include the NIST curve name, if known.

From OpenSSL.

ok miod@ (a while ago).

9 years agoLess mdc2.
jsing [Sat, 20 Jun 2015 13:51:52 +0000 (13:51 +0000)]
Less mdc2.

9 years agoProvide EC_curve_nid2nist() and EC_curve_nist2nid().
jsing [Sat, 20 Jun 2015 13:26:08 +0000 (13:26 +0000)]
Provide EC_curve_nid2nist() and EC_curve_nist2nid().

From OpenSSL.

Rides libcrypto bump.

ok miod@ (a while ago)

9 years agoMake SSL_OP_ALL readable.
jsing [Sat, 20 Jun 2015 12:29:39 +0000 (12:29 +0000)]
Make SSL_OP_ALL readable.

ok deraadt@ doug@ millert@ miod@ sthen@

9 years agoPut CRYPTO_memcmp() under #ifndef LIBRESSL_INTERNAL.
jsing [Sat, 20 Jun 2015 12:01:54 +0000 (12:01 +0000)]
Put CRYPTO_memcmp() under #ifndef LIBRESSL_INTERNAL.

ok doug@ deraadt@

9 years agoReplace remaining CRYPTO_memcmp() calls with timingsafe_memcmp().
jsing [Sat, 20 Jun 2015 12:01:14 +0000 (12:01 +0000)]
Replace remaining CRYPTO_memcmp() calls with timingsafe_memcmp().

ok doug@ deraadt@