]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
7 years agoanti_replay: moved new add function into anti_replay structure
Nikos Mavrogiannopoulos [Wed, 14 Nov 2018 12:56:52 +0000 (13:56 +0100)] 
anti_replay: moved new add function into anti_replay structure

The new function was not sharing anything with the existing
gnutls_db_* backend, and moving it to anti_replay structure
is more clean and allows for deviations from the old API
conventions (e.g., now we can pass pointers for efficiency
and pass the expiration time as part of the call).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years ago_gnutls_x509_read_eddsa_pubkey(): sanity check the input values
Nikos Mavrogiannopoulos [Tue, 13 Nov 2018 21:49:26 +0000 (22:49 +0100)] 
_gnutls_x509_read_eddsa_pubkey(): sanity check the input values

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agognutls_x509_privkey_import_ecc_raw(): fail on invalid sizes
Nikos Mavrogiannopoulos [Tue, 13 Nov 2018 08:24:06 +0000 (09:24 +0100)] 
gnutls_x509_privkey_import_ecc_raw(): fail on invalid sizes

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agotests: verify whether certificate request levels behave consistently
Nikos Mavrogiannopoulos [Sun, 11 Nov 2018 07:25:56 +0000 (08:25 +0100)] 
tests: verify whether certificate request levels behave consistently

This verifies whether the behavior of GNUTLS_CERT_IGNORE, GNUTLS_CERT_REQUEST
and GNUTLS_CERT_REQUIRE is consistent accross protocols.

Relates #615

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agodoc: minor updates in elliptic curve documentation
Nikos Mavrogiannopoulos [Sun, 11 Nov 2018 07:52:13 +0000 (08:52 +0100)] 
doc: minor updates in elliptic curve documentation

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agotests: added a test for detecting duplicate early data
Nikos Mavrogiannopoulos [Wed, 14 Nov 2018 12:42:01 +0000 (13:42 +0100)] 
tests: added a test for detecting duplicate early data

Resolves #610

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'pkcs7-ber' into 'master'
Dmitry Eremin-Solenikov [Wed, 14 Nov 2018 14:04:56 +0000 (14:04 +0000)] 
Merge branch 'pkcs7-ber' into 'master'

pkcs7: allow BER encoding when parsing encapContentInfo.eContent

See merge request gnutls/gnutls!803

7 years agotests: add testfile from RFC4134 Section 4.5
Dmitry Eremin-Solenikov [Tue, 13 Nov 2018 22:43:05 +0000 (01:43 +0300)] 
tests: add testfile from RFC4134 Section 4.5

Add test example demonstrating indefinite-length BER encoding of PKCS#7
data.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agopkcs7: allow BER encoding when parsing encapContentInfo.eContent
Dmitry Eremin-Solenikov [Mon, 12 Nov 2018 00:34:31 +0000 (03:34 +0300)] 
pkcs7: allow BER encoding when parsing encapContentInfo.eContent

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>
7 years agoMerge branch 'tmp-autogen-bak' into 'master'
Nikos Mavrogiannopoulos [Wed, 14 Nov 2018 08:29:17 +0000 (08:29 +0000)] 
Merge branch 'tmp-autogen-bak' into 'master'

build: remove autogen .bak files from repository

See merge request gnutls/gnutls!801

7 years agoMerge branch 'no-session-ticket' into 'master'
Nikos Mavrogiannopoulos [Wed, 14 Nov 2018 08:16:19 +0000 (08:16 +0000)] 
Merge branch 'no-session-ticket' into 'master'

configure.ac: drop obsolete info line

Closes #616

See merge request gnutls/gnutls!804

7 years agoconfigure.ac: drop obsolete info line
Dmitry Eremin-Solenikov [Tue, 13 Nov 2018 22:49:08 +0000 (01:49 +0300)] 
configure.ac: drop obsolete info line

Since 4b567871 there is no `ac_enable_session_tickets` variable, so
let's drop obsolete remnants.

