summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'tmp-explicit-sanity-checks' into 'master'Nikos Mavrogiannopoulos2019-03-062-4/+24
|\ | | | | | | | | cleanup: _gnutls_recv_handshake: added explicit sanity checks See merge request gnutls/gnutls!937
| * _gnutls_recv_handshake: added explicit sanity checkstmp-explicit-sanity-checksNikos Mavrogiannopoulos2019-02-232-4/+24
| | | | | | | | | | | | | | | | | | Although, this function acts on the message provided as expected and thus it should never call a message parsing function on unexpected messages, we make a more explicit sanity check. This unifies the sanity checks existing within the involved functions. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* | Merge branch 'tmp-cert-req' into 'master'Daiki Ueno2019-03-064-2/+18
|\ \ | | | | | | | | | | | | | | | | | | TLS 1.3: utilize "certificate_required" alert Closes #715 See merge request gnutls/gnutls!946
| * | tls13/certificate: utilize "certificate_required" alerttmp-cert-reqDaiki Ueno2019-03-054-2/+14
| | | | | | | | | | | | | | | | | | | | | This could make errors more distinguishable when the client sends no certificates or a bad certificate. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | alert: recognize "certificate_required"Daiki Ueno2019-03-042-0/+4
| | | | | | | | | | | | | | | | | | This may be sent if the server received an empty Certificate message. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | | Merge branch 'tmp-doc-update-iv' into 'master'Nikos Mavrogiannopoulos2019-03-052-12/+16
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Improve documentation for gnutls_cipher_get_iv_size and AEAD ciphers Closes #717 See merge request gnutls/gnutls!941
| * | Clarifications on AEAD cipherstmp-doc-update-ivNikos Mavrogiannopoulos2019-03-011-10/+12
| | | | | | | | | | | | | | | | | | Relates: #716 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
| * | Improve documentation for gnutls_cipher_get_iv_sizeNikos Mavrogiannopoulos2019-03-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This clarifies what is returned and what is to be expected on algorithms with variable IV sizes. Resolves: #717 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | | fips140: Ignore newlines read at the end of HMAC fileAnderson Toshiyuki Sasaki2019-03-041-0/+7
| | | | | | | | | | | | | | | | | | | | | This makes the integrity check to ignore newlines appended after the HMAC value. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
* | | fips140: Fix the names of files used in integrity checksAnderson Toshiyuki Sasaki2019-03-041-3/+3
| | | | | | | | | | | | | | | | | | | | | The names of the libraries haven't been updated when the soname version were bumped. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
* | | Merge branch 'tmp-false-start-clarifications' into 'master'Nikos Mavrogiannopoulos2019-03-027-19/+84
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Fixed operation under multiple threads Closes #713 See merge request gnutls/gnutls!935
| * | Protected _gnutls_epoch_get from _gnutls_epoch_gc on false startNikos Mavrogiannopoulos2019-03-023-7/+37
| | | | | | | | | | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
| * | gnutls_record_send2: try to ensure integrity of operations on false and ↵Nikos Mavrogiannopoulos2019-03-025-10/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Make false start and early start multi-thread recv/send safeNikos Mavrogiannopoulos2019-03-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An application that is sending and receiving from different threads after handshake is complete cannot take advantage of false start because gnutls_record_send2() detects operations during the handshake process as invalid. Because in early start and false start the remaining handshake process needs only to receive data, and the sending side is already set-up, this error detection is bogus. With this patch we remove it. Resolves: #713 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
| * | doc: added more information on operation under multiple threadsNikos Mavrogiannopoulos2019-03-022-1/+4
| | | | | | | | | | | | | | | | | | Relates: #713 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* | | pkcs11: clarify GNUTLS_PKCS11_TOKEN_MODNAME presence [ci skip]tmp-token-modname-clarificationsNikos Mavrogiannopoulos2019-02-261-1/+2
|/ / | | | | | | | | | | Resolves: #633 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | Merge branch 'tmp-reset-after-free' into 'master'Tim Rühsen2019-02-2331-72/+14
|\ \ | | | | | | | | | | | | Automatically NULLify after gnutls_free() See merge request gnutls/gnutls!923
| * | gnutls_x509_crt_init: Fix dereference of NULL pointertmp-reset-after-freeTim Rühsen2019-02-221-1/+1
| | | | | | | | | | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
| * | Remove redundant resets of variables after free()Tim Rühsen2019-02-2230-71/+9
| | | | | | | | | | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
| * | Automatically NULLify after gnutls_free()Tim Rühsen2019-02-221-0/+4
| | | | | | | | | | | | | | | | | | | | | This method prevents direct use-after-free and double-free issues. Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* | | Merge branch 'tmp-cleanup-cert' into 'master'Tim Rühsen2019-02-231-26/+12
|\ \ \ | |_|/ |/| | | | | | | | Cleanup lib/auth/cert.c as suggested by cppcheck See merge request gnutls/gnutls!924
| * | Cleanup lib/auth/cert.c as suggested by cppchecktmp-cleanup-certTim Rühsen2019-02-131-26/+12
| | | | | | | | | | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* | | Merge branch 'tmp-downgrade-sentinel' into 'master'Daiki Ueno2019-02-221-0/+15
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | handshake: defer setting downgrade sentinel until version is selected Closes #689 See merge request gnutls/gnutls!918
| * | | ext/supported_versions: regenerate server randomDaiki Ueno2019-02-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a call to _gnutls_gen_server_random() in handling the "supported_versions" extension, so that the TLS 1.3 downgrade sentinel is set only when the earlier versions are selected. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | | | Merge branch 'use_topendir_fixed' into 'master'Tim Rühsen2019-02-224-13/+56
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | Re-introduce topendir on Windows with Unicode support See merge request gnutls/gnutls!932
| * | | lib: x509: Minor directory browsing simplificationHugo Beauzée-Luyssen2019-02-211-6/+3
| | | | | | | | | | | | | | | | Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
| * | | Revert "Revert "verify-high2: Fix cert dir iteration on Win32""Hugo Beauzée-Luyssen2019-02-211-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 681330882da19099eea360fab141cab937c45677. Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr> This revert also contains the fix to the original commit (invalid utf8->utf16 conversion) and a minor simplification of the _treaddir loop.
| * | | iconv: Allow _gnutls_utf8_to_ucs2 to output little endianHugo Beauzée-Luyssen2019-02-213-5/+4
| |/ / | | | | | | | | | Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
* | | lib: Provide _Thread_local on MSVCHugo Beauzée-Luyssen2019-02-201-0/+2
|/ / | | | | | | Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
* | gnutls_record_set_max_size: make it work on server sidetmp-fix-record-size-limit-resumptionDaiki Ueno2019-02-141-5/+4
| | | | | | | | | | | | | | | | The record_size_limit extension can also be specified by the server to indicate the maximum plaintext. Also add test cases for asymmetric settings between server and client. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | ext/record_size_limit: account for content type octet in TLS 1.3Daiki Ueno2019-02-141-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In TLS 1.3, the protocol maximum of plaintext size is 2^14+1, while it is 2^14 in TLS 1.2. To accommodate that, this introduces the following invariant: - when the maximum is set by the user with gnutls_record_set_max_size(), store it as is. The value range is [511, 16834]. - when the maximum is negotiated through record_size_limit extension, it can be [512, 16385]. In TLS 1.3, subtract by 1 to fit in [511, 16384]. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | decrypt_packet_tls13: add check for max plaintext sizeDaiki Ueno2019-02-141-0/+9
| | | | | | | | | | | | | | There is check in _gnutls_recv_in_buffers already, but for TLS 1.3 we need to take account of the padding. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | record: reject too large plaintext after decryptionDaiki Ueno2019-02-141-0/+9
| | | | | | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | constate: reset max_record_recv_size upon renegotiationDaiki Ueno2019-02-141-0/+9
| | | | | | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | session_pack: reset max_record_recv_size when packingDaiki Ueno2019-02-141-3/+12
| | | | | | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | ext/record_size_limit: don't confuse with negotiated/user-supplied maximumDaiki Ueno2019-02-142-14/+35
| | | | | | | | | | | | | | | | As documented in gnutls_int.h, max_record_send_size is for tracking the user-supplied maximum, while max_record_recv_size for the protocol negotiated maximum. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | ext/max_record: server shouldn't send it with record_size_limitDaiki Ueno2019-02-144-8/+11
| | | | | | | | | | | | | | | | | | Otherwise, the connection will be disconnected by the client, as suggested in RFC: A client MUST treat receipt of both "max_fragment_length" and "record_size_limit" as a fatal error, and it SHOULD generate an "illegal_parameter" alert. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | _gnutls_hello_ext_is_present: don't ignore max_fragment_lengthDaiki Ueno2019-02-141-1/+1
| | | | | | | | | | | | The extension is assigned the internal ID 0. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | Merge branch 'tmp-fix-cert-params-checks' into 'master'Nikos Mavrogiannopoulos2019-02-141-1/+1
|\ \ | | | | | | | | | | | | | | | | | | x509: corrected issue in the algorithm parameters comparison Closes #698 See merge request gnutls/gnutls!921
| * | x509: corrected issue in the algorithm parameters comparisonNikos Mavrogiannopoulos2019-02-141-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each certificate has two fields to set the signature algorithm and parameters used for the digital signature. One of the fields is authenticated and the other is not. It is required from RFC5280 to enforce the equality of these fields, but currently due to an issue we wouldn't enforce the equality of the parameters fields. This fix corrects the issue. We also move an RSA-PSS certificate in chainverify that was relying on invalid parameters, to this set of invalid certificates. Resolves: #698 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | Fix uninitialized warning in pkcs11.cTim Rühsen2019-02-141-26/+16
| | | | | | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* | Remove typedef'ing ssize_t in gnutls.htmp-ssize-tTim Rühsen2019-02-121-7/+4
|/ | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* Merge branch 'tmp-gnulib-pton' into 'master'Tim Rühsen2019-02-106-286/+6
|\ | | | | | | | | Use inet_pton() from gnulib See merge request gnutls/gnutls!913
| * Use inet_pton() from gnulibtmp-gnulib-ptonTim Rühsen2019-02-106-286/+6
| | | | | | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* | Merge branch 'tmp-key-usage' into 'master'Nikos Mavrogiannopoulos2019-02-089-32/+109
|\ \ | |/ |/| | | | | | | | | When negotiating TLS1.3 enforce certificate key usage Closes #690 See merge request gnutls/gnutls!902
| * _gnutls_gen_rawpk_crt: corrected the use of asserttmp-key-usageNikos Mavrogiannopoulos2019-02-061-9/+10
| | | | | | | | | | | | | | The API could return 0 or 1 matching certificates. The case of zero can only happen in client side. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
| * raw public keys: apply the key usage bits the same way as X.509Nikos Mavrogiannopoulos2019-02-061-6/+14
| | | | | | | | | | | | | | That is, we require a signing certificate when negotiating TLS1.3, or when sending a client certificate (on all cases). Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
| * Fallback to TLS 1.2 when incompatible with signature certs are providedNikos Mavrogiannopoulos2019-02-064-3/+33
| | | | | | | | | | | | | | | | | | | | This only takes into account certificates in the credentials structure. If certificates are provided in a callback, these must be checked by the provider. For that we assume that the credentials structure is filled when associated with a session; if not then the fallback mechanism will not work and the handshake will fail. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
| * Enforce the certificate key usage restrictions on all casesNikos Mavrogiannopoulos2019-02-066-15/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That is, we require a signing certificate when negotiating TLS1.3, or when sending a client certificate (on all cases). Before we would not perform any checks under TLS1.3 or when client certificates are sent, assuming that the certificates used will always be signing ones. However if the user sets up incorrectly a decryption certificate we would use it for signing. This fix makes sure that an error is returned early when these scenarios are detected. Resolves: #690 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | Use inet_ntop() from gnulibtmp-gnulib-ntopTim Rühsen2019-02-074-262/+2
|/ | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>