summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-01-23Pass a CBB to TLSv1.3 send handlers.Joel Sing
This avoids the need for each send handler to call tls13_handshake_msg_start() and tls13_handshake_msg_finish(). ok beck@ tb@
2020-01-22The length of the IV of EVP_chacha20 is currently 64 bits, not 96.Theo Buehler
ok beck
2020-01-22Wire up the TLSv1.3 server.Joel Sing
This currently only has enough code to handle fallback to the legacy TLS stack for TLSv1.2 or earlier, however allows for further development and testing. ok beck@
2020-01-22Pass a handshake message content CBS to TLSv1.3 receive handlers.Joel Sing
This avoids every receive handler from having to get the handshake message content itself. Additionally, pull the trailing data check up so that each receive handler does not have to implement it. This makes the code more readable and reduces duplication. ok beck@ tb@
2020-01-22Fix things so that `make -DTLS1_3` works again.Joel Sing
2020-01-22Send alerts on certificate verification failures of server certsBob Beck
ok tb@
2020-01-22Rename failure into alert_desc in tlsext_ocsp_server_parse().Theo Buehler
2020-01-22fix previous: alert_desc needs to be an int.Theo Buehler
2020-01-22Avoid modifying alert in the success path.Theo Buehler
ok beck jsing
2020-01-22Enable the TLSv1.3 client in libssl.Joel Sing
This also makes it available to clients that use libtls, including ftp(1) and nc(1). Note that this does not expose additional defines via public headers, which means that any code conditioning on defines like TLS1_3_VERSION or SSL_OP_NO_TLSv1_3 will not enable or use TLSv1.3. This approach is necessary since too many pieces of software assume that if TLS1_3_VERSION is available, other OpenSSL 1.1 API will also be available, which is not necessarily the case. ok beck@ tb@
2020-01-22Correct includes check for libtls.Joel Sing
2020-01-22Add checks to ensure that lib{crypto,ssl,tls} public headers have actuallyJoel Sing
been installed prior to building. Requested by and ok tb@
2020-01-22delete wasteful ;;Theo de Raadt
ok tedu
2020-01-22Move guards from public to internal headers, and fix not use values.Bob Beck
reverts previous attempt which would have broken ports ok jsing@
2020-01-22Simplify header installation by combining the HDRS and HDRS_GEN loops.Joel Sing
ok beck@
2020-01-22Note in the man page that the default protocols list includes 1.3Bob Beck
ok jsing@
2020-01-22Enable TLS version 1.3 in the default protocols for libtls.Bob Beck
This will as yet not do anything, until we turn it on in the lower level libraries. ok jsing@
2020-01-22Implement support for SSL_peek() in the TLSv1.3 record layer.Joel Sing
ok beck@ tb@
2020-01-22After the ClientHello has been sent or received and before the peer'sTheo Buehler
Finished message has been received, a change cipher spec may be received and must be ignored. Add a flag to the record layer struct and set it at the appropriate moments during the handshake so that we will ignore it. ok jsing
2020-01-22Correctly set the legacy version when TLSv1.3 is building a client hello.Joel Sing
The legacy version field is capped at TLSv1.2, however it may be lower than this if we are only choosing to use TLSv1.0 or TLSv1.1. ok beck@ tb@
2020-01-22Don't add an extra unknown error if we got a fatal alertBob Beck
ok jsing@
2020-01-22The legacy_record_version must be set to TLS1_2_VERSION exceptTheo Buehler
in the ClientHello where it may be set to TLS1_VERSION. Use the minimal supported version to decide whether we choose to do so or not. Use a sent hook to set it back TLS1_2_VERSION right after the ClientHello message is on the wire. ok beck jsing
2020-01-22Hook up the TLSv1.3 legacy shutdown code.Joel Sing
Missed in an earlier commit.
2020-01-22Add minimal support for hello retry request for RFC conformance.Bob Beck
We currently don't support sending a modified clienthello ok jsing@ tb@
2020-01-22Split the TLSv1.3 guards into separate client and server guards.Joel Sing
ok beck@ tb@
2020-01-22Implement close-notify and SSL_shutdown() handling for the TLSv1.3 client.Joel Sing
ok beck@ inoguchi@ tb@
2020-01-21Correct legacy fallback for TLSv1.3 client.Joel Sing
When falling back to the legacy TLS client, in the case where a server has sent a TLS record that contains more than one handshake message, we also need to stash the unprocessed record data for later processing. Otherwise we end up with missing handshake data. ok beck@ tb@
2020-01-21Remove redundant ASN1_INTEGER_set call in PKCS7_set_typeKinichiro Inoguchi
ok bcook@
2020-01-21Provide SSL_R_UNKNOWN.Joel Sing
This allows us to indicate that the cause of the failure is unknown, rather than implying that it was an internal error when it was not. ok beck@
2020-01-21Clear and free the tls13_ctx that hangs off an SSL *s fromTheo Buehler
SSL_{clear,free}(3). Make sure the handshake context is cleaned up completely: the hs_tls13 reacharound is taken care of by ssl3_{clear,free}(3). Add a missing tls13_handshake_msg_free() call to tls13_ctx_free(). ok beck jsing
2020-01-21Add alert processing in tls client code, by adding alert to theBob Beck
tls13 context, and emiting the alert at the upper layers when the lower level code fails ok jsing@, tb@
2020-01-20Add alerts to the tls 1.3 record layer and handshake layerBob Beck
ok jsing@, inoguchi@, tb@
2020-01-20Provide an error framework for use with the TLSv1.3 code.Joel Sing
This is based on the libtls error handling code, but adds machine readable codes and subcodes. We then map these codes back to libssl error codes. ok beck@ inoguchi@
2020-01-20Add support for TLSv1.3 as a protocol to libtls.Joel Sing
This makes tls_config_parse_protocols() recognise and handle "tlsv1.3". If TLSv1.3 is enabled libtls will also request libssl to enable it. ok beck@ tb@
2020-01-17Free pss in RSA_freeKinichiro Inoguchi
ok bcook@ ok and "move it down two lines" jsing@
2020-01-14bump to 3.1.0Brent Cook
2020-01-13Document how to make getopt_long(3) process arguments in order and stopStefan Sperling
at the first non-option argument. I had to read source code to figure it out.
2020-01-12Avoid leak in error path of PKCS5_PBE_keyivgenKinichiro Inoguchi
ok jsing@ tb@
2020-01-09Avoid leak in error path of asn1_parse2Kinichiro Inoguchi
ok tb@
2020-01-04Avoid leak in error path of dh_priv_decodeKinichiro Inoguchi
ok jsing@ tb@
2020-01-02In ssl.h rev. 1.167 and s3_lib.c rev. 1.188, jsing@ providedIngo Schwarze
the new function SSL_CTX_get_extra_chain_certs_only(3) and changed the semantics of the existing SSL_CTX_get_extra_chain_certs(3) API from the former OpenSSL 1.0.1 behaviour to the new, incompatible OpenSSL 1.0.2 behaviour. Adjust the documentation. OK jsing@ beck@ inoguchi@
2020-01-02Revise SSL_CTX_get_extra_chain_certs() to match OpenSSL behaviour.Joel Sing
In OpenSSL, SSL_CTX_get_extra_chain_certs() really means return extra certs, unless there are none, in which case return the chain associated with the certificate. If you really just want the extra certs, including knowing if there are no extra certs, then you need to call SSL_CTX_get_extra_chain_certs_only()! And to make this even more entertaining, these functions are not documented in any OpenSSL release. Reported by sephiroth-j on github, since the difference in behaviour apparently breaks OCSP stapling with nginx. ok beck@ inoguchi@ tb@
2020-01-02Provide TLSEXT_TYPE_* aliases for TLS 1.3.Joel Sing
OpenSSL decided to use their own names for two of the TLS 1.3 extensions, rather than using the names given in the RFC. Provide aliases for these so that code written to work with OpenSSL also works with LibreSSL (otherwise everyone gets to provide their own workarounds). Issue noted by d3x0r on github. ok inoguchi@ tb@
2019-12-31Increase BER_MAX_OID_LEN from 32 to 64. Not every snmp OID found in theMartijn van Duren
wild fits inside 32 elements, like UsmUserEntry objects. OK rob@, claudio@
2019-12-26It is believed that an implementation of madvise was available inJonathan Gray
SunOS 4.0 based on text from the following papers. "Two 4.2BSD system calls, madvise and mincore, remain unspecified, madvise is intended to provide information to the system to influence its management policies. Since a major rework of such policies was deferred to a future release, we decided to defer full specification and implementation of madvise until that time." R. Gingell, J. Moran, W. Shannon "Virtual Memory Architecture in SunOS" Proceedings of USENIX Summer Conference, June 1987 AUUGN Volume 8 Number 5, October 1987 "Memory management related system calls based on the original 4.2BSD specification that were implemented include mmap, munmap, mprotect, madvise, and mincore." J. Moran "SunOS Virtual Memory Implementation" Proceedings of the Spring 1988 European UNIX Users Group Conference, April 1988 AUUGN Volume 9 Number 3, June 1988 and a reference in "Global Index", Part Number: 800-1758-10, Revision A, of 9 May 1988 bitsavers pdf/sun/sunos/4.0/800-1758-10A_Global_Index_198805.pdf discussed with an ok schwarze@
2019-12-21a few depend:-related thingies that were still in.Marc Espie
okay millert@, tb@
2019-12-21Warn that auth_call(3) users should include a "--" argument beforeJonathan Gray
non-optional arguments to stop getopt(3) processing. ok deraadt@
2019-12-21In "4.2BSD System Manual" (/usr/doc/sysman in 4.2BSD source)Jonathan Gray
mmap(), munman(), madvise() and mprotect() are described as planned for later releases. A fully functional mmap(2) supporting shared libraries first appeared in SunOS 4.0 along with msync(2). SunOS 4.1 added madvise(3) and replaced msync(2) with mctl(2) which was was used to implement msync(3), mlock(3) and munlock(3). While some of these functions appear as empty or ifdef'd functions in 4.1cBSD and later it was not until the Mach VM was integrated with Net/2 that most of them were implemented. Though the CSRG releases never supported shared libraries or madvise(). mlock()/munlock() were not in Net/2 as they were added by hibler in 1993, but were in 4.4BSD. madvise(2) was implemented for UVM in NetBSD 1.5 and ported to OpenBSD 2.7. For now instead of trying to accurately describe when interfaces first appeared in other systems correct when they were first available in CSRG or OpenBSD releases, retaining the text in mmap(2) discussing SunOS 4.0. madvise(2) 4.4BSD -> OpenBSD 2.7 mmap2(2) 4.4BSD -> 4.3BSD Net/2 mprotect(2) 4.4BSD -> 4.3BSD Net/2 msync(2) 4.4BSD -> 4.3BSD Net/2 munmap(2) 4.1cBSD -> 4.3BSD Net/2
2019-12-20drand48(3) returns values in [0.0, 1.0).Theo Buehler
From j@bitminer.ca with input from Andras Farkas, deraadt, joerg@netbsd "fix however you feel best!" jmc
2019-12-20The mcount.po target is special cased here since mcount.c should not beTheo Buehler
compiled with pie or profiling enabled. This was missed when the independent depend target was removed. Align this target with the inference rules in bsd.lib.mk. This now creates mcount.d as it should and fixes 'make clean' which previously left mcount.po.d behind. ok guenther