Closes #616

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Noted-by: Dilyan Palauzov
7 years agobuild: minor cleanup of mech-list.h generation
Daiki Ueno [Tue, 13 Nov 2018 09:07:09 +0000 (10:07 +0100)] 
build: minor cleanup of mech-list.h generation

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoREADME-ci.freebsd.md: require autogen
Daiki Ueno [Tue, 13 Nov 2018 09:02:17 +0000 (10:02 +0100)] 
README-ci.freebsd.md: require autogen

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agobuild: remove autogen .bak files from the repository
Daiki Ueno [Mon, 12 Nov 2018 12:41:19 +0000 (13:41 +0100)] 
build: remove autogen .bak files from the repository

While the .bak files are necessary for not requiring autogen on
deployment environment, they are not needed for development and may
cause conflict when other developers use different version of
autogen. This removes those files from the repository and require
autogen at make dist time.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agobuild: use suffix rules for generating .bak files
Daiki Ueno [Mon, 12 Nov 2018 14:48:44 +0000 (15:48 +0100)] 
build: use suffix rules for generating .bak files

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agobuild: use AM_MISSING_PROG for autogen
Daiki Ueno [Mon, 12 Nov 2018 14:48:14 +0000 (15:48 +0100)] 
build: use AM_MISSING_PROG for autogen

That makes error message more friendly when autogen is not installed
on developing environment.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoMerge branch 'tpm12_fix_memory_leak' into 'master'
Nikos Mavrogiannopoulos [Tue, 13 Nov 2018 05:07:01 +0000 (05:07 +0000)] 
Merge branch 'tpm12_fix_memory_leak' into 'master'

tpm: Fix memory leak in encode_tpmkey_url

See merge request gnutls/gnutls!800

7 years agotpm: Fix memory leak in encode_tpmkey_url
Stefan Berger [Mon, 12 Nov 2018 14:20:44 +0000 (09:20 -0500)] 
tpm: Fix memory leak in encode_tpmkey_url

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>
7 years agoMerge branch 'tmp-0rtt' into 'master'
Daiki Ueno [Mon, 12 Nov 2018 15:54:01 +0000 (15:54 +0000)] 
Merge branch 'tmp-0rtt' into 'master'

add support for 0-RTT

Closes #127

See merge request gnutls/gnutls!775

7 years agoMerge branch 'tmp-f29' into 'master'
Dmitry Eremin-Solenikov [Mon, 12 Nov 2018 15:41:47 +0000 (15:41 +0000)] 
Merge branch 'tmp-f29' into 'master'

.gitlab-ci.yml: move to fedora29 for CI

Closes #607

See merge request gnutls/gnutls!794

7 years agodoc: mention 0-RTT
Daiki Ueno [Mon, 15 Oct 2018 11:35:43 +0000 (13:35 +0200)] 
doc: mention 0-RTT

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoserv: enable anti-replay when early data is used
Daiki Ueno [Sun, 21 Oct 2018 05:34:07 +0000 (07:34 +0200)] 
serv: enable anti-replay when early data is used

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoTLS 1.3: implement anti-replay measure using ClientHello recording
Daiki Ueno [Fri, 19 Oct 2018 15:52:48 +0000 (17:52 +0200)] 
TLS 1.3: implement anti-replay measure using ClientHello recording

This implements ClientHello recording outlined in section 8.2 of RFC
8446.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agodb: introduce gnutls_db_set_add_function
Daiki Ueno [Thu, 1 Nov 2018 14:37:42 +0000 (15:37 +0100)] 
db: introduce gnutls_db_set_add_function

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>
7 years agodb: introduce gnutls_db_check_entry_expire_time
Daiki Ueno [Thu, 8 Nov 2018 16:54:11 +0000 (17:54 +0100)] 
db: introduce gnutls_db_check_entry_expire_time

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>
7 years agotls13/session_ticket: record timestamp in ticket
Daiki Ueno [Mon, 22 Oct 2018 13:26:07 +0000 (15:26 +0200)] 
tls13/session_ticket: record timestamp in ticket

