summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* dhe: check if DH params in SKE match the FIPS approved algorithmstmp-sp800-56ar3Daiki Ueno2020-06-271-0/+2
| | | | | | | | 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>
* tests: Adds new tests missingissuer and missingissuer_aiaSahana Prasad2020-06-031-2/+2
| | | | Signed-off-by: Sahana Prasad <sahana@redhat.com>
* tests: build datefudge-check during make allDmitry Baryshkov2020-05-261-0/+1
| | | | | | | | | | Most of the tests depend on datefudge-check. Let's make it during 'make all' stage to allow running individual tests w/o requiring to build it separately. Fixes #920 Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* Merge branch 'tmp-no-auto-send-ticket' into 'master'Daiki Ueno2020-04-201-0/+2
|\ | | | | | | | | handshake-tls13: add session flag to disable sending session tickets See merge request gnutls/gnutls!1234
| * handshake-tls13: add session flag to disable sending session ticketstmp-no-auto-send-ticketDaiki Ueno2020-04-131-0/+2
| | | | | | | | | | | | | | | | | | While GnuTLS by default implicitly sends NewSessionTicket during handshake, application protocols like QUIC set a clear boundary between "in handshake" and "post handshake", and NST must be sent in the post handshake state. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | Compare DNs by comparing their string representationsPierre Ossman2020-04-031-1/+1
| | | | | | | | | | | | | | | | A binary comparison will not work in case the contents is the same but the ASN.1 type differ (e.g. PrintableString vs UTF8String). Such variations are permitted so we need to handle them. Signed-off-by: Pierre Ossman <ossman@cendio.se>
* | tests: added check for random value of client and server hello in TLSNikos Mavrogiannopoulos2020-03-301-1/+1
| | | | | | | | | | | | | | This creates a tests that checks whether the TLS client and server hello have sufficient non-zero bytes. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | tests: added reproducer for client hello random value behavior in DTLSNikos Mavrogiannopoulos2020-03-301-1/+2
|/ | | | | | | | | This adds an equivalent test of tls13/hello_random_value.c for DTLS and extends the tests for server hello as well. Relates: #960 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* psk: Allow non-NULL PSK usernamesAnder Juaristi2020-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This commit closes #586. Two new functions are introduced: gnutls_psk_server_get_username2() and gnutls_psk_set_client_username2(), which are identical in behavior to those named similarly (without the final '2'), but allow arbitrary gnutls datums (not strings) to be used as usernames. Two new callback functions are also introduced, with their respective setters: gnutls_psk_set_server_credentials_function2() and gnutls_psk_set_client_credentials_function2(). In addition, the password file format is extended so that non-string usernames can be specified. A leading '#' character tells GnuTLS that the username should be interpreted as a raw byte string (encoded in HEX). Example: #deadbeef:9e32cf7786321a828ef7668f09fb35db Signed-off-by: Ander Juaristi's avatarAnder Juaristi <a@juaristi.eus>
* keylogfile: simplify the callback mechanismtmp-keylog-funcDaiki Ueno2020-02-221-1/+1
| | | | | | | | | | This partially reverts commit 97117556 with a simpler interface. The original intention of having the callback mechanism was to reuse it for monitoring QUIC encryption changes. However, it turned out to be insufficient because such changes must be emitted after a new epoch is ready. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* keylogfile: generalize with a callbacktmp-keylog-hookDaiki Ueno2020-02-071-1/+1
| | | | | | | | | This refactors the keylogfile mechanism by adding a callback to get notified when a new secret is derived and installed. That way, consumers can implement custom logging feature per session, which is particularly useful in QUIC implementation. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* crypto-api: add generic crypto functions for KDFDaiki Ueno2020-02-041-1/+1
| | | | | | | | | | This exposes HKDF and PBKDF2 functions from the library. Instead of defining a single KDF interface as in PKCS #11, this patch defines 3 distinct functions for HKDF-Extract, HKDF-Expand, and PBKDF2 derivation, so that we can take advantage of compile time checking of necesssary parameters. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* tls13: request OCSP responses as a serverNikos Mavrogiannopoulos2020-01-201-1/+2
| | | | | | | | | | | The TLS1.3 protocol requires the server to advertise an empty OCSP status request extension on its certificate verify message for an OCSP response to be sent by the client. We now always send this extension to allow clients attaching those responses. Resolves: #876 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Merge branch 'override-default-priority' into 'master'Nikos Mavrogiannopoulos2020-01-131-2/+3
|\ | | | | | | | | libgnutls: Add system-wide default-priority-string override. See merge request gnutls/gnutls!1158
| * libgnutls: Add system-wide default-priority-string override.Dimitri John Ledkov2020-01-131-2/+3
| | | | | | | | Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
* | tests: add test for revoked OCSP responsetmp-ocsp-revocationDaiki Ueno2020-01-101-1/+1
|/ | | | | | | This adds a test that exercises a failed handshake upon receipt of an OCSP response with the "revoked" status. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* tests/Makefile.am: use absolute top_srcdir for GNUTLS_PRIORITY_FILEDimitri John Ledkov2020-01-061-1/+1
| | | | | | | | | Some tests, e.g. in suite/tls-fuzzer execute scripts from sub-directories, making the relative path to system.prio in the environment pointing to a non-existent file. Export system.prio testsuite file as an absolute path to avoid this issue. Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
* x509: do not tolerate invalid DER timeNikos Mavrogiannopoulos2019-12-261-0/+4
| | | | | | | | | | | This effectively reverts !400 and ensures that we no longer tolerate invalid DER time. This complements the previous commit by Lili Quan and ensures we provide the --disable-strict-der-time backwards compatibility option. Resolves: #207 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* _gnutls_verify_crt_status: apply algorithm checks to trusted CAsNikos Mavrogiannopoulos2019-12-191-2/+3
| | | | | | | | | | | If a CA is found in the trusted list, check in addition to time validity, whether the algorithms comply to the expected level. This addresses the problem of accepting CAs which would have been marked as insecure otherwise. Resolves: #877 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Export profile ID/name handling functionsNikos Mavrogiannopoulos2019-12-191-1/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: global-init-override do not run in windowsNikos Mavrogiannopoulos2019-10-301-2/+3
| | | | | | It cannot be compiled in f30. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests/buffer.c: Add unit test for _gnutls_buffer_unescape()Tim Rühsen2019-10-151-1/+5
| | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* Added functional regression tests for rawpk functionality in gnutls-cli and ↵Tom Vrancken2019-10-041-1/+1
| | | | | | gnutls-serv. Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
* cipher-alignment: migrate LDADD/CFLAGS after renameAndreas Metzler2019-09-301-2/+2
| | | | | | Test was renamed from mini-alignment to cipher-alignment. Signed-off-by: Andreas Metzler <ametzler@bebt.de>
* Merge branch 'tmp-ocsp-fixes' into 'master'Nikos Mavrogiannopoulos2019-09-281-1/+1
|\ | | | | | | | | | | | | ocsp: test suite and doc improvements Closes #836 See merge request gnutls/gnutls!1066
| * tests: added server-side verification testNikos Mavrogiannopoulos2019-09-201-1/+1
| | | | | | | | | | | | | | This tests gnutls_certificate_verify_peers2() operation in server side. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* | gnutls_session_get_data2: fix operation without a timeout callbackNikos Mavrogiannopoulos2019-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When TLS1.3 was introduced, gnutls_session_get_data2 was modified to assume that the callbacks set included the timeout one which was not previously necessary except for some special cases. This corrects that issue and makes sure that gnutls_session_get_data2() does not fail (but not necessarily succeed), if that timeout callback is not set. Resolves: #823 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | tests: mini-alignment moved to modern nettle APINikos Mavrogiannopoulos2019-09-231-1/+1
|/ | | | | | | | | That is, it no longer uses the deprecated API, and it is also removed to cipher-alignment for clarity. Resolves: #835 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* crypto-api: add gnutls_aead_cipher_{en,de}cryptv2tmp-encryptv2Daiki Ueno2019-08-091-1/+1
| | | | | | | This adds an in-place equivalent of gnutls_aead_cipher_encrypt() and gnutls_aead_cipher_decrypt(), that works on data buffers. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* iov: add iterator interface for giovec_tDaiki Ueno2019-08-091-1/+5
| | | | | | | This adds an iterator interface over giovec_t array, extracting a fixed sized block. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* pk: implement deterministic ECDSA/DSADaiki Ueno2019-08-081-1/+1
| | | | | | | This exposes the deterministic ECDSA/DSA functionality through the GNUTLS_PRIVKEY_FLAG_REPRODUCIBLE flag. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* Support for Generalname registeredID from RFC 5280 in subject alt nameKarsten Ohme2019-07-221-2/+2
| | | | | | | | | | Added test certificates (cert10.der) with registered ID Updated Makefile for inclusion of test certificates Updated SAN unknown test certificates (cert5.der) Signed-off-by: Karsten Ohme <k_o_@users.sourceforge.net>
* Merge branch 'tmp-pkcs11-login-error' into 'master'Daiki Ueno2019-07-111-1/+1
|\ | | | | | | | | pkcs11: ignore login error when traversing tokens See merge request gnutls/gnutls!1031
| * pkcs11: ignore login error when traversing tokensDaiki Ueno2019-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a token is a general access device, it is expected that login attempt to that token returns error: https://github.com/p11-glue/p11-kit/blob/master/trust/module.c#L852 On the other hand, _pkcs11_traverse_tokens treats the error as fatal and stops iteration. This behavior prevents object search without token specifier if such tokens are registered in the system. Reported by Stanislav Zidek in https://bugzilla.redhat.com/show_bug.cgi?id=1705478 Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | tests: added sanity check for rfc7633 behaviorNikos Mavrogiannopoulos2019-07-031-1/+1
| | | | | | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* | tests: status-request-missing: renamed to rfc7633-missingNikos Mavrogiannopoulos2019-07-031-1/+1
| | | | | | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | gnutls_session_get_desc: avoid printing a NULL valuetmp-fix-descNikos Mavrogiannopoulos2019-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | When gnutls_session_set_premaster() is used (under openconnect), it is possible that gnutls_session_get_desc will print a string like this: "(DTLS1.2)-(ECDHE-(null))-(AES-256-GCM)" With this change we ensure that we do not print null values. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* | gnutls_hash/hmac_copy: check its usability in all casesNikos Mavrogiannopoulos2019-06-261-0/+1
| | | | | | | | | | | | | | During the test suite run we require that all supported MAC and hash algorithms implement the copy function. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | config: added ability to override and mark algorithms as disabledNikos Mavrogiannopoulos2019-06-201-3/+15
|/ | | | | | | | | | | | | | | | | | | | | | | | | This allows the system administrator or the distributor to use the gnutls configuration file to mark hashes, signature algorithms, TLS versions, curves, groups, ciphers KX, and MAC algorithms as insecure (the last four only in the context of a TLS session). It also allows to set a minimum profile which the applications cannot fall below. The options intentionally do not allow marking algorithms as secure so that the configuration file cannot be used as an attack vector. This change also makes sure that unsupported and disabled protocols during compile time (e.g., SSL3.0), do not get listed by gnutls-cli. The configuration file feature can be disabled at compile time with an empty --with-system-priority-file. This patch it introduces the function gnutls_get_system_config_file() allowing applications to check whether a configuration file was used. Resolves: #587 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_privkey_sign_hash2: accept the GNUTLS_PRIVKEY_SIGN_FLAG_TLS1_RSA flagtmp-fix-raw-flag-in-newapiNikos Mavrogiannopoulos2019-06-101-1/+2
| | | | | | | | | | Previously this flag was ignored, although documented not to. This patch also enables the tests sign-verify-newapi and sign-verify-data-newapi which were supposed to test this interface, but were never enabled. This was caught by Andreas Metzler. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* tls13/key_update: ignore multiple key updates instead of errortmp-keyupdate-fixesDaiki Ueno2019-06-051-0/+2
| | | | | | | | This fixes the multiple KeyUpdate messages handling in commit 65e2aa80d114d4bef095d129c2eda475e473244a, where illegal_parameter is sent even if the limit doesn't exceed. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* Add test to ensure ECDH exchange behaves correctlySimo Sorce2019-05-231-1/+1
| | | | | | | This test ensures that public keys are properly tested for validity before a ECDH exchange is computed. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add test to ensure DH exchange behaves correctlySimo Sorce2019-05-231-1/+1
| | | | | | | This test ensures that public keys are properly tested for validity before a DH exchange is computed. Signed-off-by: Simo Sorce <simo@redhat.com>
* Merge branch 'tmp-privkey-tls13' into 'master'Daiki Ueno2019-05-221-1/+3
|\ | | | | | | | | | | | | server auth: disable TLS 1.3 if no signature algorithm is usable Closes #731 See merge request gnutls/gnutls!987
| * server auth: disable TLS 1.3 if no signature algorithm is usableDaiki Ueno2019-05-201-1/+3
| | | | | | | | | | | | | | | | | | | | This is a server side counterpart of 005a4d04145707daad9588acedfdb5f6cd97c80c. Instead of signalling an error when no algorithm is usable in TLS 1.3, it downgrades the session to TLS 1.2 with a warning. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | Added profile to correspond to the future security parameterNikos Mavrogiannopoulos2019-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | It seems that the FUTURE security level parameter was added without a corresponding verification profile. This patch address the issue by introducing it. Resolves: #770 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | tests: added unit tests of utc and generalTime convertorNikos Mavrogiannopoulos2019-05-201-1/+1
|/ | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* ext/record_size_limit: distinguish sending and receiving limitstmp-record-sizesDaiki Ueno2019-05-141-1/+2
| | | | | | | | | | | | | | | | The previous behavior was that both sending and receiving limits are negotiated to be the same value. It was problematic when: - client sends a record_size_limit with a large value in CH - server sends a record_size_limit with a smaller value in EE - client updates the limit for both sending and receiving, upon receiving EE - server sends a Certificate message larger than the limit With this patch, each peer maintains the sending / receiving limits separately so not to confuse with the contradicting settings. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* tests: make datefudge check robusterDaiki Ueno2019-04-191-0/+4
| | | | | | | | | When checking datefudge availability under cross-compiling environment with a binfmt wrapper, it is not sufficient to check against the host executable. This instead uses a test executable compiled for the target architecture. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* prf: add function to retrieve early keying materialDaiki Ueno2019-04-191-2/+2
| | | | | | | | | This adds a new function gnutls_prf_early, which shall be called in a handshake hook waiting for GNUTLS_HANDSHAKE_CLIENT_HELLO. The test needs to be run in a datefudge wrapper as the early secrets depend on the current time (through PSK). Signed-off-by: Daiki Ueno <dueno@redhat.com>