summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/reallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-05-13Add -tls1_3 and -no_tls1_3 options to openssl(1) s_serverinoguchi1-6/+28
- Add -tls1_3 and -no_tls1_3 to openssl(1) s_server - Stop using version pinned methods, instead setting the min and max protocol versions ok jsing@ tb@
2020-05-12there should only be one i in gratuitoustb1-3/+3
2020-05-11Revise regress for TLSv1.3 server being enabled.jsing4-14/+17
2020-05-11Enable the TLSv1.3 server.jsing1-1/+5
ok beck@ tb@
2020-05-11Use tls_legacy_server_method() for SSLv2 record tests.jsing2-5/+7
2020-05-11Revise regress now that record overflows are propagated.jsing1-2/+2
2020-05-11Propagate record overflows to the record layer and alert.jsing3-6/+8
ok beck@ tb@
2020-05-11Add record version checks.jsing3-18/+28
When legacy version is below TLSv1.2 ensure that the record version is SSL3/TLS, however when the legacy version is set to TLSv1.2 require this specifically. ok beck@ tb@
2020-05-11Set the record layer legacy version from the TLSv1.3 server.jsing1-1/+5
This will be used to handle record version checks. ok tb@
2020-05-11Provide an alert sent record layer callback.jsing4-8/+29
Use this to push an error on to the SSL error stack so that we report the details of the alert that we sent, rather than failing with an unknown error. ok tb@
2020-05-11Move the record layer callbacks into a struct.jsing3-35/+33
This makes the code more readable, requires less code churn when adding a new callback and is likely to avoid bugs due to function argument ordering. ok beck@ inoguchi@ tb@
2020-05-11Use ssl_get_new_session() in the TLSv1.3 server.jsing1-4/+3
This correctly handles session being non-NULL and sets up a few more things, including ssl_version. Also stop setting the ssl_version to the server_version, as this is only used on the client side. ok tb@
2020-05-10Make openssl X509 handle the failure case return code from X509_time_cmp.beck1-5/+16
While we are in here also make it notice if time values in a certificate are bogus, and say so in the output. ok bcook@ jsing@
2020-05-10Send dummy ChangeCipherSpec messages from the TLSv1.3 servertb3-3/+41
If the client has requested middle box compatibility mode by sending a non-empty legacy_session_id, the server must send a dummy CCS right after its first handshake message. This means right after ServerHello or HelloRetryRequest. Two important improvements over the backed-out diffr: make sure that First: client and server can send their dummy CCS at the correct moment (right before the next flight or right after the current flight). Second: as jsing noted, we also need to deal with the corner case that tls13_send_dummy_ccs() can return TLS13_IO_WANT_POLLOUT. with/ok jsing
2020-05-10Honour SSL_VERIFY_FAIL_IF_NO_PEER_CERT in the TLSv1.3 server.jsing3-8/+16
ok beck@
2020-05-10Provide alert defines for TLSv1.3 and use in the TLSv1.3 code.jsing7-65/+97
Rather than using a mess of SSL_AL_*, SSL_AD_*, SSL3_AD_* and TLS1_AD_* defines, provide our own TLS13_ALERT_* defines and use those. This also provides the alerts that are new to TLSv1.3. ok beck@
2020-05-10Conditionalize sleep-before-retry in server code to only be done whenbeck1-3/+5
debug is on. otherwise, just retry. Fixes problems this creates in testing. ok jsing@ tb@
2020-05-10Provide an easy way to get debug information from TLSv1.3 handshakes.jsing2-3/+61
This makes it easier to debug TLSv1.3 handshake failures. "Yes please!" tb@, ok beck@
2020-05-10Use size_t for OCSP response length.jsing8-27/+35
The OCSP response length is currently an integer, which is overloaded with -1 meaning "unset". Use a size_t for the OCSP response length and infer unset from the OCSP response being NULL. This makes code more readable, simpler and less error prone. ok beck@
2020-05-10Only reset TLS extension state when parsing client hello or server hello.jsing1-5/+7
With TLSv1.3 we end up parsing extensions from more than just these two messages. This can result in variables (like the selected alpn) being freed when things still need them. ok tb@
2020-05-10Correct tlsext_ocsp_resplen check.jsing1-2/+2
This variable is currently overloaded - a value of -1 means that it is "unset" and any other value is a length. ok tb@
2020-05-09Back out server side CCS sending. It breaks TLSv1.3 client communicationtb3-34/+3
with TLSv1.2 servers, since it makes clients send their dummy CCS too early... There's an obvious but dirty bandaid which I can't bring myself to applying - this business is already disgusting enough. Issue found the hard way by sthen
2020-05-09Forcibly ensure that only PSS may be used with RSA in TLS 1.3.beck1-2/+8
This prevents us from incorrectly choosing a PKCS1 based signature if the client advertises support for them but also prefers them to PSS such as appears to be the case with gnuTLS. ok jsing@
2020-05-09Send dummy ChangeCipherSpec messages from the TLSv1.3 servertb3-3/+34
If the client has requested middle box compatibility mode by sending a non-empty legacy_session_id, the server must send a dummy CCS right after its first handshake message. This means right after ServerHello or HelloRetryRequest. ok jsing
2020-05-09Send dummy ChangeCipherSpec messages from the TLSv1.3 client.jsing4-6/+45
When operating in middlebox compatibility mode, the TLSv1.3 client needs to send a dummy ChangeCipherSpec message immediately before its second flight of handshake messages (when early data is not offered). ok tb@
2020-05-09Correct return value check to handle TLS13_IO_EOF case.jsing1-2/+2
2020-05-09Add a middlebox_compat flag and condition session ID randomisation on it.jsing3-4/+7
ok tb@
2020-05-09catch the other place this needs to changebeck1-2/+2
2020-05-09now that 3.1.1 is out the door as a stable release bump the developmentbeck1-2/+2
version to 3.2.0
2020-05-09Add support for certificate status requests in TLS 1.3 clientbeck4-12/+81
ok jsing@, tb@, inoguchi@
2020-05-09Make the test for the legacy_compression_method vector in the ClientHellotb1-12/+7
stricter. Previously, we would accept any vector if it advertised the "null" compression method. RFC 8446 4.1.2 specifies that the only legal vector has length one and contains a zero byte for the null method. ok jsing
2020-05-09Drop a redundant test. It's effectively doing the same test twicetb1-3/+2
and if the two lengths differed, the later CBS_write_bytes() would correctly fail anyway. Discussed with jsing
2020-05-09On receiving an overlong session ID terminate with an illegal_parametertb1-1/+6
alert. Found with tlsfuzzer. ok jsing
2020-05-09Add support for HelloRetryRequests in the TLSv1.3 server.jsing2-10/+73
ok inoguchi@ tb@
2020-05-09crazy whitespace on one linetb1-2/+2
2020-05-09Pull the sending of alerts up into tls13_handshake_perform().jsing1-14/+11
This fixes the case where a send function signals that an alert should be sent, then returns failure. Previously the failure would be propagated up, without the alert being sent. Issued noted by tb@ ok tb@
2020-05-09Refactor tls13_server_hello_sent().jsing1-30/+36
Split the record protection engagement code into a separate tls13_server_engage_record_protection() function and call this from tls13_server_hello_sent(). Also move some functions around to keep the logical ordering/grouping. ok inoguchi@ tb@ (as part of a larger diff)
2020-05-07On receiving a handshake or alert record with empty inner plaintext,tb1-1/+11
terminate the connection with an unexpected_message alert. See RFC 8446 section 5.4. Found with tlsfuzzer hint/ok jsing
2020-05-06Bump LibreSSL version to 3.1.1tb1-3/+3
ok bcook inoguchi deraadt
2020-05-04Use a larger (2048 bit) RSA test key.jsing1-1/+63
Otherwise we fail to do PSS signatures since the key size is too small.
2020-05-04Fix out-of-bounds access in tables[][] that was exposed in bluhm'stb1-6/+8
regress on i386 after inoguchi moved some symbols to const. ok inoguchi jsing deraadt
2020-05-03Accept two ChangeCipherSpec messages during a TLSv1.3 handshake.jsing1-3/+3
In compatibility mode, a TLSv1.3 server MUST send a dummy CCS message immediately after its first handshake message. This is normally after the ServerHello message, but it can be after the HelloRetryRequest message. As such we accept one CCS message from the server during the handshake. However, it turns out that in the HelloRetryRequest case, Facebook's fizz TLSv1.3 stack sends CCS messages after both the HelloRetryRequest message and the ServerHello message. This is unexpected and as far as I'm aware, no other TLSv1.3 implementation does this. Unfortunately the RFC is rather ambiguous here, which probably means it is not strictly an RFC violation. Relax the CCS message handling to allow two dummy CCS messages during a TLSv1.3. This makes our TLSv1.3 client work with Facebook Fizz when HRR is triggered. Issue discovered by inoguchi@ and investigated by tb@. ok deraadt@ tb@
2020-05-02Add const to TLS1.3 internal vectorsinoguchi2-14/+14
ok tb@
2020-04-30Disallow setting the AES-GCM IV length to 0tb1-1/+5
It is possible to do this by abusing the EVP_CTRL_INIT API. Pointed out by jsing. ok inoguchi jsing (as part of a larger diff)
2020-04-29tls13_record_layer internal functions to static in libsslinoguchi1-4/+4
We might remove static again for further regress around record layer in the future. ok jsing@ tb@
2020-04-29tls13_handshake internal functions to static in libsslinoguchi1-11/+12
ok jsing@ tb@
2020-04-28Move legacy stack interfacing functions into tls13_legacy.c.jsing4-199/+206
No functional change. ok inoguchi@ tb@
2020-04-28Rename tls13_client_synthetic_handshake_message() and move to tls13_lib.c.jsing3-47/+48
The server-side will need to use the same function. No functional change. ok inoguchi@ tb@
2020-04-27Shuffle some functions around.jsing2-329/+328
Move functions so that they are in the order that the TLSv1.3 messages are processed. While here, also move tls13_client_end_of_early_data_send() from tls13_client.c to tls13_server.c. No functional change. ok beck@ tb@
2020-04-27Fix two bugs in the AES-CBC-PKCS5 tests that didn't hide failing tests:tb1-3/+3
1. Use the correct slice for comparing the cipher output 2. Fix logic error similar to the one in AES-GCM in the previous commit