This is needed for implementing freshness checks outlined in 8.3 of
RFC 8446.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agostr: suppress compiler warning when time_t is 32-bit
Daiki Ueno [Thu, 8 Nov 2018 14:46:42 +0000 (15:46 +0100)] 
str: suppress compiler warning when time_t is 32-bit

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agotestcompat-tls13-openssl: exercise early data transmission
Daiki Ueno [Mon, 22 Oct 2018 09:12:02 +0000 (11:12 +0200)] 
testcompat-tls13-openssl: exercise early data transmission

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agotests: add tests for early data
Daiki Ueno [Mon, 15 Oct 2018 09:29:56 +0000 (11:29 +0200)] 
tests: add tests for early data

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agocli: add --earlydata option
Daiki Ueno [Fri, 12 Oct 2018 11:33:13 +0000 (13:33 +0200)] 
cli: add --earlydata option

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoserv: add --earlydata option
Daiki Ueno [Fri, 12 Oct 2018 11:33:00 +0000 (13:33 +0200)] 
serv: add --earlydata option

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agorecord: introduce new API functions for early data
Daiki Ueno [Fri, 12 Oct 2018 11:34:21 +0000 (13:34 +0200)] 
record: introduce new API functions for early data

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>
7 years agohandshake: handle early data
Daiki Ueno [Fri, 12 Oct 2018 09:45:59 +0000 (11:45 +0200)] 
handshake: handle early data

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>
7 years agosession_pack: record max_early_data_size in session data
Daiki Ueno [Sun, 28 Oct 2018 06:57:34 +0000 (07:57 +0100)] 
session_pack: record max_early_data_size in session data

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>
7 years agorecord: fix memleak when rejecting early data
Daiki Ueno [Sun, 28 Oct 2018 06:57:57 +0000 (07:57 +0100)] 
record: fix memleak when rejecting early data

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>
7 years agoconstate: add epoch_rel argument to _gnutls_epoch_dup
Daiki Ueno [Fri, 12 Oct 2018 15:10:51 +0000 (17:10 +0200)] 
constate: add epoch_rel argument to _gnutls_epoch_dup

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>
7 years agohandshake: refactor early secret derivation
Daiki Ueno [Fri, 12 Oct 2018 09:29:57 +0000 (11:29 +0200)] 
handshake: refactor early secret derivation

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agohandshake: record transcript hash for ClientHello
Daiki Ueno [Fri, 5 Oct 2018 08:41:23 +0000 (10:41 +0200)] 
handshake: record transcript hash for ClientHello

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>
7 years agoext/pre_shared_key: use predefined macros for secret labels
Daiki Ueno [Fri, 5 Oct 2018 09:13:24 +0000 (11:13 +0200)] 
ext/pre_shared_key: use predefined macros for secret labels

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoMerge branch 'args-std-def' into 'master'
Tim Rühsen [Sat, 10 Nov 2018 19:13:44 +0000 (19:13 +0000)] 
Merge branch 'args-std-def' into 'master'

src: args-std.def: substitute variables using configure

Closes #567

See merge request gnutls/gnutls!793

7 years agoMerge branch 'tmp-remove-gl-memxor' into 'master'
Nikos Mavrogiannopoulos [Sat, 10 Nov 2018 16:09:28 +0000 (16:09 +0000)] 
Merge branch 'tmp-remove-gl-memxor' into 'master'

Unconditionally include nettle/memxor.h

Closes #605

See merge request gnutls/gnutls!797

7 years agoUnconditionally include nettle/memxor.h
Tim Rühsen [Tue, 6 Nov 2018 08:38:43 +0000 (09:38 +0100)] 
Unconditionally include nettle/memxor.h

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agognutls-cli: use assert to mark impossible path
Nikos Mavrogiannopoulos [Sat, 10 Nov 2018 09:54:32 +0000 (10:54 +0100)] 
gnutls-cli: use assert to mark impossible path

