summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-07-30Some cleanups and clarification, especially regarding locking (observed by rob)Theo de Raadt
ok beck jmc
2018-07-30tweak previous;Jason McIntyre
2018-07-30document the current limitation (we don't yet find an above coveringBob Beck
unveil for relative operations) that I am working on in BUGS
2018-07-29Document that X509_{NAME,REQ,REQ_INFO}_free() are all NULL safe.Theo Buehler
From Ross L. Richardson
2018-07-28re-ordering for sensibility, by semarie; ok jmcTheo de Raadt
2018-07-28Move libsndio session cookie in its own $HOME/.sndio/ directory toAlexandre Ratchov
make libsndio easier to use with unveil(2). "make sense" deraadt
2018-07-28Rename the sndiod unix domain socket to /tmp/sndio/sockN to avoidAlexandre Ratchov
wondering what are these "aucat" files in /tmp. "make sense" deraadt
2018-07-27Full stop.rob
2018-07-26Mention some missing libevent macros.rob
ok jmc@, benno@, "yes" deraadt@
2018-07-24add c++ symbol annotationsBrent Cook
from Cameron Palmer
2018-07-24Fix address calculation for _DYNAMIC. We want to address of _DYNAMIC itself,Mark Kettenis
not the address of its GOT entry. The current code mixed the high bits of the GOT entry address with the low bits of the true address. This only worked by accident for small binaries where _DYNAMIC and its GOT entry happen to reside on the same page. ok guenther@, mortimer@
2018-07-24Use the same order in NAME, SYNOPSIS, DESCRIPTION, and RETURN VALUES toTheo Buehler
improve readability and ease of maintenance. Positive feedback jmc Detailed suggestion & ok schwarze
2018-07-23Document tls_peer_ocsp_result() and use it in place of the non-existentTheo Buehler
tls_peer_ocsp_result_msg() in the documentation. input & ok jsing Reads fine to jmc and makes sense to schwarze
2018-07-23Use BN_swap_ct() instead of BN_consttime_swap() inTheo Buehler
ec_GF2m_montgomery_point_multiply(). The new BN_swap_ct() API is an improved version of the public BN_consttime_swap() function: it allows error checking, doesn't assert(), and has fewer assumptions on the input. This diff eliminates the last use of BN_consttime_swap() in our tree. ok inoguchi, jsing
2018-07-23Use a size_t instead of an int for the byte count in BN_swap_ct().Theo Buehler
Since bignums use ints for the same purpose, this still uses an int internally after an overflow check. Suggested by and discussed with jsing. ok inoguchi, jsing
2018-07-23Clean up our disgusting implementations of BN_{,u}{add,sub}(), followingTheo Buehler
changes made in OpenSSL by Davide Galassi and others, so that one can actually follow what is going on. There is no performance impact from this change as the code still does essentially the same thing. There's a ton of work still to be done to make the BN code less terrible. ok jsing, kn
2018-07-23Implement RSASSA-PKCS1-v1_5 as specified in RFC 8017.Theo Buehler
Based on an OpenSSL commit by David Benjamin. Alex Gaynor and Paul Kehrer from the pyca/cryptography Python library reported that more than 200 "expected to fail" signatures among Project Wycheproof's test vectors validated on LibreSSL. This patch makes them all fail. ok jsing commit 608a026494c1e7a14f6d6cfcc5e4994fe2728836 Author: David Benjamin <davidben@google.com> Date: Sat Aug 20 13:35:17 2016 -0400 Implement RSASSA-PKCS1-v1_5 as specified. RFC 3447, section 8.2.2, steps 3 and 4 states that verifiers must encode the DigestInfo struct and then compare the result against the public key operation result. This implies that one and only one encoding is legal. OpenSSL instead parses with crypto/asn1, then checks that the encoding round-trips, and allows some variations for the parameter. Sufficient laxness in this area can allow signature forgeries, as described in https://www.imperialviolet.org/2014/09/26/pkcs1.html Although there aren't known attacks against OpenSSL's current scheme, this change makes OpenSSL implement the algorithm as specified. This avoids the uncertainty and, more importantly, helps grow a healthy ecosystem. Laxness beyond the spec, particularly in implementations which enjoy wide use, risks harm to the ecosystem for all. A signature producer which only tests against OpenSSL may not notice bugs and accidentally become widely deployed. Thus implementations have a responsibility to honor the specification as tightly as is practical. In some cases, the damage is permanent and the spec deviation and security risk becomes a tax all implementors must forever pay, but not here. Both BoringSSL and Go successfully implemented and deployed RSASSA-PKCS1-v1_5 as specified since their respective beginnings, so this change should be compatible enough to pin down in future OpenSSL releases. See also https://tools.ietf.org/html/draft-thomson-postel-was-wrong-00 As a bonus, by not having to deal with sign/verify differences, this version is also somewhat clearer. It also more consistently enforces digest lengths in the verify_recover codepath. The NID_md5_sha1 codepath wasn't quite doing this right. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1474
2018-07-21comment out a dead Xr;Jason McIntyre
2018-07-18Remove the unused leftovers of the 4.4BSD libm, which was only usedChristian Weisgerber
on non-IEEE platforms. Since the VAX port was discontinued, all our remaining architectures use IEEE floating point, as will any future ones. ok millert@ tb@
2018-07-18tidy up the flags section a little: supply a little more indent, and reduceJason McIntyre
the amount of modal verbs going on;
2018-07-16Document behavior change of EC_POINTs_mul() again.Theo Buehler
2018-07-16Recommit Billy Brumley's ECC constant time patch with a fix for sparc64Theo Buehler
from Nicola Tuveri (who spotted the omission of ecp_nist.c from the PR). discussed with jsing tested by jsg
2018-07-16Implement FBT_FSYNC, which is called on fsync(2) and fdatasync(2).helg
Currently ignores the a_waitfor argument and always invokes the file system's fsync implementation synchronously. ok mpi@
2018-07-16fix thinkoMarc Espie
okay mestre@
2018-07-15recommit label indentation part of the backout; clearly unrelated to theTheo Buehler
breakage.
2018-07-15back out ecc constant time changesJonathan Gray
after the constant time commits various regress tests started failing on sparc64 ssh t9, libcrypto ec ecdh ecdsa and trying to ssh out resulted in 'invalid elliptic curve value' ok tb@
2018-07-13Correct some typos and also ran it through mandoc -TlintRicardo Mestre
OK millert@ deraadt@ and jmc@ who also gave me a cluebat stick
2018-07-13Crank minor for unveilBob Beck
ok deraadt@
2018-07-13Unveiling unveil(2).Bob Beck
This brings unveil into the tree, disabled by default - Currently this will return EPERM on all attempts to use it until we are fully certain it is ready for people to start using, but this now allows for others to do more tweaking and experimentation. Still needs to send the unveil's across forks and execs before fully enabling. Many thanks to robert@ and deraadt@ for extensive testing. ok deraadt@
2018-07-13Eliminate the weird condition in the BN_swap_ct() API that at most one bitTheo Buehler
be set in condition. This makes the constant time bit-twiddling a bit trickier, but it's not too bad. Thanks to halex for an extensive rubber ducking session over a non-spicy spicy tabouleh falafel.. ok jsing, kn
2018-07-12Add hw.ncpuonline to count the number of online CPUs.cheloha
The introduction of hw.smt means that logical CPUs can be disabled after boot and prior to suspend/resume. If hw.smt=0 (the default), there needs to be a way to count the number of hardware threads available on the system at any given time. So, import HW_NCPUONLINE/hw.ncpuonline from NetBSD and document it. hw.ncpu becomes equal to the number of CPUs given to sched_init_cpu() during boot, while hw.ncpuonline is equal to the number of CPUs available to the scheduler in the cpuset "sched_all_cpus". Set_SC_NPROCESSORS_ONLN equal to this new sysctl and keep _SC_NPROCESSORS_CONF equal to hw.ncpu. This is preferable to adding a new sysctl to count the number of configured CPUs and keeping hw.ncpu equal to the number of online CPUs because such a change would break software in the ecosystem that relies on HW_NCPU/hw.ncpu to measure CPU usage and the like. Such software in base includes top(1), systat(1), and snmpd(8), and perhaps others. We don't need additional locking to count the cardinality of a cpuset in this case because the only interfaces that can modify said cardinality are sysctl(2) and ioctl(2), both of which are under the KERNEL_LOCK. Software using HW_NCPU/hw.ncpu to determine optimal parallism will need to be updated to use HW_NCPUONLINE/hw.ncpuonline. Until then, such software may perform suboptimally. However, most changes will be similar to the change included here for libcxx's std::thread:hardware_concurrency(): using HW_NCPUONLINE in lieu of HW_NCPU should be sufficient for determining optimal parallelism for most software if the change to _SC_NPROCESSORS_ONLN is insufficient. Prompted by deraadt. Discussed at length with kettenis, deraadt, and sthen. Lots of patch tweaks from kettenis. ok kettenis, "proceed" deraadt
2018-07-11Sync commentkn
Makes it a tad easier to read through and compare with BN_swap_ct(). OK tb
2018-07-11Drop a const-bomb on regexec. It's probably not a good idea to remove aMartijn van Duren
const promise when processing it in the regex engine. Minor tweak and OK schwarze@
2018-07-11Document behavior change of EC_POINTs_mul(3) from EC constant time changes.Theo Buehler
ok beck on earlier version, markup help from Schwarze.
2018-07-11Turn yesterday's optimistic ! in an XXX comment into a more cautious ?Theo Buehler
2018-07-10Indent labels by a space so they don't obliterate function names in diffs.Theo Buehler
2018-07-10ECC constant time scalar multiplication support. First step in overhaulingTheo Buehler
the EC module. From Billy Brumley and his team, via https://github.com/libressl-portable/openbsd/pull/94 With tweaks from jsing and me. ok jsing
2018-07-10Provide BN_swap_ct(), a constant time function that conditionally swapsTheo Buehler
two bignums. It's saner and substantially less ugly than the existing public BN_constantime_swap() function and will be used in forthcoming work on constant time ECC code. From Billy Brumley and his team. Thanks! ok jsing
2018-07-10Factor out a bit of ugly code that truncates the digest to the order_bitsTheo Buehler
leftmost bits of a longer digest, according to FIPS 183-6, 6.4. Eliminate a microoptimization that only converts the relevant part of the digest to a bignum. ok beck, jsing
2018-07-10In asm.h ensure NENTRY uses the old-school nop-sled align, but change standardTheo de Raadt
ENTRY is a trapsled. Fix a few functions which fall-through into an ENTRY macro. amd64 binaries now are free of double+-nop sequences (except for one assember nit in aes-586.pl). Previous changes by guenther got us here. ok mortimer kettenis
2018-07-09Move a detail on tls_connect(3) to its documentation and be a bit moreTheo Buehler
explicit about the servername argument of tls_connect_servername(3). input & ok jsing, input & ok schwarze on earlier version
2018-07-09wording tweak for tls_init() from jsingTheo Buehler
ok jsing, schwarze
2018-07-09Delete the VM86 kernel option and i386_vm86(3) API: it's requiredPhilip Guenther
a custom kernel for over 20 years. testing mlarkin@ ok deraadt@ phessler@ jca@ matthieu@
2018-07-09sync with const changes in x509.h r1.68.Theo Buehler
2018-07-09sync with const changes in evp.h r1.64.Theo Buehler
2018-07-09sync with const changes in bio.h r1.44.Theo Buehler
2018-07-09sync with const changes in bio.h r1.45.Theo Buehler
2018-07-09Fix hid_usage_in_page(hid_parse_usage_in_page()) for the Buttons page.Martin Pieuchot
From David Bern.
2018-07-08import the relevant parts of a new ASN1_INTEGER_get(3) manual pageIngo Schwarze
from OpenSSL, fixing many bugs and polishing many details
2018-07-08Simplify and shorten the description of tls_init(3),Ingo Schwarze
fixing an awkward wording noticed by tb@. OK tb@