summaryrefslogtreecommitdiff
path: root/lib/handshake-tls13.c
Commit message (Collapse)AuthorAgeFilesLines
* handshake-tls13: add session flag to disable sending session ticketstmp-no-auto-send-ticketDaiki Ueno2020-04-131-3/+5
| | | | | | | | | While GnuTLS by default implicitly sends NewSessionTicket during handshake, application protocols like QUIC set a clear boundary between "in handshake" and "post handshake", and NST must be sent in the post handshake state. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* keylogfile: simplify the callback mechanismtmp-keylog-funcDaiki Ueno2020-02-221-1/+1
| | | | | | | | | | This partially reverts commit 97117556 with a simpler interface. The original intention of having the callback mechanism was to reuse it for monitoring QUIC encryption changes. However, it turned out to be insufficient because such changes must be emitted after a new epoch is ready. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* keylogfile: generalize with a callbacktmp-keylog-hookDaiki Ueno2020-02-071-3/+5
| | | | | | | | | This refactors the keylogfile mechanism by adding a callback to get notified when a new secret is derived and installed. That way, consumers can implement custom logging feature per session, which is particularly useful in QUIC implementation. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* handshake: add missing initialization of local variableDaiki Ueno2019-03-271-0/+2
| | | | | | | Resolves: #704 Signed-off-by: Daiki Ueno <dueno@redhat.com> Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: increase the default number of tickets we send to 2tmp-increase-nr-of-ticketsNikos Mavrogiannopoulos2019-03-201-5/+3
| | | | | | | | | | | This makes it easier for clients which perform multiple connections to the server to use the tickets sent by a default server. That's because 2 tickets allow for 2 new connections (if one is using each ticket once as recommended), which in turn lead to 4 new and so on. Resolves: #596 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Use https:// for www.gnu.org and www.example.comTim Rühsen2019-03-131-1/+1
| | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* gnutls_record_send2: try to ensure integrity of operations on false and ↵Nikos Mavrogiannopoulos2019-03-021-3/+6
| | | | | | | | | | early start This adds a double check in the sanity check of gnutls_record_send2() for the initial_negotiation_completed value, making sure that the check will be successful even in parallel operation of send/recv. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: handle early dataDaiki Ueno2018-11-111-52/+113
| | | | | | | | | | | This plumbers early data handling in the handshake processes, which consists of: - traffic key updates taking into account of client_early_traffic_secret - early data buffering in both server and client - the EndOfEarlyData message handling - making use of max_early_data_size extension in NewSessionTicket Signed-off-by: Daiki Ueno <dueno@redhat.com>
* constate: add epoch_rel argument to _gnutls_epoch_dupDaiki Ueno2018-11-111-1/+1
| | | | | | | | | | This is necessary for handling early data. Previously, _gnutls_epoch_dup() copied the parameters from EPOCH_READ_CURRENT, while the client only sets EPOCH_WRITE_CURRENT when sending early data. This allows caller to specify from which epoch the parameters are copied. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* handshake: refactor early secret derivationDaiki Ueno2018-11-111-0/+8
| | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* gnutls_init: added flag for automatic re-authenticationNikos Mavrogiannopoulos2018-10-161-5/+17
| | | | | | | | | This introduces the GNUTLS_AUTO_REAUTH gnutls_init() flag and makes re-authentication under TLS simpler to enable and use. Resolves #571 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* use a consistent method to mark fall-through in switch casesNikos Mavrogiannopoulos2018-08-081-30/+30
| | | | | | | | Also document that method in contribution guide. Resolves #306 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* tls1.3: server returns early on handshake when no cert is provided by clientNikos Mavrogiannopoulos2018-08-031-40/+148
| | | | | | | | | | | | Under TLS1.3 the server knows the negotiated keys early, if no client certificate is sent. In that case, the server is not only able to transmit the session ticket immediately after its finished message, but is also able to transmit data, similarly to false start. Resolves #481 Resolves #457 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* _gnutls13_recv_async_handshake: process multiple and split handshake messagestmp-fix-multi-async-msgNikos Mavrogiannopoulos2018-07-121-66/+108
| | | | | | | | | | | | | | It is permitted to concatenate multiple async handshake messages in a single record message as well as split large messages (NST) into multiple records. Modified _gnutls13_recv_async_handshake() to process them correctly, instead of assuming that they are formatted as one message per record. Resolves #510 Resolves #504 Relates #511 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_session_ticket_send: allow sending multiple tickets in one goNikos Mavrogiannopoulos2018-07-121-3/+7
| | | | | | | This allows combining the tickets in a single record message when possible. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* _gnutls13_handshake_server: send CCS immediately after HRRDaiki Ueno2018-06-151-8/+19
| | | | | | | In the TLS 1.3 middlebox compatibility mode, CCS follows the first handshake message sent from the server, that is either SH or HRR. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* _gnutls13_handshake_server: corrected transition when post_handshake ↵Nikos Mavrogiannopoulos2018-06-151-3/+1
| | | | | | callback is set Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_session_ticket_send: new functionNikos Mavrogiannopoulos2018-05-261-0/+46
| | | | | | | Introduced in order for a server to be able to send an arbitrary amount of tickets, at any time. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: store session parameters in TLS1.3 ticketNikos Mavrogiannopoulos2018-05-261-2/+4
| | | | | | | This allows a TLS1.3 server to obtain certificate or other information from the client on a resumed session. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: TLS1.3 async messages trigger the handshake hookNikos Mavrogiannopoulos2018-05-261-0/+8
| | | | | | | | | | That is, the callback set with gnutls_handshake_set_hook_function() is now called even on the async handshake messages received under TLS1.3, such as key update, etc. Resolves #441 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* TLS 1.3: Introduced TLS 1.3 session resumptionAnder Juaristi2018-05-261-5/+33
| | | | | | | | | | | | | | | | | This introduces session resumption under TLS 1.3. For that, it enables the psk_ke_modes extension when we enable session tickets. It enables sending session tickets in addition to PSK usernames. The detection of resumption vs pure PSK is done by comparing the indexes sent with the index received by the server. TLS 1.3 session tickets are always sent to the peer unless the GNUTLS_NO_TICKETS is specified. Resolves #290 Signed-off-by: Ander Juaristi <a@juaristi.eus> Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com> Signed-off-by: Daiki Ueno <dueno@redhat.com>
* Added support for out-of-band Pre-shared keys under TLS1.3Ander Juaristi2018-04-061-5/+37
| | | | | | | | | | | That adds support for pre-shared keys with and without Diffie-Hellman key exchange. That's a modified version of initial Ander's patch. Resolves #414 Resolves #125 Signed-off-by: Ander Juaristi <a@juaristi.eus> Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.org>
* record: ignore any ChangeCipherSpec messages under TLS1.3 handshakeNikos Mavrogiannopoulos2018-03-081-47/+65
| | | | | | | | | | Also send ChangeCipherSpec messages under TLS1.3 handshake. This is a draft-ietf-tls-tls13-22 change. Resolves #395 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* session state: TLS1.2 and TLS1.3 state is stored as unionNikos Mavrogiannopoulos2018-02-191-6/+6
| | | | | | | | | That is, to reduce memory usage as these protocol cannot be used in parallel. Relates: #281 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* session state: organized key exchange keys into structuresNikos Mavrogiannopoulos2018-02-191-6/+6
| | | | | | | That is, with the view of separating the data needed for TLS1.2 and earlier and TLS1.3. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added support for post-handshake authenticationNikos Mavrogiannopoulos2018-02-191-0/+37
| | | | | | | | | | | | That is: * introduced a gnutls_init() flag for clients to enable post-handshake authentication * introduced gnutls_reauth() function, to be called by servers to request authentication, and by clients to perform authentication Resolves #562 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: introduced gnutls_session_key_update()Nikos Mavrogiannopoulos2018-02-191-0/+1
| | | | | | | This function allows updating keys of the session and notifying the peer. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added TLS1.3 passive key updateNikos Mavrogiannopoulos2018-02-191-20/+28
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* keylogfile: write TLS 1.3 secretsDaiki Ueno2018-02-191-0/+4
| | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* handshake-tls13: derive and store exporter_master_secretDaiki Ueno2018-02-191-0/+8
| | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* _tls13_derive_secret: define secret argumentDaiki Ueno2018-02-191-1/+2
| | | | | | | | | TLS 1.3 exporters need to derive a secret from exporter_master_secret or early_exporter_master_secret, not the handshake or application secret stored in temp_secret. Add a new argument @secret to _tls13_derive_secret to specify any secret. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* handshake: accept hello retry request in client sideNikos Mavrogiannopoulos2018-02-191-1/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: send hello retry request when no key share matchesNikos Mavrogiannopoulos2018-02-191-1/+35
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: introduced server side handshake [2/2]Nikos Mavrogiannopoulos2018-02-191-7/+16
| | | | | | | | That is, send server certificate verify and receive certificate and certificate verify messages. In addition introduced flags to mark the expected, or sent messages. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: introduced server side handshake [1/2]Nikos Mavrogiannopoulos2018-02-191-3/+3
| | | | | | That is, send certificate request and certificate in server side Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: send encrypted extensions handshake messageNikos Mavrogiannopoulos2018-02-191-1/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: parse new session ticket messageNikos Mavrogiannopoulos2018-02-191-0/+41
| | | | | | That does not include extension handling. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: generate application keysNikos Mavrogiannopoulos2018-02-191-8/+36
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added basic support for TLS 1.3 handshake in client sideNikos Mavrogiannopoulos2018-02-191-7/+11
| | | | | | | | | | | | | That does not include support for client certificates as it requires extension handling improvements in order for extensions to be context sensitive (now they cannot distinguish whether the parsing routine is called during client hello or certificate request reading) This does not include proper parsing of extensions present in the certificate message. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added parsing of encrypted extensionsNikos Mavrogiannopoulos2018-02-191-14/+23
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* record: added TLS 1.3 record parsing and key derivationNikos Mavrogiannopoulos2018-02-191-0/+35
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: introduced TLS 1.3 handshake client state machine outlineNikos Mavrogiannopoulos2018-02-191-0/+182
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>