in pool_destroy, enter and leave mutex as necessary to satisfy assertions.
ok dlg
document -fstack-shuffle
ok jmc@ tedu@
Someone (TM) thought it was smart to save memory by using malloc(1) and
manual field fiddling to create an ASN1_INTEGER object, instead of using
M_ASN1_INTEGER_new() which will allocate sizeof(long) bytes.
That person had probably never looked into malloc(3) and never heard of
allocation size rounding.

Thus, replace the obfuscated code with M_ASN1_INTEGER_new() followed by
ASN1_INTEGER_set(), to achieve a similar result, without the need for
/* version == 0 */ comments.

ok bcook@
X509_TRUST_add(): check X509_TRUST_get0() return value before dereferencing it,
for it may be NULL. Do not leak memory upon error.

ok bcook@
X509v3_add_ext(): do not free stuff we did not allocate in the error path.
ok bcook@
Revert 1.142. Without the down netstart will just print the ifconfig
output because it may end up just calling 'ifconfig $if'. This needs
to be done better and properly tested.
Make the goressl regress test compile again.
Remove a limitation that ignored IPv6 link-local addresses on carp(4).
This workaround was needed when the interface link-local address was
still enabled by default to prevent immediate state transition on
interfaces without any configured addresses.  This is not needed
anymore and removing the limitation allows to use carp(4) with
addresses like fe80::2%carp0.

discussed with some
ok mpi@ pelikan@
Add a new API function SSL_CTX_use_certificate_chain() that allows to
read the PEM-encoded certificate chain from memory instead of a file.
This idea is derived from an older implementation in relayd that was
needed to use the function with a privep'ed process in a chroot.  Now
it is time to get it into LibreSSL to make the API more privsep-
friendly and to make it available for other programs and the ressl
library.

ok jsing@ miod@
Provide a ressl config function that explicitly clears keys.

Now that ressl config takes copies of the keys passed to it, the keys need
to be explicitly cleared. While this can be done by calling the appropriate
functions with a NULL pointer, it is simpler and more obvious to call one
function that does this for you.

ok tedu@
Bump minor after adding SSL_CTX_use_certificate_chain().

ok jsing@ miod@
Wrap long lines and add missing argument name.
Use TAILQ_FOREACH_SAFE when we might delete entries for the list.
Replace uvm_km_alloc(9) and uvm_km_free(9) with the equivalent km_alooc(9)
and km_free(9) calls.

ok tedu@, mlarkin@
Properly serialize closing our vnode.  Fixes the occasional panic during
reboot or when restaring ldomd(8).
correctly decrement the C_SCSIXFER reference count in wdc_xfer flags
if the ata stack xfer free path is called before teh scsi xfer free
path. this fixes a leak.

in the vast majority of uses (eg, filesystems mounted on cd(4) via
atapiscsi(4)) the scsi xfer free is always done first. however, if
you're doing ioctls (eg, cdio(1)), the scsi ref is held over to the
ioctl completion path, so the ata xfer free happens first.

problem found by patrick keshishian who did some excellent work
debugging this and providing the right fix for it.

ok jmatthew@
X509_VERIFY_PARAM_set1_name(): if invoked with NULL as the second
parameter, correctly set param->name to NULL after having freed it.
ok bcook@
X509_NAME_get_text_by_OBJ(): make sure we do not pass a negative size to
memcpy().
ok bcook@
check_cert(): be sure to reset ctx->current_crl to NULL before freeing it.

X509_STORE_CTX_init(): do not free the X509_STORE_CTX * parameter upon
failure, for we did not allocate it and it might not come from the heap,
such as in check_crl_path() in this very same file where X509_STORE_CTX_init()
gets invoked with a stack address.

ok bcook@
sync