summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'client-hello-version' into 'master'cherry-pick-c93fab21Daiki Ueno2022-01-121-0/+1
| | | | | | | | | | | Use proper record version in client hello after hello retry request Closes #1053 See merge request gnutls/gnutls!1346 (cherry picked from commit c93fab21ab7abb805b4db22cd155996b3ce96361) 136b6a47 Use proper record version in client hello after hello retry request
* Release 3.6.163.6.16gnutls_3_6_xDaiki Ueno2021-05-243-3/+21
| | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
* devel: regenerate abidw dump filesDaiki Ueno2021-05-242-16692/+25238
| | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
* Merge branch 'wip/dueno/addrconfig-3.6' into 'gnutls_3_6_x'Daiki Ueno2021-05-211-5/+1
|\ | | | | | | | | serv: stop setting AI_ADDRCONFIG on getaddrinfo [3.6.x] See merge request gnutls/gnutls!1440
| * serv: stop setting AI_ADDRCONFIG on getaddrinfoDaiki Ueno2021-05-211-5/+1
|/ | | | | | | | | AI_ADDRCONFIG is only useful when the NODE argument is given in the getaddrinfo call, as described in RFC 3493 6.1. Suggested by Andreas Metzler in: https://gitlab.com/gnutls/gnutls/-/issues/1007#note_356637206 Signed-off-by: Daiki Ueno <ueno@gnu.org>
* Merge branch 'wip/dueno/ecdsa-verify-3.6.x' into 'gnutls_3_6_x'Daiki Ueno2021-05-118-1/+119
|\ | | | | | | | | nettle: port upstream hardening of EC point multiplication [3.6.x] See merge request gnutls/gnutls!1407
| * nettle: port upstream hardening of EC point multiplicationDaiki Ueno2021-05-118-1/+119
| | | | | | | | | | | | | | | | | | | | | | | | Some internal functions used in point multiplications are known to misbehave if the scaler is out-of-range. This performs canonical reduction on scalers, before point multiplication. This ports the fixes from Nettle upstream to the bundled EC code. See the Nettle 3.7.2 release announcement for details: https://lists.lysator.liu.se/pipermail/nettle-bugs/2021/009458.html Signed-off-by: Daiki Ueno <ueno@gnu.org>
* | Merge branch 'wip/dueno/realloc-3.6.x' into 'gnutls_3_6_x'Daiki Ueno2021-04-043-39/+62
|\ \ | |/ |/| | | | | key_share, pre_shared_key: avoid use-after-free around realloc [3.6.x] See merge request gnutls/gnutls!1408
| * str: suppress -Wunused-function if AGGRESSIVE_REALLOC is definedDaiki Ueno2021-04-041-9/+9
| | | | | | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * _gnutls_buffer_resize: account for unused area if AGGRESSIVE_REALLOCDaiki Ueno2021-04-041-2/+2
| | | | | | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * pre_shared_key: avoid use-after-free around reallocDaiki Ueno2021-04-041-3/+12
| | | | | | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * key_share: avoid use-after-free around reallocDaiki Ueno2021-04-041-7/+5
| | | | | | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * _gnutls_buffer_resize: add option to use allocation simpler logicDaiki Ueno2021-04-041-0/+32
| | | | | | | | | | | | | | | | | | | | This helps detect common mistakes[1] in realloc usage with valgrind, where the caller assumes that the original ptr is always returned. 1. https://bugzilla.mozilla.org/show_bug.cgi?id=1377618 Signed-off-by: Daiki Ueno <ueno@gnu.org> Co-authored-by: Alexander Sosedkin <asosedkin@redhat.com>
| * gnutls_buffer_append_data: remove duplicated codeDaiki Ueno2021-04-041-20/+4
|/ | | | | | The function shared the same logic as in _gnutls_buffer_resize. Signed-off-by: Daiki Ueno <ueno@gnu.org>
* Merge branch 'wip/dueno/test-fixes-3.6' into 'gnutls_3_6_x'Daiki Ueno2021-04-045-13/+173
|\ | | | | | | | | testpkcs11: use datefudge to trick certificate expiry [3.6.x] See merge request gnutls/gnutls!1409
| * gnulib: parse-datetime: port build fixes from upstream gnulibDaiki Ueno2021-04-031-0/+128
| | | | | | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * Update year of copyright notices in doc/gnutls.texiFiona Klute2021-04-021-2/+2
| | | | | | | | | | | | | | Static analysis in CI checks if this is up to date, and fails if not. This fixes the failure. Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
| * testpkcs11: use datefudge to trick certificate expiryDaiki Ueno2021-01-262-1/+16
| | | | | | | | | | | | | | | | | | | | | | The certificates stored in tests/testpkcs11-certs expired on 2020-12-13. To avoid verification failure due to that, use datefudge to set custom date when calling gnutls-cli, gnutls-serv, and certtool. Based on the patch by Andreas Metzler: https://gitlab.com/gnutls/gnutls/-/issues/1135#note_469682121 Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * tests: Fix tpmtool_test due to changes in trousersStefan Berger2021-01-261-10/+27
|/ | | | | | | | | Recent changes to trousers now require an ownership of root:tss for the tcsd config file, older ones requires tss:tss. So, start tcsd using trial and error with either one of these ownership configurations until one works. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
* Release 3.6.153.6.15Daiki Ueno2020-09-043-3/+10
| | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
* Merge branch 'tmp-renegotiation-3_6_x' into 'gnutls_3_6_x'Daiki Ueno2020-09-044-13/+36
|\ | | | | | | | | handshake: reject no_renegotiation alert if handshake is incomplete [3.6.x] See merge request gnutls/gnutls!1321
| * handshake: reject no_renegotiation alert if handshake is incompletetmp-renegotiation-3_6_xDaiki Ueno2020-09-034-13/+36
|/ | | | | | | | | | | | | | If the initial handshake is incomplete and the server sends a no_renegotiation alert, the client should treat it as a fatal error even if its level is warning. Otherwise the same handshake state (e.g., DHE parameters) are reused in the next gnutls_handshake call, if it is called in the loop idiom: do { ret = gnutls_handshake(session); } while (ret < 0 && gnutls_error_is_fatal(ret) == 0); Signed-off-by: Daiki Ueno <ueno@gnu.org>
* Merge branch 'tmp-backport-3.6' into 'gnutls_3_6_x'Daiki Ueno2020-09-03148-281/+2361
|\ | | | | | | | | Backport bug fixes from master to gnutls_3_6_x See merge request gnutls/gnutls!1317
| * NEWS: Mention 3.6.15 changestmp-backport-3.6Daiki Ueno2020-09-031-0/+27
| | | | | | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * handshake: check TLS version against modified server prioritiesDaiki Ueno2020-09-032-12/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | The server needs to take into account of multiple factors when determining the TLS protocol version actually being used: - the legacy version - "supported_versions" extension - user_hello_func that may modify the server's priorities Only after that it can check whether the TLS version is enabled in the server's priorities. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * gnutls_aead_cipher_decrypt: check output buffer size before writingDaiki Ueno2020-09-032-0/+91
| | | | | | | | | | | | | | | | | | While the documentation of gnutls_aead_cipher_decrypt indicates that the inout argument ptext_len initially holds the size that sufficiently fits the expected output size, there was no runtime check on that. This makes the interface robuster against misuses. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * gnutls_x509_crt_export2: return 0 instead of the lengthDaiki Ueno2020-09-032-4/+11
| | | | | | | | | | | | This aligns the behavior to the documentation. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * minitasn1: move WARN_CFLAGS setting to configure.acDaiki Ueno2020-09-032-4/+1
| | | | | | | | | | | | | | Some compilers don't support -Wno-type-limits, while they support -Wtype-limits. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * _gnutls_fips_mode_enabled: treat selftest failure as FIPS disabledDaiki Ueno2020-09-031-1/+10
| | | | | | | | | | | | | | | | | | Previously gnutls_fips140_mode_enabled() returned true, even after selftests have failed and the library state has switched to error. While later calls to crypto operations fails, it would be more convenient to have a function to detect that state. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * doc: assorted typo fixesDaiki Ueno2020-09-0323-31/+31
| | | | | | | | | | | | Spotted by codespell. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * serv, cli: ensure that invalid flag is always setDaiki Ueno2020-09-031-1/+4
| | | | | | | | | | | | | | | | According to the documentation, the GNUTLS_CERT_INVALID flag must always be set in case of verification failure, together with the flag indicating the actual error cause. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * cert-session: fail hard if mandatory stapling is not honoredDaiki Ueno2020-09-031-0/+1
| | | | | | | | | | | | | | | | According to the documentation, the GNUTLS_CERT_INVALID flag must always be set in case of verification failure, together with the flag indicating the actual error cause. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * mangle gnutls-built ecc_scalar_randomSteve Lhomme2020-08-311-1/+7
| | | | | | | | | | | | | | | | | | | | | | GNUTLS builds ecc-random.c but ecc_scalar_random() is a public API. So we mangle the internal version we build. ecc_mod_random is unaffected as it's an internal API that is mangled by GNUTLS. Fixes #1016 Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
| * pubkey: avoid spurious audit messages from _gnutls_pubkey_compatible_with_sig()Petr Pavlu2020-08-311-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking in _gnutls_pubkey_compatible_with_sig() whether a public key is compatible with a signature algorithm, run first pubkey_supports_sig() before performing weaker checks that can accept the given algorithm but with an audit-log warning. This avoids an issue when a weaker check would log an audit message for some signature algorithm that would then be determined as incompatible by the pubkey_supports_sig() check anyway. For instance, a GnuTLS server might have a certificate with a SECP384R1 public key and a client can report that it supports ECDSA-SECP256R1-SHA256 and ECDSA-SECP384R1-SHA384. In such a case, the GnuTLS server will eventually find that it must use ECDSA-SECP384R1-SHA384 with this public key. However, the code would first run _gnutls_pubkey_compatible_with_sig() to check if SECP384R1 is compatible with ECDSA-SECP256R1-SHA256. The function would report the audit warning "The hash size used in signature (32) is less than the expected (48)" but then reject the signature algorithm in pubkey_supports_sig() as incompatible because it has a different curve. Since the algorithm gets rejected it is not necessary to inform about its hash size difference in the audit log. Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
| * ecdh: perform SP800-56A rev3 full pubkey validation on keygenDaiki Ueno2020-08-311-2/+180
| | | | | | | | | | | | | | This implements full public key validation required in SP800-56A rev3, section 5.6.2.3.3. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * dh: perform SP800-56A rev3 full pubkey validation on keygenDaiki Ueno2020-08-311-0/+90
| | | | | | | | | | | | | | This implements full public key validation required in SP800-56A rev3, section 5.6.2.3.1. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * dh-primes: make the FIPS approved check return Q valueDaiki Ueno2020-08-313-20/+30
| | | | | | | | | | | | | | This is necessary for full public key validation in SP800-56A (revision 3), section 5.6.2.3.1. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * ecdh: check validity of P before exportDaiki Ueno2020-08-311-6/+21
| | | | | | | | | | | | | | | | | | | | SP800-56A rev3 section 5.7.1.2 step 2 mandates that the validity of the calculated shared secret is verified before the data is returned to the caller. This patch adds the validation check. Suggested by Stephan Mueller. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * dh: check validity of Z before exportDaiki Ueno2020-08-311-9/+17
| | | | | | | | | | | | | | | | | | | | SP800-56A rev3 section 5.7.1.1 step 2 mandates that the validity of the calculated shared secret is verified before the data is returned to the caller. This patch adds the validation check. Suggested by Stephan Mueller. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * build: use $(LIBPTHREAD) rather than non-existent $(LTLIBPTHREAD)James Bottomley2020-08-312-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On a very recent openSUSE build, libgnutls is getting built without libpthread. This caused a thread related error when trying to load a pkcs11 module that uses threading. The reason is rather convoluted: glibc actually controls all the pthread_ function calls, but it returns success without doing anything unless -lpthread is in the link list. What's happening is that gnutls_system_mutex_init() is being called on _gnutls_pkcs11_mutex before library pthreading is initialized, so the pthread_mutex_init ends up being a nop. Then, when the pkcs11 module is loaded, pthreads get initialized and the call to pthread_mutex_lock is real, but errors out on the uninitialized mutex. The problem seems to be that nothing in the gnulib macros gnutls relies on for threading support detection actually sets LTLIBPTHREAD, they only set LIBPTHREAD. The fix is to use LIBPTHREAD in lib/Makefile.in Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * .gitlab-ci: disable config.cache for nettle-master buildsDmitry Baryshkov2020-08-311-2/+2
| | | | | | | | | | | | | | | | Disable usage of config.cache for nettle-master builds. Such config.cache files can easily become stale, thus resulting in build failures. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
| * tests: split up system-override-sig-hash.shAlexander Sosedkin2020-08-313-20/+46
| | | | | | | | | | | | | | | | | | Split up system-override-sig-hash.sh so that the errors won't get swallowed or conflated. Also correct unused `srcdir` to `builddir`, which I believe was meant to be set there. Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
| * fix connectx not available on older macOS SDKSteve Lhomme2020-08-311-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes this compilation error: system/fastopen.c:134:9: error: 'connectx' is only available on macOS 10.11 or newer [-Werror,-Wunguarded-availability] ret = connectx(fd, &endpoints, SAE_ASSOCID_ANY, CONNECT_RESUME_ON_READ_WRITE | CONNECT_DATA_IDEMPOTENT, NULL, 0, NULL, NULL); ^~~~~~~~ /Applications/Xcode9.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/socket.h:713:5: note: 'connectx' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.7.0 The detection is the same as found in curl [1]. If HAVE_BUILTIN_AVAILABLE is not available we fallback to the code without TCP_FASTOPEN_OSX. The OS values match exactly the values found in https://opensource.apple.com/source/xnu/xnu-4570.41.2/bsd/sys/socket.h [1] https://github.com/curl/curl/commit/870d849d48a26b8eeb0d4bb1f4655367a4a191ca Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
| * safe_memcmp: remove in favor of gnutls_memcmpDaiki Ueno2020-08-316-17/+9
| | | | | | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * dhe: check if DH params in SKE match the FIPS approved algorithmsDaiki Ueno2020-08-3131-32/+521
| | | | | | | | | | | | | | | | SP800-56A rev. 3 restricts the FIPS compliant clients to use only approved DH parameters, defined in RFC 7919 and RFC 3526. This adds a check in the handling of ServerKeyExchange if DHE is negotiated. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * dh-primes: add MODP primes from RFC 3526Daiki Ueno2020-08-312-0/+962
| | | | | | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * Wipe session ticket keys before releasing the session structureFiona Klute2020-08-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This includes both a copy of the master key and one or two derived keys, all of which could be used to decrypt session tickets if stolen. The derived keys could only be used for tickets issued within a certain time frame (by default several hours). The documentation for gnutls_session_ticket_enable_server() already states that the master key should be wiped before releasing it, and the same should apply to internal copies. Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
| * Modied the license to GPLv2.1+ to keep with LICENSE file.Lei Maohui2020-08-312-18/+22
| | | | | | | | Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
| * Update tlsfuzzer to get Python interpreter detectionFiona Klute2020-08-310-0/+0
| | | | | | | | | | | | | | | | Tlsfuzzer also assumed the Python interpreter would be called "python", this update is necessary to get a fixed version (see https://github.com/tomato42/tlsfuzzer/pull/671). Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
| * Detect Python interpreter instead of assuming "python"Fiona Klute2020-08-314-6/+18
| | | | | | | | | | | | | | This makes the extended test suite work one Debian(-ish) systems without Python 2, where the Python 3 interpreter is called "python3". Signed-off-by: Fiona Klute <fiona.klute@gmx.de>