summaryrefslogtreecommitdiff
path: root/lib/gnutls_int.h
Commit message (Collapse)AuthorAgeFilesLines
* _gnutls13_recv_async_handshake: process multiple and split handshake messagestmp-fix-multi-async-msgNikos Mavrogiannopoulos2018-07-121-1/+2
| | | | | | | | | | | | | | 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>
* key update: corrected generation of keysNikos Mavrogiannopoulos2018-06-271-2/+2
| | | | | | Resolves #485 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* extensions: corrected order of pre-shared-key and dumbfwNikos Mavrogiannopoulos2018-06-221-3/+2
| | | | | | | | | The pre-shared-key MUST always be last under TLS1.3 while the dumbfw extension should be last in order to do proper evaluation of extension size (gnutls requirement). As such the protocol requirement takes precedence. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_supplemental_register: disable TLS 1.3 globallyNikos Mavrogiannopoulos2018-06-211-0/+1
| | | | | | | | | This allows using the registered supplemental data handlers, since these are not used under TLS 1.3. Resolves #479 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_session_supplemental_register: disable TLS1.3 when setNikos Mavrogiannopoulos2018-06-211-1/+2
| | | | | | | | | This allows using the registered supplemental data handlers, since these are not used under TLS 1.3. Resolves #479 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* _gnutls13_handshake_server: send CCS immediately after HRRDaiki Ueno2018-06-151-1/+1
| | | | | | | 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>
* MAX_CIPHER_BLOCK_SIZE: increased to 64-bytes for CHACHA20Nikos Mavrogiannopoulos2018-06-141-1/+1
| | | | | | | | This was not necessary since that value was only used by block (in TLS sense) ciphers, but that definition could also be used for the CHACHA20. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* priorities: introduced %FORCE_ETMtmp-measure-recordNikos Mavrogiannopoulos2018-06-121-0/+1
| | | | | | | | | This introduces a priority string option to force encrypt-then-mac during negotiation, to prevent negotiating the legacy CBC ciphersuites. Resolves #472 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* Renamed extension supported ECC to supported groups. Fixes #451.Tom Vrancken2018-05-291-16/+16
| | | | | | Split combined ECC extensions into different files. Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
* gnutls_session_ticket_send: new functionNikos Mavrogiannopoulos2018-05-261-1/+7
| | | | | | | 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>
* TLS 1.3: Introduced TLS 1.3 session resumptionAnder Juaristi2018-05-261-14/+49
| | | | | | | | | | | | | | | | | 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>
* session tickets: expose {encrypt,decrypt}_ticket as internal APIAnder Juaristi2018-05-261-0/+13
| | | | | | | | To reuse the same ticket construction in any TLS versions, expose the private functions in ext/session_ticket.c. Signed-off-by: Ander Juaristi <a@juaristi.eus> Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: record transcript offset of client FinishedDaiki Ueno2018-05-261-0/+2
| | | | | | | This is for deriving resumption_master_secret, whose value is calculated over ClientHello...client Finished. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* tls13/certificate_request: corrected check of duplicate signature algorithmsNikos Mavrogiannopoulos2018-05-041-1/+0
| | | | | | | | | | Made the check local when parsing a certificate request, as we may receive multiple requests when post-handshake authentication is in place. Furthermore check whether this extension has been received as this is a mandatory one. In addition handle a memory leak when multiple peer certificates are set. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Added support for out-of-band Pre-shared keys under TLS1.3Ander Juaristi2018-04-061-3/+48
| | | | | | | | | | | 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>
* _gnutls_supported_ecc_recv_params: take into account precedenceNikos Mavrogiannopoulos2018-03-231-1/+4
| | | | | | | | | | | | That is, when %SERVER_PRECEDENCE is given in the priority string make sure that the negotiated curve of DH group respects the server's priorities. That's very relevant under TLS1.3 as ciphersuite negotiation itself, where %SERVER_PRECEDENCE applied, does contain only the cipher algorithm and MAC unlike TLS1.2 which included key exchange as well. Resolves #378 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Hello retry request matches server helloNikos Mavrogiannopoulos2018-03-091-0/+11
| | | | | | | | | That also distinguishes between them by using the special random value, and implements the version check as in draft-ietf-tls-tls13-24. Resolves #391 #390 #392 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* record: ignore any ChangeCipherSpec messages under TLS1.3 handshakeNikos Mavrogiannopoulos2018-03-081-1/+5
| | | | | | | | | | 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>
* ocsp: enhanced the OCSP response loading APIsNikos Mavrogiannopoulos2018-02-191-1/+1
| | | | | | | | | | | | | Introduced gnutls_certificate_set_ocsp_status_request_file2() and gnutls_certificate_set_ocsp_status_request_mem(). These functions behave as the equivalent certificate loading functions and pre-load the OCSP response provided as a file, either in DER or in PEM form. In addition, ensure that if the server is provided a problematic OCSP response, or the OCSP response is not renewed before it is invalid, we will not provide it to the clients. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* ocsp: send all the OCSP responses under TLS1.3Nikos Mavrogiannopoulos2018-02-191-2/+2
| | | | | | | That is, any responses set by the caller application (directly or via a callback), will be sent to the peer. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* introduced gnutls_certificate_retrieve_function3Nikos Mavrogiannopoulos2018-02-191-1/+9
| | | | | | | | | | | | That allows a certificate callback to provide OCSP responses in addition to certificates. That also introduces a flags option which currently accepts GNUTLS_CERT_RETR_DEINIT_ALL which allows the callback to specify whether the provided data should be deinitialized. To simplify the certificate callback code, all previous (now legacy) callbacks are implemented as wrappers over the new callback function. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* doc: documented hsk_flags "lifetime" and its resetNikos Mavrogiannopoulos2018-02-191-0/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* session state: TLS1.2 and TLS1.3 state is stored as unionNikos Mavrogiannopoulos2018-02-191-8/+10
| | | | | | | | | 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-40/+53
| | | | | | | 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>
* record state: avoid memory allocations for stored keysNikos Mavrogiannopoulos2018-02-191-3/+9
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: ffdhe flags merged with handshake flagsNikos Mavrogiannopoulos2018-02-191-4/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: false start flag merged with hsk_flagsNikos Mavrogiannopoulos2018-02-191-2/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: use hsk_flags in TLS1.2 and TLS1.3Nikos Mavrogiannopoulos2018-02-191-6/+2
| | | | | | | The flags provide a more transparent view of the received and expected messages. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added support for post-handshake authenticationNikos Mavrogiannopoulos2018-02-191-0/+18
| | | | | | | | | | | | 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>
* Introduce key usage limits under TLS1.3Nikos Mavrogiannopoulos2018-02-191-0/+1
| | | | | | | | | That introduces a transparent key update for sending key after the safety limit is reached. Resolves #130 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: introduced gnutls_session_key_update()Nikos Mavrogiannopoulos2018-02-191-11/+14
| | | | | | | 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-1/+9
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake-tls13: derive and store exporter_master_secretDaiki Ueno2018-02-191-0/+1
| | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* session state: combined srp and dh prime bits variablesNikos Mavrogiannopoulos2018-02-191-6/+6
| | | | | | | They were being used for the same purpose, and SRP as well as DH, do not overlap to require two different variables. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* session state: mark mod_auth_st_int as constantNikos Mavrogiannopoulos2018-02-191-1/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* dtls: cookie is stored dynamically when needed rather than in pre-allocated sizeNikos Mavrogiannopoulos2018-02-191-2/+1
| | | | | | | | | That reduces the number of bytes used in cases where DTLS is not in use or we are in server-side. Relates #281 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added support for client certificatesNikos Mavrogiannopoulos2018-02-191-0/+1
| | | | | | | | | That is, receive and parse a certificate request, certificate verify, as well as certificate in server side. That way, client certificates Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: send certificate request when requestedNikos Mavrogiannopoulos2018-02-191-0/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* extensions: optimized gid_to_ext_entry() map on known extensionsNikos Mavrogiannopoulos2018-02-191-2/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* extensions: avoid looping to discover location of saved dataNikos Mavrogiannopoulos2018-02-191-4/+4
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added support for reading and sending cookie extensionNikos Mavrogiannopoulos2018-02-191-1/+2
| | | | | | That introduces an internal API to associate data to an extension. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: accept hello retry request in client sideNikos Mavrogiannopoulos2018-02-191-0/+4
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: send hello retry request when no key share matchesNikos Mavrogiannopoulos2018-02-191-0/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* extensions: introduced functions to obtain currently parsed messageNikos Mavrogiannopoulos2018-02-191-0/+2
| | | | | | | This allows the extension handling code to operate differently on different messages. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: introduced server side handshake [2/2]Nikos Mavrogiannopoulos2018-02-191-0/+5
| | | | | | | | 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>
* ciphersuites: introduce a maximum supported TLS/DTLS versionNikos Mavrogiannopoulos2018-02-191-0/+4
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: generate application keysNikos Mavrogiannopoulos2018-02-191-1/+9
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added basic support for TLS 1.3 handshake in client sideNikos Mavrogiannopoulos2018-02-191-0/+2
| | | | | | | | | | | | | 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>
* crypto-api: introduce internal version of AEAD APINikos Mavrogiannopoulos2018-02-191-1/+5
| | | | | | | This allows to initialize the TLS 1.3 connection state without additional allocations as required by the external API. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* record: added TLS 1.3 record parsing and key derivationNikos Mavrogiannopoulos2018-02-191-3/+10
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>