summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/buffer/buffer.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-04-30whitespacebeck1-3/+3
2017-04-30Make BIO_get_host_ip just yet another getaddrinfo wrapperbeck1-27/+20
2017-04-30Rework BIO_accept to be more like modern code.beck1-54/+19
ok jsing@
2017-04-30Only enable -Werror on libcrypto/libssl/libtls if we are building withjsing3-7/+14
gcc4. This should avoid failed builds while transitioning compilers. While here also make the CFLAGS blocks consistent across makefiles. Discussed with deraadt@, ok beck@
2017-04-30Switch back to freezero() and explicitly initialise data_len to zero. Thejsing1-6/+3
previous code was safe since data would always be NULL if data_len was uninitialised, however compilers cannot know this.
2017-04-30Microsoft Windows hates BIO_get_accept_socket in portable. Fix it tobeck1-115/+35
not be awful or have any claims on supporting ipv6 when it does so very badly ok jsing@
2017-04-30Add missing tls_init() and tls_free() calls.jsing1-1/+4
2017-04-30Add a tls_keypair_clear_key() function that uses freezero() to make keyjsing1-5/+11
material inaccessible, then call it from the appropriate places. ok beck@
2017-04-29Fix a bug caused by the return value being set early to signal successfuljsing1-5/+5
DTLS cookie validation. This can mask a later failure and result in a positive return value being returned from ssl3_get_client_hello(), when it should return a negative value to propagate the error. Ironically this was introduced in OpenSSL 2e9802b7a7b with the commit message "Fix DTLS cookie management bugs". Fix based on OpenSSL. Issue reported by Nicolas Bouliane <nbouliane at jive dot com>. ok beck@
2017-04-29Revert previous - we still want to do this, but I forgot about the installerbeck2-14/+6
and want to avoid the wrath of theo when he arrives home in a couple of hours :)
2017-04-29We now require you to have a working libpthreadbeck1-1/+2
2017-04-29Make it safe to call SSL_library_init more than once.beck1-5/+12
We are basically admitting that pthread is everywhere, and we will be using it for other things too. ok jsing@
2017-04-29Stop calling OPENSSL_init() internally, since it is a no-op. Also placejsing3-9/+4
it under #ifndef LIBRESSL_INTERNAL. ok beck@
2017-04-29Switch Linux getrandom() usage to non-blocking mode, continuing tobeck1-6/+9
use fallback mechanims if unsuccessful. The design of Linux getrandom is broken. It has an uninitialized phase coupled with blocking behaviour, which is unacceptable from within a library at boot time without possible recovery. ok deraadt@ jsing@
2017-04-28Revert previous change that forced consistency between return value andbeck1-10/+2
error code, since this breaks the documented API. Under certain circumstances this will result in incorrect successful certiticate verification (where a user supplied callback always returns 1, and later code checks the error code to potentially abort post verification)
2017-04-28revert previous accidental commitbeck5-25/+46
2017-04-28*** empty log message ***beck5-46/+25
2017-04-27Remove "len < 0" check; len is socklen_t (uint32_t) so can't bemillert1-2/+2
negative. Quiets a warning from clang. OK bluhm@
2017-04-27tls_free(3) and tls_config_free(3) accept NULL;schwarze2-4/+14
patch from Matthew Martin <phy1729 at gmail dot com>, slightly tweaked by me
2017-04-23Rearrange text a bit to make it clear what "discarded" means; ok jmc@ deraadt@otto1-8/+13
2017-04-22For small allocations (chunk) freezero only validates the givenotto1-5/+10
size if canaries are enabled. In that case we have the exact requested size of the allocation. But we can at least check the given size against the chunk size if C is not enabled. Plus add some braces so my brain doesn't have to scan for dangling else problems when I see this code.
2017-04-20Fix previous.visa1-2/+2
2017-04-20Get TCB address using the RDHWR instruction instead of __get_tcb().visa1-4/+5
This gives fast access to the address on systems that implement the UserLocal register. TCB caching is still used when running in the single-threaded mode in order not to penalize old systems. The kernel counterpart of this change must be in place before using this diff! With guenther@
2017-04-18don't forget to fill in canary bytes for posix_memalign(3); reported byotto1-1/+4
and ok jeremy@
2017-04-18use freezero() instead of 4-line conditional explicit_bzero + freederaadt4-28/+10
2017-04-17consictently use .Dv NULL and a few other tweaks; ok schwarze@otto1-20/+17
2017-04-17whitespace fixesotto1-14/+14
2017-04-16Use INT_MAX instead of SIZE_MAX as the maximum file size we can handle.kettenis1-2/+2
Fixes this test on 64-bit architectures. ok visa@
2017-04-16Define DEF_WEAK like we do for ld.so to fix building this with clang.kettenis1-1/+2
ok millert@, deraadt@
2017-04-16Move comments into a block and uses {} to unconfuse reading.deraadt1-12/+13
2017-04-16Use %zu to print a size_t.kettenis1-2/+2
2017-04-16Remove unused rnd_seed variable. Upstream made the same change 4 days ago.kettenis1-3/+0
Fixes compiling this test using clang on arm64.
2017-04-16backout previous, data_len is not always initializedotto1-2/+5
2017-04-14Use freezero(3) when cleaning up session tickets - not only does it requirejsing1-6/+3
less code, but there is also a potential performance gain since they can be larger allocations.
2017-04-14Use freezero(3) to clean up the X25519 keys - simpler, cleaner code.jsing1-6/+3
2017-04-14Use freezero(3) in the CBB clean up path, since this could hold sensitivejsing1-3/+2
information (such as master keys).
2017-04-14Switch i2d_SSL_SESSION() back to freezero(3) now that the size constraintsjsing1-5/+2
have been relaxed.
2017-04-14Clean up server key exchange EC point handling. Encode the point directlyjsing1-27/+15
into the CBB memory, rather than mallocing and memcpying, which also makes makes the code more consistent with the client. Add a missing check for the first EC_POINT_point2oct() call. ok beck@
2017-04-13allow clearing less than allocated and document freezero(3) betterotto2-13/+26
2017-04-12New strstr() implementation from musl libc by Rich Felker. Thismillert1-44/+180
version uses the two-way string matching algorithm and is faster than the old implementation. With this change, ports that check for strstr having linear complexity time strstr will no longer replace the libc strstr with a private version. OK deraadt@ espie@
2017-04-11Revert ssl_asn1.c r1.50 - CBB and freezero(3) do not play nicely together.jsing1-2/+5
Back this out while we investigate and implement a solution. Found the hard way by sthen@
2017-04-10new X25519(3) manual page;schwarze5-10/+113
from Dr. Stephen Henson <steve@openssl.org>, OpenSSL commit d218f3c3
2017-04-10Use freezero() for the internal opaque structures, instead of the currentjsing3-18/+9
explicit_bzero()/free(). Less code and potentially less overhead.
2017-04-10Use freezero() for X25519 keys - same result with more readable code.jsing1-7/+3
2017-04-10document three additional functions;schwarze1-7/+60
from Emilia Kasper <emilia at openssl dot org>, OpenSSL commit 4ac139b4
2017-04-10Rework and significantly extend TLS name verification tests to matchjsing1-99/+377
changes in libtls.
2017-04-10Rework name verification code so that a match is indicated via an argument,jsing5-47/+76
rather than return codes. More strictly follow RFC 6125, in particular only check the CN if there are no SAN identifiers present in the certificate (per section 6.4.4). Previous behaviour questioned by Daniel Stenberg <daniel at haxx dot se>. ok beck@ jca@
2017-04-10freezero() the key block; simpler code and less of it.jsing1-7/+3
2017-04-10Use freezero() for i2d_SSL_SESSION() - one line of code instead of three.jsing1-5/+2
In this case the memory allocated can also be significant, in which case freezero() will have less overhead than explicit_bzero() (munmap instead of touching all of the memory to write zeros).
2017-04-10fix some .Xr errors that jmc@ found with mdoclint(1)schwarze3-12/+13