summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* _gnutls_x509_read_eddsa_pubkey(): sanity check the input valuestmp-cert-statusNikos Mavrogiannopoulos2018-11-151-4/+10
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* gnutls_x509_privkey_import_ecc_raw(): fail on invalid sizesNikos Mavrogiannopoulos2018-11-152-0/+13
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* doc: minor updates in elliptic curve documentationNikos Mavrogiannopoulos2018-11-154-48/+51
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* pkcs7: allow BER encoding when parsing encapContentInfo.eContentDmitry Eremin-Solenikov2018-11-141-2/+2
| | | | | | | CMS specification explicitly allows BER encoding in CMS files. RFC 4134 example 4.5 uses BER indefinite encoding. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Merge branch 'tpm12_fix_memory_leak' into 'master'Nikos Mavrogiannopoulos2018-11-131-5/+0
|\ | | | | | | | | tpm: Fix memory leak in encode_tpmkey_url See merge request gnutls/gnutls!800
| * tpm: Fix memory leak in encode_tpmkey_urlStefan Berger2018-11-121-5/+0
| | | | | | | | | | | | | | | | When returning the key URL in encode_tpm_key_url we do not need to allocate a separate buffer for the URL since we return the allocated buffer from _gnutls_buffer_to_datum(). Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
* | Merge branch 'tmp-0rtt' into 'master'Daiki Ueno2018-11-1223-143/+1132
|\ \ | | | | | | | | | | | | | | | | | | add support for 0-RTT Closes #127 See merge request gnutls/gnutls!775
| * | TLS 1.3: implement anti-replay measure using ClientHello recordingDaiki Ueno2018-11-129-2/+301
| | | | | | | | | | | | | | | | | | | | | This implements ClientHello recording outlined in section 8.2 of RFC 8446. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | db: introduce gnutls_db_set_add_functionDaiki Ueno2018-11-125-0/+31
| | | | | | | | | | | | | | | | | | | | | This adds a way to store an entry if it is not found in the database, so that the implementation can provide atomic test-and-set. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | db: introduce gnutls_db_check_entry_expire_timeDaiki Ueno2018-11-124-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would be particularly useful when the same database is used to store long-lived TLS 1.2 session data and short-lived TLS 1.3 anti-replay entries. Note that the existing gnutls_db_check_entry doesn't fit in this use-case, as it takes gnutls_session_t as the argument. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | tls13/session_ticket: record timestamp in ticketDaiki Ueno2018-11-122-4/+26
| | | | | | | | | | | | | | | | | | | | | This is needed for implementing freshness checks outlined in 8.3 of RFC 8446. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | str: suppress compiler warning when time_t is 32-bitDaiki Ueno2018-11-121-1/+1
| | | | | | | | | | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | record: introduce new API functions for early dataDaiki Ueno2018-11-114-1/+124
| | | | | | | | | | | | | | | | | | | | | | | | This introduces gnutls_record_get_max_early_data_size(), gnutls_record_send_early_data(), and gnutls_record_recv_early_data() functions. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | handshake: handle early dataDaiki Ueno2018-11-1112-108/+572
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This plumbers early data handling in the handshake processes, which consists of: - traffic key updates taking into account of client_early_traffic_secret - early data buffering in both server and client - the EndOfEarlyData message handling - making use of max_early_data_size extension in NewSessionTicket Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | session_pack: record max_early_data_size in session dataDaiki Ueno2018-11-111-2/+8
| | | | | | | | | | | | | | | | | | | | | max_early_data_size sent as part of NST should be recorded and restored when the session data is set back on the session. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | record: fix memleak when rejecting early dataDaiki Ueno2018-11-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The "discard" label previously used assumes that the decrypted record is already added to record_recv_buffer. It is not the case when rejecting early data. Release the allocated memory manually and return early. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | constate: add epoch_rel argument to _gnutls_epoch_dupDaiki Ueno2018-11-114-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary for handling early data. Previously, _gnutls_epoch_dup() copied the parameters from EPOCH_READ_CURRENT, while the client only sets EPOCH_WRITE_CURRENT when sending early data. This allows caller to specify from which epoch the parameters are copied. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | handshake: refactor early secret derivationDaiki Ueno2018-11-112-16/+8
| | | | | | | | | | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | handshake: record transcript hash for ClientHelloDaiki Ueno2018-11-112-0/+8
| | | | | | | | | | | | | | | | | | | | | This is necessary to compute client_early_traffic_secret and early_exporter_master_secret in TLS 1.3. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | ext/pre_shared_key: use predefined macros for secret labelsDaiki Ueno2018-11-112-5/+5
| |/ | | | | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | Merge branch 'tmp-f29' into 'master'Dmitry Eremin-Solenikov2018-11-124-13/+21
|\ \ | |/ |/| | | | | | | | | .gitlab-ci.yml: move to fedora29 for CI Closes #607 See merge request gnutls/gnutls!794
| * pkcs12: cleanups, and two memory leak fixesNikos Mavrogiannopoulos2018-11-101-10/+8
| | | | | | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
| * Added checks to avoid false negatives reported by static analyzersNikos Mavrogiannopoulos2018-11-102-2/+9
| | | | | | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
| * Initialize output var to avoid false negative from static analyzersNikos Mavrogiannopoulos2018-11-091-1/+4
| | | | | | | | | | | | | | This was identified by clang analyzer's on _gnutls_x509_dn_to_string and _gnutls_x509_decode_string. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* | Unconditionally include nettle/memxor.htmp-remove-gl-memxorTim Rühsen2018-11-101-5/+0
|/ | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* Merge branch 'tmp-ignore-ctypes' into 'master'Nikos Mavrogiannopoulos2018-11-021-22/+28
|\ | | | | | | | | | | | | gnutls_priority_init: ignore CTYPE-OPENPGP options Closes #593 See merge request gnutls/gnutls!789
| * gnutls_priority_init: ignore CTYPE-OPENPGP optionstmp-ignore-ctypesNikos Mavrogiannopoulos2018-11-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | In GnuTLS 3.6.0 we dropped support for openpgp keys, however the CTYPE-OPENPGP is often seen in applications, sometimes as -CTYPE-OPENPGP to ensure it is not enabled. We simply ignore this priority string when seen, to avoid preventing these applications from running. Resolves #593 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
| * gnutls_priority_init: fixed indentation according to project rulesNikos Mavrogiannopoulos2018-11-011-22/+25
| | | | | | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* | ext/record_size_limit: handle the extension in TLS 1.2 ServerHellotmp-fix-record-size-limit-tls12Daiki Ueno2018-11-011-1/+1
|/ | | | | | | Previously it had assumed that TLS 1.2 servers don't send the extension, while actually it can be present in ServerHello. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* gnutls_priority_set: re-organizedtmp-fix-priority-setNikos Mavrogiannopoulos2018-10-311-22/+22
| | | | | | | | | The sanity tests we moved prior to setting these priorities and the %GNUTLS_E_NO_PRIORITIES_WERE_SET error code is returned consistently to indicate that the existing priorities were not overwritten. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_priority_set: do not override the version after handshake is completeNikos Mavrogiannopoulos2018-10-301-4/+6
| | | | | | | | | | | When an application would re-set priorities prior to a rehandshake we would override the negotiated version with the highest supported, something which may lead to issues. This disables that unnecessary version override. See: https://bugzilla.redhat.com/show_bug.cgi?id=1634736 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* self-tests: add GOST public key testsDmitry Eremin-Solenikov2018-10-291-2/+88
| | | | | | | | | | Test vectors provided in standard are not that usefull (they use unsupported curves with a != -3), so these test vectors were generated by hand. Fixes #492 Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Add selftests for CMACSimo Sorce2018-10-282-0/+29
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Vendor in CMAC functionality from NettleSimo Sorce2018-10-284-0/+359
| | | | | | | | If nettle's CMAC is not available, use a vendored in version from master. This is necessary as long as we need to link against 3.4 for ABI compatibility reasons. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add CMAC SupportSimo Sorce2018-10-283-0/+44
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* self-tests: add GOST symmetric algorithms testsDmitry Eremin-Solenikov2018-10-281-0/+197
| | | | | | | | | | Add tests for: - GOST 28147-89 CFB cipher - GOST R 34.11-94 hash function - Streebog-256/-512 hash functions - HMAC using GOST R 34.11-94/Streebog functions Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* nettle: fix s-boxes selection for rare GOST 28147-89 variantsDmitry Eremin-Solenikov2018-10-281-3/+3
| | | | | | | gost28147-89 code contained c&p error, which resulted in using S-BOX CryptoPro-A instead of -B, -C, -D. Fix that. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Merge branch 'cfb8' into 'master'Dmitry Eremin-Solenikov2018-10-268-1/+363
|\ | | | | | | | | | | | | Add support for AES CFB8 cipher Closes #357 See merge request gnutls/gnutls!783
| * Add selftest for CFB8Simo Sorce2018-10-253-0/+80
| |
| * Vendor in CFB8 functionality from NettleSimo Sorce2018-10-244-1/+219
| | | | | | | | | | | | | | | | If nettle's CFB8 is not available, use a vendored in version from master. This is necessary as long as we need to link against 3.4 for ABI compatibility reasons. Signed-off-by: Simo Sorce <simo@redhat.com>
| * Add AES-CFB8 SupportSimo Sorce2018-10-242-0/+64
| | | | | | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* | ext/pre_shared_key: don't assume ob_ticket_age < ticket_age_addtmp-session-ticket-timestampDaiki Ueno2018-10-261-6/+0
| | | | | | | | | | | | | | Previously, the server treated the condition as error, while it is possible that ob_ticket_age may have wrapped round by 2^32. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | tls13/session_ticket: calculate ticket_age in millisecondsDaiki Ueno2018-10-264-12/+19
| | | | | | | | | | | | | | | | Previously we calculated ticket age from the current wall clock in seconds, multiplying by 1000. This is conceptually wrong, because ticket age is designed to be in milliseconds. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | str: add macros to encode/decode struct timespec valueDaiki Ueno2018-10-261-0/+42
| | | | | | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | system: provide a means to replace gettime implementationDaiki Ueno2018-10-2610-30/+45
| | | | | | | | | | | | | | | | | | While gettime() is extensively used in the code, the library previously hadn't provided a way to replace it for testing. This adds a new internal function _gnutls_global_set_gettime_function and makes use of it through virt-time.h. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | _gnutls_timespec_cmp: new inline functionDaiki Ueno2018-10-251-0/+12
| | | | | | | | Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | tls13/session_ticket: rename tls13_ticket_t type to tls13_ticket_stDaiki Ueno2018-10-255-19/+19
|/ | | | | | This is consistent with the coding guideline. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* Merge branch 'tmp-fix-fips-mode' into 'master'Nikos Mavrogiannopoulos2018-10-241-0/+10
|\ | | | | | | | | fips140: aligned code with documentation See merge request gnutls/gnutls!781
| * fips140: aligned code with documentationtmp-fix-fips-modeNikos Mavrogiannopoulos2018-10-231-0/+10
| | | | | | | | | | | | | | That is, we introduce the documented but unimplemented macros GNUTLS_FIPS140_SET_LAX_MODE() and GNUTLS_FIPS140_SET_STRICT_MODE(). Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* | p11tool: fix initialization of security officer's PINtmp-initialize-so-pin-fixNikos Mavrogiannopoulos2018-10-243-14/+47
|/ | | | | | | | | | | | Previously we would call gnutls_pkcs11_token_set_pin() without an old PIN provided, which will result to the use of C_InitPIN() on the underlying module. The C_InitPIN() in contrast with C_SetPIN() will only work for the user and not for the administrator. As such, we always provide the oldpin for when we change the admin's PIN. Resolves #561 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>