summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/recallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-03-17Partially clean up the TLS1_get_{,client}_version macros.jsing4-15/+14
LibreSSL only supports TLSv1.0 and above, hence the checks the macros are performing are useless. Simplify them to their effective code. Also place both under #ifndef LIBRESSL_INTERNAL and use the variables directly in our code, which improves readability. ok tb@
2019-03-17Remove the alert level from the TLSv1.3 alert callback.jsing3-7/+6
In TLSv1.3 the alert level is effectively meaningless and the record layer has already checked that it is appropriate. As such, drop it from the alert callback. ok tb@
2019-03-15Document the return values of X509_delete_ext(3) and X509_add_ext(3).schwarze1-11/+15
From Viktor Dukhovni via OpenSSL commit 0df65d82 Jun 12 11:51:53 2018 -0400 which is still under a free license because it is before the 1.1.1 branch point. While here, add several missing const qualifiers.
2019-03-15OpenSSL documents the macro OPENSSL_VERSION_TEXT since Sep 24, 2018;schwarze1-4/+7
so mention it here, too.
2019-03-15Document OCSP_basic_verify(3).schwarze1-5/+75
From David dot von dot Oheimb at siemens dot com via OpenSSL commit b8c32081 Feb 10 15:45:11 2018 +0100, which is still under a free license because it is before the 1.1.1 branch point.
2019-03-13Fix a number of ASN1_INTEGER vs ASN1_STRING mixups coming from thetb5-13/+11
mechanical M_ASN1 macro expansion. The ASN1_INTEGER_cmp function takes signs into account while ASN1_STRING_cmp doesn't. The mixups mostly involve serialNumbers, which, in principle, should be positive. However, it is unclear whether that is checked or enforced anywhere in the code, so these are probably bugs. Patch from Holger Mikolon ok jsing
2019-03-13add a comment to format-pem.pl documenting typical steps to updatesthen1-1/+9
cert.pem from Mozilla NSS.
2019-03-13Backport support for probing ARMv8 HW acceleration capabilities on armv7patrick3-32/+121
in preparation for adding support for the probing code for arm64. ok bcook@
2019-03-10fix some cases of spaces before full stops, where none were neccessary;jmc1-3/+3
2019-03-10rename CRYPTO_set_locking_callback.3 to CRYPTO_lock.3schwarze2-4/+4
because CRYPTO_set_locking_callback() is now a no-op and was never documented in the first place; no text change; requested by jmc@ long ago
2019-03-10delete functions from the manual page that do nothing in LibreSSLschwarze3-318/+87
and that don't do anything in OpenSSL either; no significant amount of text remains from OpenSSL, so change the Copyright information and license of CRYPTO_set_locking_callback.3; OK inoguchi@ jmc@
2019-03-06Typo in comment.tb1-2/+2
From Holger Mikolon
2019-03-04Don't index a void pointer, fixes compilation with visual studio.millert1-2/+3
Gcc/clang will treat void * as char * but this is non-standard. OK deraadt@ jsing@ inoguchi@
2019-03-02Fix OID for sm3WithRSAEncryption which was apparently mixed uptb1-1/+1
with the OID for SM2 signing with SM3. From Daniel Wyatt
2019-02-28Implement non-SSL_MODE_ENABLE_PARTIAL_WRITE in tls13_legacy_write_bytes().jsing1-3/+34
In non-SSL_MODE_ENABLE_PARTIAL_WRITE mode we have to write out all the things and only return success once all of the data has been sent. ok inoguchi@ tb@
2019-02-28Automatically complete the handshake from tls13_legacy_{read,write}_bytes()jsing3-3/+17
If the TLS handshake has not been completed, automatically complete the handshake as part of the read/write call, implementing the current SSL_read()/SSL_write() behaviour. Once the TLS handshake is completed we push a WANT_POLLIN or WANT_POLLOUT back up to the caller, since some applications appear to incorrectly call SSL_read() or SSL_write(), rather than repeating the previous call. This can lead to attempts to read data that does not exist, since the WANT_POLLIN was actually triggered as part of the handshake. ok inoguchi@ tb@
2019-02-28Set the SSL state as part of tls13_legacy_connect().jsing1-2/+5
Set the SSL state to SSL_ST_CONNECT during the TLSv1.3 handshake and to SSL_ST_OK once the handshake completes, since some applications currently rely on this information to function correctly. ok inoguchi@ tb@
2019-02-28Add appropriate length checks to tls13_legacy_{read,write}_bytes()jsing1-3/+9
ok inoguchi@ tb@
2019-02-28Remove unused record_type from TLSv1.3 handshake actions.jsing1-16/+1
ok tb@
2019-02-26Correct return values for non-fatal alerts.jsing1-3/+3
In the close notify case we need to signal EOF and in the user cancelled case we need to return WANT_POLLIN. Returning success results in tls13_record_layer_read_record() thinking that we have record data when we do not, which then results in the content type check later failing. ok tb@
2019-02-26Correctly propagate EOF from BIO in tls13_legacy_wire_read().jsing1-1/+3
ok tb@
2019-02-26Correctly handle tls_read() and tls_write() failures.jsing1-5/+9
Otherwise a TLS error (for example the remote end sent a fatal alert) is silently ignored. ok bluhm@ tb@
2019-02-25Fix gcc3 compilation error by using a forward declaration instead of atb1-3/+3
repeated typedef. Found the hard way by aoyama who also tested the fix. ok jsing
2019-02-25revert "Move struct ssl_handshake_tls13_st definition", i.e., movetb2-24/+26
SSL_HANDSHAKE_TLS13 back to ssl_locl.h. discussed with jsing and inoguchi
2019-02-25Correctly handle oversize writes.jsing1-2/+4
If the record layer is asked to write more than fits in a plaintext record, cap the amount at that limit. This means that we will effectively write out a single record and return a short-write. This behaviour matches SSL_write() with SSL_MODE_ENABLE_PARTIAL_WRITE enabled and the non-SSL_MODE_ENABLE_PARTIAL_WRITE case will be handled at a higher layer. ok inoguchi@ tb@
2019-02-25Add a handshake action sent handler and use it for client finished.jsing3-11/+22
The write traffic key needs to be changed to the client application traffic key after the client finished message has been sent. The send handler generates the client finished message, however we cannot switch keys at this stage since the client finished message has not yet been protected by the record layer. ok tb@
2019-02-25Correct a few error returns.jsing1-4/+4
2019-02-25Move struct ssl_handshake_tls13_st definitioninoguchi2-26/+24
This solves build error on luna88k with gcc3. ok aoyama@ jca@ jsing@ tb@
2019-02-23Remove temporary gotos.jsing1-7/+3
In the case of a dummy CCS or post-handshake handshake message, return TLS13_WANT_POLLIN rather than using a goto internally. This allows the caller to retry at an appropriate time and reduces the complexity within the record layer. ok beck@ tb@
2019-02-23Set BIO retry on TLS13_IO_WANT_POLLIN/TLS13_IO_WANT_POLLOUT.jsing1-1/+3
In most cases a TLS13_IO_WANT_POLLIN or TLS13_IO_WANT_POLLOUT will have bubbled up from the wire callbacks, in which case the BIO retry flag will already be set. However, if we return TLS13_IO_WANT_POLLIN or TLS13_IO_WANT_POLLOUT from a higher layer the BIO retry flag will not be set and that will cause SSL_get_error() to return SSL_ERROR_SYSCALL rather than the intended SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE. ok beck@ tb@
2019-02-21Test that all supported TLS ciphers actually work. Establishbluhm8-26/+308
connections between client and server implemented with LibreSSL or OpenSSL with a fixed cipher on each side. Check the used cipher in the session print out.
2019-02-21Wire up alert handling for TLSv1.3.jsing2-9/+78
In TLSv1.3 there are two types of alerts "closure alerts" and "error alerts". This makes the record layer more strict and handles closure of the read and write channels. The callback then handles the record layer to SSL mapping/behaviour. ok tb@
2019-02-21Change the alert callback return type from int to void.jsing2-9/+11
There is nothing for the handler to really signal, since it cannot change the fact that we received an alert. While here use TLS13_IO_FAILURE instead of hardcoding -1. ok tb@
2019-02-21Fix a few cases where int was used instead of ssize_t.jsing1-3/+3
2019-02-17Convert openssl(1) pkeyutl to the newer style of option handling.inoguchi1-198/+278
ok jsing@ tb@
2019-02-16Add tests for pkeyutlinoguchi1-6/+46
2019-02-14Correct guards.jsing1-3/+3
2019-02-14Notify the record layer upon handshake completion.jsing1-2/+4
ok tb@
2019-02-14Switch to application traffic keys as appropriate.jsing1-1/+17
Switch the read traffic key to the server application traffic key once the server finished message has been processed. Switch the write traffic key to the client application traffic key after sending the client finished message. ok tb@
2019-02-14Split tls13_record_layer_set_traffic_keys() into two separate functions.jsing3-17/+23
This allows the read traffic key to be set independently of the write traffic key. This will become necessary for KeyUpdate handling, however also allows for switching to application traffic keys at more appropriate stages of the handshake. ok tb@
2019-02-14Provide a TLS 1.3 capable client method.jsing3-5/+50
ok tb@
2019-02-13one more error message that should go to stderrtb1-2/+3
2019-02-13Clean up some pesky trailing whitespace.jsing1-10/+10
2019-02-13Handle finished messages in TLSv1.3 client.jsing2-14/+131
This adds support for processing of the server finished message and generation of the client finished message. ok tb@
2019-02-13New futex(2) based rwlock implementation based on the mutex code.mpi1-1/+12
This implementation reduces contention because threads no longer need to spin calling sched_yield(2) before going to sleep. Tested by many, thanks! ok visa@, pirofti@
2019-02-13Xr the byteorder funcs; from tim kuijstenjmc1-3/+4
2019-02-11Implement handling of Certificate and CertificateVerify messages.jsing2-31/+214
This allows the TLS 1.3 client to process the certificates that the server has sent and verify that the server has possession of the private key. ok tb@
2019-02-11getopt(3) returns int, not char. Fix type of ch variable to preventbluhm2-6/+6
sign error during arm regress.
2019-02-10"non-existant" is one of those words that don't exist, so use "non-existent"phessler1-2/+2
instead From Pamela Mosiejczuk, many thanks! OK phessler@ deraadt@
2019-02-10Preserve the transcript hash at specific stages of the TLSv1.3 handshake.jsing2-2/+16
There are various points where we need the hash of all messages prior to the current message. Support this by having the handshake code preserve the transcript hash prior to recording the current message, which avoids the need to sprinkle this throughout multiple handlers. ok inoguchi@ tb@