This avoids static analyzers from complaining.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agopkcs12: cleanups, and two memory leak fixes
Nikos Mavrogiannopoulos [Sat, 10 Nov 2018 06:46:24 +0000 (07:46 +0100)] 
pkcs12: cleanups, and two memory leak fixes

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agotls13: use system's openssl for interop testing
Nikos Mavrogiannopoulos [Fri, 9 Nov 2018 06:44:02 +0000 (07:44 +0100)] 
tls13: use system's openssl for interop testing

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoAdded checks to avoid false negatives reported by static analyzers
Nikos Mavrogiannopoulos [Fri, 9 Nov 2018 19:11:42 +0000 (20:11 +0100)] 
Added checks to avoid false negatives reported by static analyzers

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agosrc: update autogenerated .bak files 793/head
Dmitry Eremin-Solenikov [Tue, 6 Nov 2018 11:47:41 +0000 (14:47 +0300)] 
src: update autogenerated .bak files

Update files to include proper year, version, etc.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agosrc: include .bak files in EXTRA_DIST
Dmitry Eremin-Solenikov [Tue, 6 Nov 2018 11:42:56 +0000 (14:42 +0300)] 
src: include .bak files in EXTRA_DIST

Including .bak files in EXTRA_DIST allows us to stop hand-generating
these files in distribution. Instead they are directly copied from the
source tree.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agosrc: update .bak files during -args.c/.h regeneration
Dmitry Eremin-Solenikov [Tue, 6 Nov 2018 11:34:18 +0000 (14:34 +0300)] 
src: update .bak files during -args.c/.h regeneration

To ease updating of .bak files, update them when regenerating
Autogen'erated source files.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agodoc: fix texi generation in out-of-tree builds
Dmitry Eremin-Solenikov [Tue, 6 Nov 2018 09:01:49 +0000 (12:01 +0300)] 
doc: fix texi generation in out-of-tree builds

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agosrc: mark autogen'ed sources as nodist_
Dmitry Eremin-Solenikov [Tue, 6 Nov 2018 07:52:47 +0000 (10:52 +0300)] 
src: mark autogen'ed sources as nodist_

Mark autogenerated sources as not distributable. We are distributing
.bak files instead.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoMakefile.am: drop manpages regeneration from dist-hook
Dmitry Eremin-Solenikov [Mon, 5 Nov 2018 13:37:02 +0000 (16:37 +0300)] 
Makefile.am: drop manpages regeneration from dist-hook

There is no need anymore to regenerate tools manpages, they will be
generated automatically from doc/manpages/Makefile.am.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agomanpages: fix manpages distribution
Dmitry Eremin-Solenikov [Mon, 5 Nov 2018 13:22:25 +0000 (16:22 +0300)] 
manpages: fix manpages distribution

It seems that dist_man_MANS does not work properly with Automake
conditionals. Automake will not distribute files which are conditionally
disabled at this make run. As released tarballs include all manpages
already, let's include them unconditionally.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agomanpages: fix tools manpages generation
Dmitry Eremin-Solenikov [Mon, 5 Nov 2018 12:02:50 +0000 (15:02 +0300)] 
manpages: fix tools manpages generation

Pass additional include path to let autogen find common arguments
template.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agomanpages: un-unroll the loop
Dmitry Eremin-Solenikov [Mon, 5 Nov 2018 11:53:46 +0000 (14:53 +0300)] 
manpages: un-unroll the loop

Replace unrolled loop over header files with for-loop to simplify
Makefile.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoconfigure.ac: merge autogen/libopts checks
Dmitry Eremin-Solenikov [Mon, 5 Nov 2018 11:30:53 +0000 (14:30 +0300)] 
configure.ac: merge autogen/libopts checks

Move handling of autogen/libopts to a single place. Enforce usage of
local libopts if autogen is not found.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agodoc: fix documentation generation in out-of-tree builds
Dmitry Eremin-Solenikov [Mon, 5 Nov 2018 10:12:51 +0000 (13:12 +0300)] 
doc: fix documentation generation in out-of-tree builds

gtk-doc will not process gnutls.h.in file, so we need to point it to
generated gnutls.h file, found inside builddir.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agocfg.mk: fix ChangeLog generation on out-of-tree builds
Dmitry Eremin-Solenikov [Sun, 4 Nov 2018 21:43:55 +0000 (00:43 +0300)] 
cfg.mk: fix ChangeLog generation on out-of-tree builds

