summaryrefslogtreecommitdiff
path: root/lib/libtls
AgeCommit message (Collapse)Author
2015-08-27Improve libtls error messages.Joel Sing
The tls_set_error() function previously stored the errno but did nothing with it. Change tls_set_error() to append the strerror(3) of the stored errno so that we include useful information regarding failures. Provide a tls_set_errorx() function that does not store the errno or include strerror(3) in the error message. Call this function instead of tls_set_error() for errors where the errno value has no useful meaning. With feedback from and ok doug@
2015-08-27Split the persistent/configuration flags from temporary state flags andJoel Sing
ensure that the temporary state flags get cleared in tls_reset(). Fixes a bug spotted by Marko Kreen whereby TLS_CONNECTING could remain on reset. While here, also move the TLS_STATE_CONNECTING check to after the TLS_CLIENT check - if TLS_STATE_CONNECTING was ever set on any other context type it would allow a bypass. ok bluhm@
2015-08-27Make functions that are internal to tls verify static.Joel Sing
Spotted by Marko Kreen. Rides libtls major bump.
2015-08-27Crank major version for libssl and libtls due to SSLv3 removal.Doug Hogan
2015-08-22Unify error message between client and server.Joel Sing
2015-08-22SSL_set_app_data is a macro for SSL_set_ex_data(), which is a wrapperJoel Sing
around CRYPTO_set_ex_data(), which can fail. Since this is the case, check the return value of CRYPTO_set_ex_data^WSSL_set_ex_data^WSSL_set_app_data.
2015-08-22Store a reference to the libtls context in the SSL client connection appJoel Sing
data (as is already done for server connections). From Marko Kreen.
2015-08-22Make tls_read()/tls_write always set outlen to zero on error - this gotJoel Sing
broken by r1.4. Spotted by Marko Kreen.
2015-07-19Remove OpenSSL engine RSAX.Doug Hogan
OpenSSL stopped building it last year and removed it this year. Based on OpenSSL commit c436e05bdc7f49985a750df64122c960240b3ae1. Also cranked major version in libcrypto, libssl and libtls. "fine with me" bcook@ miod@
2015-07-19tweak previous; ok dougJason McIntyre
2015-07-19Crank the major of libtls: the behaviour of tls_write() has beenReyk Floeter
changed in an incompatible way regarding partial writes. OK miod@ deraadt@
2015-07-19Add documentation on how to use TLS_{READ,WRITE}_AGAIN.Doug Hogan
ok beck@
2015-07-18Set SSL_MODE_ENABLE_PARTIAL_WRITE and SSL_MODE_ACCEPT_MOVING_WRITE_BUFFERAlexander Bluhm
in libtls. This gives tls_write() a similar short write semantics as write(2). So implementing daemons with libevent buffers will be easier and workarounds in syslogd and httpd can be removed. OK tedu@ beck@ reyk@
2015-06-20Crank major for libcrypto, ssl and tls due to MDC-2DES removal.Doug Hogan
ok miod@ jsing@
2015-06-19Add standard headers, C++ support to tls.h.Brent Cook
This makes using libtls easier to include by including dependent headers, making something like this work as expected: #include <iostream> #include <tls.h> int main() { std::cout << "tls_init: " << tls_init() << "\n"; } This also makes building a standalone libtls-portable simpler. ok doug@, jsing@
2015-06-05Link ssl and crypto via BSDOBJDIR, works with native and cross buildsTobias Ulmer
ok mpi@
2015-05-17*** empty log message ***Mark Kettenis
2015-04-29Reject dNSName of " " for subjectAltName extension.Doug Hogan
RFC 5280 says " " must not be used as a dNSName. ok jsing@ jca@
2015-04-15Treat SSL_ERROR_ZERO_RETURN as a success, rather than a failure. AlsoJoel Sing
ensure that outlen is set to zero so that tls_read() has read(2) like semantics for EOF. Spotted by doug@
2015-04-15Make tls_close() more robust - do not rely on a close notify being receivedJoel Sing
from the other side and only return TLS_READ_AGAIN/TLS_WRITE_AGAIN if we failed to send a close notify on a non-blocking socket. Otherwise be more forceful and always shutdown/close the socket regardless of other failures. Also do not consider ENOTCONN or ECONNRESET to be a shutdown failure, since there are various situations where this can occur. ok doug@ guenther@
2015-04-03comma fix;Jason McIntyre
2015-04-02Handle the case where multiple calls to SSL_shutdown() are required toJoel Sing
close the connection. Also correctly handle the error on failure. Diff from cookieandscream via github.
2015-04-02Correct man page title.Joel Sing
Diff from Tim van der Molen. ok jmc@
2015-04-02Document the fact that the tls_accept_*() functions can returnJoel Sing
TLS_READ_AGAIN and TLS_WRITE_AGAIN. Based on a diff from Tim van der Molen.
2015-03-31Bump libtls minor due to API addition.Joel Sing
2015-03-31Provide a tls_accept_fds() function, which allows a TLS connection to beJoel Sing
accepted via an existing pair of file descriptors. Based on a diff from Jan Klemkow.
2015-03-31Store errors that occur during a tls_accept_socket() call on the contextJoel Sing
for the server, rather than on the context for the connection. This makes more sense than the current behaviour does. Issue reported by Tim van der Molen.
2015-03-21free the server certificate in tls_connect_fds(); fixes a memory leak withStuart Henderson
repeated use of tls_connect. ok jsing
2015-02-26Prefix function parameter names with underscores in tls.h, since this makesJoel Sing
them guaranteed to not conflict per POSIX. ok espie@ guenther@
2015-02-22Bump libtls major due to symbol removal.Joel Sing
2015-02-22Rename tls_config_insecure_noverifyhost() toJoel Sing
tls_config_insecure_noverifyname(), so that it is more accurate and keeps inline with the distinction between DNS hostname and server name. Requested by tedu@ during s2k15.
2015-02-22Check return values when setting dheparams and ecdhecurve for the defaultJoel Sing
configuration.
2015-02-22In the interests of being secure by default, make the default TLS ciphersJoel Sing
be those that are TLSv1.2 with AEAD and PFS. Provide a "compat" mode that allows the previous default ciphers to be selected. Discussed with tedu@ during s2k15.
2015-02-21explain how tls_accept_socket works.Ted Unangst
2015-02-21tls_config_set_protocols is really void. Greg Martin.Ted Unangst
2015-02-21fill out docs a bit more, notably the read/write again behaviors.Ted Unangst
ok jsing
2015-02-15s/tls_load_keys/tls_load_file/Joel Sing
2015-02-15Document tls_config_parse_protocols() and update documentation forJoel Sing
tls_config_set_protocols().
2015-02-12bump minor for TLS_PROTOCOLS_ALL. OK jsing@Reyk Floeter
2015-02-12Add a tls_config_parse_protocols() function that allows a protocols stringJoel Sing
to be converted into a libtls protocols value. This allows for things like: "tlsv1.0,tlsv1.1" (TLSv1.0 and TLSv1.1) "all,!tlsv1.0" (all protocols except TLSv1.0) Discussed with tedu@ and reyk@
2015-02-12Fix handling of "legacy" mode for tls_config_set_dheparams().Joel Sing
Found by reyk@
2015-02-12Change TLS_PROTOCOLS_DEFAULT to be TLSv1.2 only. Add a TLS_PROTOCOLS_ALLJoel Sing
that includes all currently supported protocols (TLSv1.0, TLSv1.1 and TLSv1.2). Change all users of libtls to use TLS_PROTOCOLS_ALL so that they maintain existing behaviour. Discussed with tedu@ and reyk@.
2015-02-11Provide a tls_connect_servername() function that has the same behaviourJoel Sing
as tls_connect(), however allows the name to use for verification to be explicitly provided, rather than being inferred from the host value. Requested by reyk@ ok reyk@ tedu@
2015-02-11Be consistent with naming - only use "host" and "hostname" when referringJoel Sing
to an actual host and use "servername" when referring to the name of the TLS server that we expect to be indentified in the server certificate. Likewise, rename verify_host to verify_name and use the term "name" throughout the verification code (rather than host or hostname). Requested by and ok tedu@
2015-02-09When parsing the host in tls_connect(), first check if it is a numericReyk Floeter
IPv4 or IPv6 address before trying to resolve the address with the AI_ADDRCONFIG flag set. This makes sure that attempts to connect to numeric IPs or loopback addresses are always possible and not prevented by AI_ADDRCONFIG. OK jsing@ tedu@
2015-02-08Use the AI_ADDRCONFIG flag in tls_connect(). This tells the resolverReyk Floeter
to ignore unsupported address families - eg. don't resolv IPv6 on IPv4-only hosts. OK jsing@
2015-02-07Added tls_load_file()Reyk Floeter
2015-02-07Add manpage bits for tls_load_file() and tls_accept_socket().Reyk Floeter
The tls_accept_socket() has been previously removed because the API is not fixed yet; but it is also already used by httpd(8) and spamd(8) so it is time to add it again and eventually change it later. OK tedu@
2015-02-07Add tls_load_file() as a helper to load certificates or encrypted keysReyk Floeter
into memory. This can be used for tls_config_set_ca_mem(), tls_config_set_cert_mem() or tls_config_set_key_mem(). With input from jsing@, tedu@ and henning@ OK tedu@
2015-02-07Convert tls_connect_fds() and tls_accept_socket() to the new OpenSSL errorJoel Sing
dance handling code. This means that we get slightly useful messages when a TLS connection or accept fails. Requested by reyk@