summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* pkcs11 uris: the URI scheme is case insensitivetmp-urisNikos Mavrogiannopoulos2018-10-124-25/+30
| | | | | | | | | | | Makes the comparisons of the URI scheme to use c_strcasecmp from gnulib. It also replaces various straw strcasecmp with the gnulib variant. This ensures that comparison will be reliable irrespective of the locale. Resolves #590 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Merge branch 'tmp-fix-priority-set-call' into 'master'Nikos Mavrogiannopoulos2018-10-042-13/+32
|\ | | | | | | | | | | | | gnutls_priority_set: do not override version on handshake Closes #580 See merge request gnutls/gnutls!765
| * gnutls_priority_set: do not override version on handshaketmp-fix-priority-set-callNikos Mavrogiannopoulos2018-10-032-13/+32
| | | | | | | | | | | | | | | | | | | | When handshake is in progress, do not override the default TLS version in the session. This allows gnutls_priority_set to be called in the post_client_hello function without breaking the handshake. Resolves #580 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* | encrypt_packet_tls13: added explicit check on iv_size boundstmp-check-iv-sizeNikos Mavrogiannopoulos2018-10-021-0/+3
| | | | | | | | | | | | | | | | Although there are no ciphers defined for TLS1.3 which would overflow the assumed bound, an explicit check is necessary to avoid that code be a liability in future updates. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | privkey_pkcs8: added reference for validation parameters OID [ci skip]Nikos Mavrogiannopoulos2018-10-012-0/+2
|/ | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Merge branch 'tmp-lib-c-strcase' into 'master'Nikos Mavrogiannopoulos2018-09-2910-52/+62
|\ | | | | | | | | | | | | Use ASCII version of strcasecmp() in library code Closes #570 See merge request gnutls/gnutls!764
| * Use ASCII version of strcasecmp() in library codetmp-lib-c-strcaseTim Rühsen2018-09-2710-52/+62
| | | | | | | | | | | | | | | | | | | | strcasecmp() has side effects in some locales. What we really need is c_strcasecmp() from Gnulib for comparing ASCII strings. Fixes #570 Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* | Merge branch 'tmp-cleanup-in-docs' into 'master'Tim Rühsen2018-09-286-4/+15
|\ \ | |/ |/| | | | | manpage generation cleanup See merge request gnutls/gnutls!760
| * doc: fixed missing function and enumeration parametersNikos Mavrogiannopoulos2018-09-266-4/+15
| | | | | | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | _gnutls_check_key_purpose: eliminated dead codetmp-eliminate-dead-codeNikos Mavrogiannopoulos2018-09-261-2/+0
|/ | | | | | Resolves #573 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Enable the TLS1.3 protocol by defaultNikos Mavrogiannopoulos2018-09-241-2/+0
| | | | | | | As the protocol has been finalized, and the implementation is stable and interoperable, there is no need to enable it conditionally. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Merge branch 'tmp-pkcs11-lax-search' into 'master'Nikos Mavrogiannopoulos2018-09-244-43/+111
|\ | | | | | | | | | | | | Provide a less restrictive PKCS#11 search of certificates Closes #569 See merge request gnutls/gnutls!757
| * Provide a more flexible PKCS#11 search of trust store certificatestmp-pkcs11-lax-searchNikos Mavrogiannopoulos2018-09-214-43/+111
| | | | | | | | | | | | | | | | | | | | This addresses the problem where the CA certificate doesn't have a subject key identifier whereas the end certificates have an authority key identifier. Resolves #569 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | Merge branch 'tmp-be-strict-on-crls' into 'master'Nikos Mavrogiannopoulos2018-09-215-7/+31
|\ \ | | | | | | | | | | | | | | | | | | gnutls-cli enables CRL validation on startup Closes #564 See merge request gnutls/gnutls!752
| * | trust list: added flag to force failure on CRL validation errorNikos Mavrogiannopoulos2018-09-215-7/+31
| |/ | | | | | | | | | | | | This allows an application to be notified of the addition of invalid CRLs in the trust list. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | Merge branch 'tmp-session-ticket-key-rotation-ajuaristi' into 'master'Nikos Mavrogiannopoulos2018-09-2110-98/+532
|\ \ | |/ |/| | | | | | | | | Session ticket key rotation with TOTP Closes #184 See merge request gnutls/gnutls!695
| * session tickets: check timestamp for validitytmp-session-ticket-key-rotation-ajuaristiNikos Mavrogiannopoulos2018-09-204-28/+29
| | | | | | | | | | | | | | | | | | We were previously only relying on the client's view of the ticket lifetime for TLS1.3 tickets. This makes sure that we only resume tickets that the server considers valid and consolidates the expiration time checks to _gnutls_check_resumed_params(). Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
| * Added session ticket key rotation with TOTPAnder Juaristi2018-09-197-70/+503
| | | | | | | | | | | | | | | | | | | | | | This introduces session ticket key rotation on server side. The key set with gnutls_session_ticket_enable_server() is used as a master key to generate time-based keys for tickets. The rotation relates to the gnutls_db_set_cache_expiration() period. Resolves #184 Signed-off-by: Ander Juaristi <a@juaristi.eus>
* | Fix issue introduced in 20886264feTim Rühsen2018-09-201-3/+3
| | | | | | | | | | | | | | This makes _gnutls_resolve_priorities() return a string that is always allocated with the gnutls memory functions. Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* | ECC export/import: updated documentation on EdDSA curvesNikos Mavrogiannopoulos2018-09-205-13/+36
| | | | | | | | | | | | | | | | This clarifies the format that parameters in the EdDSA curves will be returned, and also ensures that the import/export functions fail on unsupported curves. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | x509: print_pubkey: print GOST public key with MSB firstDmitry Eremin-Solenikov2018-09-181-0/+14
| | | | | | | | | | | | | | OpenSSL and other libraries print MSB first, when printing GOST public keys. Let's return to this convention. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* | lib: use little endian when importing/exporting GOST keysDmitry Eremin-Solenikov2018-09-184-14/+25
| | | | | | | | | | | | | | | | GOST R 34.10 native format is little endian. It is better for the application code to use native format data to interface library, rather than convert buffers on their own. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* | mpi: add function to dprint mpi in little endiannessDmitry Eremin-Solenikov2018-09-182-0/+27
|/ | | | | | | Add little endian counterpart to _gnutls_mpi_dprint and _gnutls_mpi_dprint_le. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* gnutls.h: correct GOST R number references [ci skip]Dmitry Eremin-Solenikov2018-09-181-8/+8
| | | | | | | | | Fix numeric GOST R ids used in documentation, too many numbers: - GOST R 34.11 is digest function - GOST R 34.10-2001 is a digital signature over GOST R 34.11-94 digest - GOST R 34.10-2012 is a digital signature over GOST R 34.11-2012 digest Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* gnutls_x509_trust_list_add_trust_mem: fix behavior with unaccounted certsNikos Mavrogiannopoulos2018-09-171-1/+7
| | | | | | | | | If gnutls_x509_trust_list_add_cas returns less than clist_size, the additional unaccounted certificates will never be freed. Relates #552 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_x509_trust_list_add_cas: corrected return valueNikos Mavrogiannopoulos2018-09-171-1/+1
| | | | | | | | | | When the flag GNUTLS_TL_USE_IN_TLS is used and add_new_ca_to_rdn_seq the return value did not include the last certificate added to the list. This corrects its return value. Relates #552 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* fixed documentation in trust list functionsNikos Mavrogiannopoulos2018-09-171-14/+26
| | | | | | | | | That clarifies and addresses issues in the documentation of gnutls_x509_trust_list_add_crls() and gnutls_x509_trust_list_add_cas() Relates #552 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Fix variable used in reallocationNikos Mavrogiannopoulos2018-09-141-1/+1
| | | | | | | | | | This corrects the variable name used in the sizeof argument for realloc. This does not alter the actual allocation size, but rather it fixes a logic error. Relates: #554 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* dtls: recover when a NewSessionTicket message is lostNikos Mavrogiannopoulos2018-09-141-6/+16
| | | | | | | | | | | When the server's NewSessionTicket gets lost while the ChangeCipherSpec goes through, the client did not request retransmission by retransmitting his last flight, and the handshake was blocked. This commit addresses the issue and adds a reproducer. Resolves #543 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* priority: be backwards compatible with priority strings starting with NONENikos Mavrogiannopoulos2018-09-121-11/+21
| | | | | | | | | | | That is, we allow priority strings which do not enable any groups to work, by disabling TLS1.3. For example 'NONE:+VERS-TLS-ALL:+MAC-ALL:+RSA:+AES-128-GCM:+SIGN-ALL:+COMP-NULL' is still operational, but no TLS1.3 is enabled when specified. Resolves: #549 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Use gnutls_strdup() instead of strdup() in library codetmp-strdupTim Rühsen2018-08-242-3/+3
| | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* Remove gnulib work-around '#undef strdup'Tim Rühsen2018-08-241-6/+0
| | | | | | | The 'issue' should be fixed already. Even if not, it has to addressed in gnulib. Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* ext/pre_shared_key: use consistent name for regitration entryDaiki Ueno2018-08-235-6/+6
| | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* ext/pre_shared_key: make ticket age calculation consistentDaiki Ueno2018-08-231-10/+10
| | | | | | | | | | | | | | | | | | | Previously we used a pattern like this: uint32_t obfuscated_ticket_age, ticket_age_add; time_t ticket_age; ticket_age = obfuscated_ticket_age - ticket_age_add; if (ticket_age < 0) { ... } This always evaluates to false, because subtraction between unsigned integers yields an unsigned integer. Let's do the comparison before subtraction and also use correct types for representing time: uint32_t for protocol time and time_t for system time. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* tls13/psk_ext_parser: simplify the iterator interfaceDaiki Ueno2018-08-234-118/+94
| | | | | | | | Previously it was unclear whether psk_ext_parser_st is stateful or not. This change introduces the simpler API to iterate over the immutable data (psk_ext_parser_st), following the iterator pattern. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* handshake: do not negotiate TLS1.3 using the legacy version fieldtmp-update-version-numbersNikos Mavrogiannopoulos2018-08-204-8/+25
| | | | | | | | | Previously we could end-up with a TLS1.3 connection if the TLS1.3 ID was seen on the wire. We now explicitly fallback to TLS1.2 when we see a protocol with TLS1.3 semantics in an SSL2.0 or in the legacy version of the client hello. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* handshake: simplified protocol version checking functionsNikos Mavrogiannopoulos2018-08-206-49/+39
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* protocols: bumped TLS1.3 version number to RFC8446 valueNikos Mavrogiannopoulos2018-08-201-22/+0
| | | | | | | | This adds support of the final RFC numbers. Resolves #542 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* Implemented RFC7250 certificate type negotiation extensions.Tom Vrancken2018-08-2024-106/+1346
| | | | Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
* ext/record_size_limit: new extensionDaiki Ueno2018-08-207-26/+177
| | | | | | | | | | | This implements the record_size_limit extension as defined in RFC 8449. Although it obsoletes the max_record_size extension, for compatibility reasons GnuTLS still sends it on certain occasions. For example, when the new size is representable as the codepoint defined for max_record_size. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* ext/max_record: remove use of extension private dataDaiki Ueno2018-08-201-67/+11
| | | | | | | | As the extension data is always stored in session->security_parameters.max_record_send_size, it shouldn't be necessary to track it with the private data. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* gnutls_session_resumption_requested: fixed behavior under TLS1.3Nikos Mavrogiannopoulos2018-08-202-1/+6
| | | | | | | | | This makes gnutls_session_resumption_requested() functional under TLS1.3 and introduces a unit test of the function. Resolves #546 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* hello_ext: removed bogus commentNikos Mavrogiannopoulos2018-08-191-2/+0
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Fix two typos (overriden/guarranteed)Andreas Metzler2018-08-165-9/+9
| | | | Signed-off-by: Andreas Metzler <ametzler@bebt.de>
* write_oid_and_params: moved nullity check of params earlierNikos Mavrogiannopoulos2018-08-131-6/+5
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* gnutls_session_set_premaster: corrected error checksNikos Mavrogiannopoulos2018-08-131-5/+4
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* pubkey_verify_hashed_data: apply algorithm checksNikos Mavrogiannopoulos2018-08-131-2/+0
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* privkey_sign_raw_data: use assert to mark code which always succeedsNikos Mavrogiannopoulos2018-08-131-0/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* _gnutls_send_change_cipher_spec: removed unnecessary testNikos Mavrogiannopoulos2018-08-131-1/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_memset: use explicit_bzeroNikos Mavrogiannopoulos2018-08-081-8/+9
| | | | | | | | | That is, use the glibc function when available and the second parameter is zero. Resolves #230 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>