ChangeLog regeneration does not work for out-of-tree build, so let's fix
that.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agosrc: args-std.def: substitute variables using configure
Dmitry Eremin-Solenikov [Sun, 4 Nov 2018 11:29:11 +0000 (14:29 +0300)] 
src: args-std.def: substitute variables using configure

Use standard way (configure script) to substiture variables in
args-std.def file, instead of manually replacing them in dist-hook.

Fixes #567

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoInitialize output var to avoid false negative from static analyzers
Nikos Mavrogiannopoulos [Fri, 9 Nov 2018 19:07:24 +0000 (20:07 +0100)] 
Initialize output var to avoid false negative from static analyzers

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>
7 years ago.gitlab-ci.yml: move to fedora29 for CI
Nikos Mavrogiannopoulos [Mon, 5 Nov 2018 19:51:33 +0000 (20:51 +0100)] 
.gitlab-ci.yml: move to fedora29 for CI

This also moves the x86 CI builds to the debian cross infrastructure
as we have a more reliable way of generating a 32-bit image.

Resolves #607

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agotpmtool: Support --srk-well-known for SRK with 20 zero bytes password
Stefan Berger [Fri, 2 Nov 2018 22:33:32 +0000 (18:33 -0400)] 
tpmtool: Support --srk-well-known for SRK with 20 zero bytes password

Implement --srk-well-known for SRK with 20 zero bytes password.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
7 years agoMerge branch 'tmp-fix-ci-runs' into 'master'
Dmitry Eremin-Solenikov [Fri, 9 Nov 2018 00:27:34 +0000 (00:27 +0000)] 
Merge branch 'tmp-fix-ci-runs' into 'master'

This fixes the recent issue with openssl interop testing in CI

See merge request gnutls/gnutls!798

7 years agotestcompat-openssl: do not test DSS or small curves with 1.1.1
Nikos Mavrogiannopoulos [Wed, 7 Nov 2018 08:56:56 +0000 (09:56 +0100)] 
testcompat-openssl: do not test DSS or small curves with 1.1.1

DSA uses 1024-bit parameters, and these together with curves of
less than 256 bits are not accepted by debian's openssl.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agodoc/credentials: increased key size in RSA client cert
Nikos Mavrogiannopoulos [Wed, 7 Nov 2018 09:20:32 +0000 (10:20 +0100)] 
doc/credentials: increased key size in RSA client cert

This is used by the test suite and recent openssl in debian requires
a larger certificates.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agocerttool: allow --update-certificate to replace public key
Nikos Mavrogiannopoulos [Wed, 7 Nov 2018 09:16:10 +0000 (10:16 +0100)] 
certtool: allow --update-certificate to replace public key

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoREADME.md: updated instructions to apply to fedora29
Nikos Mavrogiannopoulos [Wed, 7 Nov 2018 07:37:23 +0000 (08:37 +0100)] 
README.md: updated instructions to apply to fedora29

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-ignore-ctypes' into 'master'
Nikos Mavrogiannopoulos [Fri, 2 Nov 2018 13:41:46 +0000 (13:41 +0000)] 
Merge branch 'tmp-ignore-ctypes' into 'master'

gnutls_priority_init: ignore CTYPE-OPENPGP options

Closes #593

See merge request gnutls/gnutls!789

7 years agoMerge branch 'tmp-fix-record-size-limit-tls12' into 'master'
Nikos Mavrogiannopoulos [Fri, 2 Nov 2018 06:32:38 +0000 (06:32 +0000)] 
Merge branch 'tmp-fix-record-size-limit-tls12' into 'master'

ext/record_size_limit: handle the extension in TLS 1.2 ServerHello

Closes #599

See merge request gnutls/gnutls!791

7 years agoMerge branch 'ajuaristi-update-docs' into 'master'
Nikos Mavrogiannopoulos [Thu, 1 Nov 2018 20:54:22 +0000 (20:54 +0000)] 
Merge branch 'ajuaristi-update-docs' into 'master'

