summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* doc: documented hsk_flags "lifetime" and its resettmp-nmav-draft-ietf-tls-tls13-21-compact-stateNikos Mavrogiannopoulos2017-12-091-0/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* session state: TLS1.2 and TLS1.3 state is stored as unionNikos Mavrogiannopoulos2017-12-0910-119/+136
| | | | | | | | | 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 Mavrogiannopoulos2017-12-0914-244/+257
| | | | | | | 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 Mavrogiannopoulos2017-12-094-123/+128
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: ffdhe flags merged with handshake flagsNikos Mavrogiannopoulos2017-12-096-16/+12
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: false start flag merged with hsk_flagsNikos Mavrogiannopoulos2017-12-093-6/+3
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: use hsk_flags in TLS1.2 and TLS1.3Nikos Mavrogiannopoulos2017-12-098-19/+13
| | | | | | | The flags provide a more transparent view of the received and expected messages. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* doc: added text on TLS1.3 rekey and reauthenticationNikos Mavrogiannopoulos2017-12-051-6/+33
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* updated auto-generated filesNikos Mavrogiannopoulos2017-12-043-0/+4
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* tests: re-enabled post-handshake auth testsNikos Mavrogiannopoulos2017-12-042-14/+56
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added support for post-handshake authenticationNikos Mavrogiannopoulos2017-12-0414-51/+448
| | | | | | | | | | | | 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>
* gnutls_record_set_state: use const for seq_numbertmp-nmav-draft-ietf-tls-tls13-21-key-limitsNikos Mavrogiannopoulos2017-12-042-2/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: added test suite on key limitsNikos Mavrogiannopoulos2017-12-042-0/+342
| | | | | | This checks whether key update occurs for the expected ciphersuites. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_record_get_state: doc updateNikos Mavrogiannopoulos2017-12-041-2/+3
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Introduce key usage limits under TLS1.3Nikos Mavrogiannopoulos2017-12-044-1/+18
| | | | | | | | | 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>
* updated auto-generated filestmp-draft-ietf-tls-tls13-21-nmav-backports7Nikos Mavrogiannopoulos2017-12-033-0/+4
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: removed unused variables and introduced temporal vars in macrosNikos Mavrogiannopoulos2017-12-038-42/+34
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: check gnutls_rehandshake() and gnutls_handshake() under TLS1.3Nikos Mavrogiannopoulos2017-12-033-4/+209
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_*handshake: wrap gnutls_session_key_update under TLS 1.3Nikos Mavrogiannopoulos2017-12-031-41/+68
| | | | | | | | | | | | | | | | | | | | | | | | | The semantics of the gnutls_handshake() and gnutls_rehandshake() functions were tied to TLS 1.2 and earlier behavior. This patch attempts to merge the two different semantics as follows: TLS1.2: * gnutls_rehandshake: sends a hello request message (asks the peer for a re-handshake) in server side; invalid to be called in client side. * gnutls_handshake: performs a re-handshake in either client or server side; in server side it is expected to be called after gnutls_rehandshake(). TLS1.3: * gnutls_rehandshake: in server side sends a key update and asks the peer to re-key as well; remains invalid to be called in client side. * gnutls_handshake: sends a key update and asks the peer to re-key as well; in client side; is a no-op when called in server side. Relates #131 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* tests: added unit tests with TLS1.3 key updateNikos Mavrogiannopoulos2017-12-033-0/+250
| | | | | | Relates #131 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: introduced gnutls_session_key_update()Nikos Mavrogiannopoulos2017-12-039-147/+229
| | | | | | | 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 Mavrogiannopoulos2017-12-0310-57/+412
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* .gitlab-ci.yml: move destructive tests after trust store testsNikos Mavrogiannopoulos2017-12-031-1/+2
| | | | | | | That is, to ensure they are only run after the trust store is complete and that it doesn't affect its output. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* keylogfile: write TLS 1.3 secretstmp-draft-ietf-tls-tls13-21-dueno-sslkeylogfileDaiki Ueno2017-11-303-18/+71
| | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* _gnutls_nss_keylog_write: define new internal APIDaiki Ueno2017-11-304-20/+42
| | | | | | | | This patch turns the write_nss_key_log function to an internal API (with a different name) so that it can be called from other places implementing TLS 1.3 key scheduling. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* tls-fuzzer: enabled the large hello checksNikos Mavrogiannopoulos2017-11-293-3/+1
| | | | | | | | | These were previously not working because tls-fuzzer was not TLS1.3-ready. This is addressed at the current update, and as such we enable them. That commit also enables the SNI resumption tests. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* hkdf: refer to nettle's hkdf.h when availableNikos Mavrogiannopoulos2017-11-291-0/+8
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* doc updateNikos Mavrogiannopoulos2017-11-291-1/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_prf_rfc5705: apply the context limits only under TLS1.2 or earlierNikos Mavrogiannopoulos2017-11-271-5/+5
| | | | | | These limits do not exist under TLS1.3. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_prf_raw: fail under TLS1.3Nikos Mavrogiannopoulos2017-11-271-4/+9
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: included behavioral test of gnutls_prf under TLS1.3tmp-draft-ietf-tls-tls13-21-prf-backwards-compatNikos Mavrogiannopoulos2017-11-271-0/+30
| | | | | | Resolves #330 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_prf: prevent usage under TLS1.3Nikos Mavrogiannopoulos2017-11-271-5/+12
| | | | | | | Only allow its use when it is documented to have the same output as gnutls_rfc5705() and in that case make it a wrapper to it. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_prf_rfc5705: calculate exporter using HKDF if TLS 1.3Daiki Ueno2017-11-273-19/+387
| | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* handshake-tls13: derive and store exporter_master_secretDaiki Ueno2017-11-273-2/+11
| | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* _tls13_derive_secret: define secret argumentDaiki Ueno2017-11-275-25/+18
| | | | | | | | | 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>
* tests: client-fastopen: introduce child signal handler and delay prior to ↵Nikos Mavrogiannopoulos2017-11-241-5/+8
| | | | | | | | starting This addresses a hang issue on freebsd builds. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* session state: use the right type for send_cert_req variabletmp-draft-ietf-tls-tls13-21-nmav-backports5Nikos Mavrogiannopoulos2017-11-191-1/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* session state: combined srp and dh prime bits variablesNikos Mavrogiannopoulos2017-11-193-9/+9
| | | | | | | 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 Mavrogiannopoulos2017-11-191-1/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* dtls: cookie is stored dynamically when needed rather than in pre-allocated sizeNikos Mavrogiannopoulos2017-11-193-6/+11
| | | | | | | | | 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>
* removed legacy/unused rsa-related structures/functionsNikos Mavrogiannopoulos2017-11-192-15/+0
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* lib: simplify adding groups according to priorititesDmitry Eremin-Solenikov2017-11-191-21/+12
| | | | | | | | | There is little point, remembering if EC or DHE came first and then adding necessary groups checking that flag. Instead just add groups at the time first EC or DHE ciphersuite is met. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* tests: added unit test for RDNs in cert callbacktmp-draft-ietf-tls-tls13-21-nmav-backports2Nikos Mavrogiannopoulos2017-11-162-1/+196
| | | | | | | | | | This verifies whether the RDNs received at the callbacks under TLS1.2 and TLS1.3 have the expected values (corresponding to the certificates used). Resolves #297 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_auth*_get_type: use gnutls_kx_get to retrieve key exchangeNikos Mavrogiannopoulos2017-11-161-6/+14
| | | | | | | That allows the functions to operate under TLS 1.3 which have no key exchange as part of the ciphersuite. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: check certificate callbacks under TLS 1.2 and 1.3Nikos Mavrogiannopoulos2017-11-161-15/+26
| | | | | | Resolves #278 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: added unit tests for client certificate under TLS1.3Nikos Mavrogiannopoulos2017-11-161-0/+10
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: handle the certificate authorities extensionNikos Mavrogiannopoulos2017-11-163-11/+61
| | | | | | That is, when sending or receiving the certificate request message. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: added support for client certificatesNikos Mavrogiannopoulos2017-11-167-26/+112
| | | | | | | | | 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: return GNUTLS_E_NO_CERTIFICATE_FOUND when no certificate is found ↵Nikos Mavrogiannopoulos2017-11-162-3/+7
| | | | | | in TLS1.3 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: send certificate request when requestedNikos Mavrogiannopoulos2017-11-163-2/+64
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>