Update docs for session ticket key rotation

Closes #581

See merge request gnutls/gnutls!768

7 years agoUpdate docs for session ticket key rotation [ci skip]
Ander Juaristi [Thu, 4 Oct 2018 12:57:47 +0000 (14:57 +0200)] 
Update docs for session ticket key rotation [ci skip]

Fix #581.

Signed-off-by: Ander Juaristi <a@juaristi.eus>
7 years agoext/record_size_limit: handle the extension in TLS 1.2 ServerHello
Daiki Ueno [Thu, 1 Nov 2018 12:43:17 +0000 (13:43 +0100)] 
ext/record_size_limit: handle the extension in TLS 1.2 ServerHello

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>
7 years agognutls_priority_init: ignore CTYPE-OPENPGP options
Nikos Mavrogiannopoulos [Tue, 30 Oct 2018 18:56:47 +0000 (19:56 +0100)] 
gnutls_priority_init: ignore CTYPE-OPENPGP options

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>
7 years agognutls_priority_init: fixed indentation according to project rules
Nikos Mavrogiannopoulos [Tue, 30 Oct 2018 18:46:09 +0000 (19:46 +0100)] 
gnutls_priority_init: fixed indentation according to project rules

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMerge branch 'tmp-fix-priority-set' into 'master'
Nikos Mavrogiannopoulos [Wed, 31 Oct 2018 09:34:52 +0000 (09:34 +0000)] 
Merge branch 'tmp-fix-priority-set' into 'master'

gnutls_priority_set: do not override the version after handshake is complete

See merge request gnutls/gnutls!777

7 years agognutls_priority_set: re-organized
Nikos Mavrogiannopoulos [Fri, 19 Oct 2018 10:04:29 +0000 (12:04 +0200)] 
gnutls_priority_set: re-organized

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>
7 years agognutls_priority_set: do not override the version after handshake is complete
Nikos Mavrogiannopoulos [Wed, 17 Oct 2018 12:53:47 +0000 (14:53 +0200)] 
gnutls_priority_set: do not override the version after handshake is complete

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>
7 years agognutls-serv: use default priorities when none are given
Nikos Mavrogiannopoulos [Tue, 30 Oct 2018 09:28:20 +0000 (10:28 +0100)] 
gnutls-serv: use default priorities when none are given

This makes it in par with gnutls-cli.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-cli-reduce-output' into 'master'
Dmitry Eremin-Solenikov [Tue, 30 Oct 2018 08:14:50 +0000 (08:14 +0000)] 
Merge branch 'tmp-cli-reduce-output' into 'master'

gnutls-cli: reduce printed session information

See merge request gnutls/gnutls!784

7 years agoMerge branch 'gost-selfcheck' into 'master'
Dmitry Eremin-Solenikov [Mon, 29 Oct 2018 16:04:36 +0000 (16:04 +0000)] 
Merge branch 'gost-selfcheck' into 'master'

self-tests: add GOST public key tests

Closes #492

See merge request gnutls/gnutls!788

7 years agoself-tests: add GOST public key tests
Dmitry Eremin-Solenikov [Sun, 28 Oct 2018 22:42:28 +0000 (01:42 +0300)] 
self-tests: add GOST public key tests

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>
7 years agoNEWS: added CMAC entries [ci skip]
Nikos Mavrogiannopoulos [Mon, 29 Oct 2018 06:24:01 +0000 (07:24 +0100)] 
NEWS: added CMAC entries [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMerge branch 'cmac' into 'master'
Dmitry Eremin-Solenikov [Mon, 29 Oct 2018 00:48:55 +0000 (00:48 +0000)] 
Merge branch 'cmac' into 'master'

Add support for AES CMAC mac

Closes #351

See merge request gnutls/gnutls!786

7 years agoAdd NEWS entry about AES-CMAC
Simo Sorce [Sun, 28 Oct 2018 16:19:46 +0000 (12:19 -0400)] 
Add NEWS entry about AES-CMAC

Signed-off-by: Simo Sorce <simo@redhat.com>
7 years agoAdd selftests for CMAC
Simo Sorce [Fri, 26 Oct 2018 20:55:27 +0000 (16:55 -0400)] 
Add selftests for CMAC

Signed-off-by: Simo Sorce <simo@redhat.com>
7 years agoVendor in CMAC functionality from Nettle
Simo Sorce [Fri, 26 Oct 2018 17:38:13 +0000 (13:38 -0400)] 
Vendor in CMAC functionality from Nettle

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>
7 years agoAdd CMAC Support
Simo Sorce [Fri, 26 Oct 2018 17:22:23 +0000 (13:22 -0400)] 
Add CMAC Support

Signed-off-by: Simo Sorce <simo@redhat.com>
7 years agoMerge branch 'gost-selfcheck' into 'master'
Nikos Mavrogiannopoulos [Sun, 28 Oct 2018 16:41:18 +0000 (16:41 +0000)] 
Merge branch 'gost-selfcheck' into 'master'

Selftests for symmetric GOST algorithms

See merge request gnutls/gnutls!787

7 years agoNEWS: Add entry mentioning fix of S-BOXes for CryptoPro-B,-C,-D variants
Dmitry Eremin-Solenikov [Sun, 28 Oct 2018 12:44:15 +0000 (15:44 +0300)] 
NEWS: Add entry mentioning fix of S-BOXes for CryptoPro-B,-C,-D variants

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoself-tests: add GOST symmetric algorithms tests
Dmitry Eremin-Solenikov [Sun, 28 Oct 2018 07:13:00 +0000 (10:13 +0300)] 
self-tests: add GOST symmetric algorithms tests

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>
7 years agonettle: fix s-boxes selection for rare GOST 28147-89 variants
Dmitry Eremin-Solenikov [Sun, 28 Oct 2018 07:11:21 +0000 (10:11 +0300)] 
nettle: fix s-boxes selection for rare GOST 28147-89 variants

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>
7 years agodoc update [ci skip]
Nikos Mavrogiannopoulos [Fri, 26 Oct 2018 20:50:52 +0000 (22:50 +0200)] 
doc update [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMerge branch 'cfb8' into 'master'
Dmitry Eremin-Solenikov [Fri, 26 Oct 2018 14:15:16 +0000 (14:15 +0000)] 
Merge branch 'cfb8' into 'master'

Add support for AES CFB8 cipher

Closes #357

See merge request gnutls/gnutls!783

7 years agoMerge branch 'tmp-session-ticket-timestamp' into 'master'
Nikos Mavrogiannopoulos [Fri, 26 Oct 2018 13:43:22 +0000 (13:43 +0000)] 
Merge branch 'tmp-session-ticket-timestamp' into 'master'

TLS 1.3: calculate ticket age based on higher precision time

See merge request gnutls/gnutls!785

7 years agoext/pre_shared_key: don't assume ob_ticket_age < ticket_age_add
Daiki Ueno [Wed, 24 Oct 2018 11:08:45 +0000 (13:08 +0200)] 
ext/pre_shared_key: don't assume ob_ticket_age < ticket_age_add

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>
7 years agotls13/session_ticket: calculate ticket_age in milliseconds
Daiki Ueno [Thu, 25 Oct 2018 10:32:52 +0000 (12:32 +0200)] 
tls13/session_ticket: calculate ticket_age in milliseconds

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>
7 years agostr: add macros to encode/decode struct timespec value
Daiki Ueno [Fri, 26 Oct 2018 06:18:01 +0000 (08:18 +0200)] 
str: add macros to encode/decode struct timespec value

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agosystem: provide a means to replace gettime implementation
Daiki Ueno [Thu, 25 Oct 2018 11:47:13 +0000 (13:47 +0200)] 
system: provide a means to replace gettime implementation

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>
7 years agoAdd selftest for CFB8
Simo Sorce [Wed, 24 Oct 2018 19:45:23 +0000 (15:45 -0400)] 
Add selftest for CFB8