]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
5 years agoCI pipeline rework - using stages and inheritance
Stanislav Zidek [Fri, 27 Nov 2020 12:24:24 +0000 (13:24 +0100)] 
CI pipeline rework - using stages and inheritance

Signed-off-by: Stanislav Zidek <szidek@redhat.com>
5 years agoMerge branch 'mcatanzaro/getissuer_func_docs' into 'master'
Daiki Ueno [Tue, 1 Dec 2020 06:37:55 +0000 (06:37 +0000)] 
Merge branch 'mcatanzaro/getissuer_func_docs' into 'master'

x509: Improve documentation of new set_getissuer_function

See merge request gnutls/gnutls!1365

5 years agox509: Improve documentation of new set_getissuer_function
Michael Catanzaro [Mon, 30 Nov 2020 19:08:01 +0000 (13:08 -0600)] 
x509: Improve documentation of new set_getissuer_function

Since gnutls!1354, some of this information is now obsolete. The caller
is no longer responsible for verifying the certificate or adding it to
the trust list. GnuTLS will now handle that. Instead, the callback
should always import the missing certificate and return success if the
certificate was imported, or failure otherwise.

Also, let's point to gnutls_x509_crt_get_authority_info_access(), since
it is useful in combination with this function.

Finally, since this callback is emitted once for each missing
intermediate certificate, it's probably less confusing if we talk about
only a single missing intermediate here. Yes, there could be multiple
missing certificates, but a single invocation of this callback can only
deal with one.

Signed-off-by: Michael Catanzaro <mcatanzaro@gnome.org>
5 years agofuzz: limit the retry count in handshake fuzzer
Daiki Ueno [Sun, 29 Nov 2020 17:17:54 +0000 (18:17 +0100)] 
fuzz: limit the retry count in handshake fuzzer

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognutls_handshake_write: don't enqueue empty Handshake message
Daiki Ueno [Sun, 29 Nov 2020 16:44:24 +0000 (17:44 +0100)] 
gnutls_handshake_write: don't enqueue empty Handshake message

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agofuzz: fix undefined behavior on left shift
Daiki Ueno [Sun, 29 Nov 2020 15:51:45 +0000 (16:51 +0100)] 
fuzz: fix undefined behavior on left shift

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/verify-tofu-cstore' into 'master'
Daiki Ueno [Thu, 26 Nov 2020 05:00:18 +0000 (05:00 +0000)] 
Merge branch 'wip/dueno/verify-tofu-cstore' into 'master'

verify-tofu: return errors from store functions if callback fails

Closes #1092

See merge request gnutls/gnutls!1361

5 years agoMerge branch 'update_openssl' into 'master'
Daiki Ueno [Wed, 25 Nov 2020 06:23:58 +0000 (06:23 +0000)] 
Merge branch 'update_openssl' into 'master'

Update openssl submodule to fix backtrace info

See merge request gnutls/gnutls!1362

5 years agoaccelerated: Re-generate assembly sources
Anderson Toshiyuki Sasaki [Tue, 24 Nov 2020 10:13:07 +0000 (11:13 +0100)] 
accelerated: Re-generate assembly sources

Re-generate assembly sources from the updated openssl submodule.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
5 years agoverify-tofu: return errors from store functions if callback fails
Daiki Ueno [Tue, 24 Nov 2020 09:54:06 +0000 (10:54 +0100)] 
verify-tofu: return errors from store functions if callback fails

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agodevel: Update openssl submodule
Anderson Toshiyuki Sasaki [Tue, 24 Nov 2020 09:46:12 +0000 (10:46 +0100)] 
devel: Update openssl submodule

Update openssl submodule to current OpenSSL_1_1_1-stable branch
(8e813c085a).

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
5 years agoconfigure.ac: include <libguile.h> when checking scm_* functions
Daiki Ueno [Mon, 23 Nov 2020 06:49:04 +0000 (07:49 +0100)] 
configure.ac: include <libguile.h> when checking scm_* functions

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/aia-api' into 'master'
Daiki Ueno [Sat, 21 Nov 2020 16:46:37 +0000 (16:46 +0000)] 
Merge branch 'wip/dueno/aia-api' into 'master'

x509: check certificate trust status when adding CA through AIA

Closes #1100

See merge request gnutls/gnutls!1354

5 years agoMerge branch 'wip/dueno/disable-cipher-override' into 'master'
Daiki Ueno [Fri, 20 Nov 2020 06:43:10 +0000 (06:43 +0000)] 
Merge branch 'wip/dueno/disable-cipher-override' into 'master'

crypto-backend: remove ability of overriding ciphers

Closes #790

See merge request gnutls/gnutls!1355

5 years agocrypto-backend: remove ability of overriding ciphers
Daiki Ueno [Thu, 12 Nov 2020 05:49:12 +0000 (06:49 +0100)] 
crypto-backend: remove ability of overriding ciphers

Those functions has been deprecated in 3.6.9 as they do not have
active use cases.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/quic' into 'master'
Daiki Ueno [Thu, 19 Nov 2020 19:04:26 +0000 (19:04 +0000)] 
Merge branch 'wip/dueno/quic' into 'master'

Add QUIC related API functions

Closes #850, #849, and #826

See merge request gnutls/gnutls!1353

5 years agoNEWS: add entry for QUIC related API functions
Daiki Ueno [Mon, 9 Nov 2020 09:11:04 +0000 (10:11 +0100)] 
NEWS: add entry for QUIC related API functions

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agofuzz: fuzz gnutls_handshake_write
Daiki Ueno [Mon, 9 Nov 2020 08:05:05 +0000 (09:05 +0100)] 
fuzz: fuzz gnutls_handshake_write

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoalert: add callback to intercept alert messages
Daiki Ueno [Tue, 24 Mar 2020 16:51:56 +0000 (17:51 +0100)] 
alert: add callback to intercept alert messages

This adds gnutls_alert_set_read_function(), to allow QUIC
implementations to be notified when an alert message is sent.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: add callback to get notified with traffic secret change
Daiki Ueno [Fri, 21 Feb 2020 16:48:37 +0000 (17:48 +0100)] 
handshake: add callback to get notified with traffic secret change

For the use with QUIC, the change of traffic secrets must be notified
_after_ a new epoch is set up for reading or writing, and we can't
simply reuse the keylog mechanism.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: add functions to read/write handshake messages directly
Daiki Ueno [Wed, 19 Feb 2020 13:35:04 +0000 (14:35 +0100)] 
handshake: add functions to read/write handshake messages directly

This adds a couple of functions, gnutls_handshake_set_read_function()
and gnutls_handshake_write(), to allow QUIC implementations to
directly interact with the TLS state machine.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agox509: rework issuer callback
Daiki Ueno [Wed, 11 Nov 2020 18:15:13 +0000 (19:15 +0100)] 
x509: rework issuer callback

The previous issuer callback API had a drawback: the callback is
supposed to add CA to the trust list by itself.  This was error-prone,
because the callback must check the new CA is trusted by the already
added CA.  This instead moves the responsibility to the library.

This also rewrites the chain amendment logic in a side-effect free
manner.  The application can assume that the trust information stored
on gnutls_x509_trust_list_t shouldn't change after the verification.

The missingissuer test has been extended to cover all the possible
patterns exhaustively.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_cert_log: assume that 'cert' is nonnull
Daiki Ueno [Thu, 12 Nov 2020 09:57:21 +0000 (10:57 +0100)] 
_gnutls_cert_log: assume that 'cert' is nonnull

This makes static analyzers happy.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_sort_clist: simplify the calling convention
Daiki Ueno [Sun, 15 Nov 2020 08:57:37 +0000 (09:57 +0100)] 
_gnutls_sort_clist: simplify the calling convention

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/ocsp-oid' into 'master'
Daiki Ueno [Thu, 19 Nov 2020 12:37:09 +0000 (12:37 +0000)] 
Merge branch 'wip/dueno/ocsp-oid' into 'master'

_gnutls_x509_read_value: don't count terminating null byte for OIDs

Closes #805

See merge request gnutls/gnutls!1358

5 years agoMerge branch 'wip/dueno/max-pin-len' into 'master'
Daiki Ueno [Fri, 13 Nov 2020 14:10:23 +0000 (14:10 +0000)] 
Merge branch 'wip/dueno/max-pin-len' into 'master'

pkcs11: increase the maximum PIN length from 31 to 255

Closes #932

See merge request gnutls/gnutls!1357

5 years agoMerge branch 'client-hello-version' into 'master'
Daiki Ueno [Fri, 13 Nov 2020 14:00:59 +0000 (14:00 +0000)] 
Merge branch 'client-hello-version' into 'master'

Use proper record version in client hello after hello retry request

Closes #1053

See merge request gnutls/gnutls!1346

5 years agoUse proper record version in client hello after hello retry request
Tomas Mraz [Mon, 26 Oct 2020 14:23:24 +0000 (15:23 +0100)] 
Use proper record version in client hello after hello retry request

Signed-off-by: Tomas Mraz <tmraz@fedoraproject.org>
Fixes: #1053
5 years agoMerge branch 'wip/dueno/doc-fixes' into 'master'
Daiki Ueno [Fri, 13 Nov 2020 11:02:09 +0000 (11:02 +0000)] 
Merge branch 'wip/dueno/doc-fixes' into 'master'

x509: clarify how to release memory allocated for DN

Closes #1110

See merge request gnutls/gnutls!1359

5 years agopkcs11: increase the maximum PIN length from 31 to 255
Daiki Ueno [Thu, 12 Nov 2020 06:46:19 +0000 (07:46 +0100)] 
pkcs11: increase the maximum PIN length from 31 to 255

The maximum is chosen from the default configuration of SoftHSMv2:
  https://github.com/opendnssec/SoftHSMv2/blob/develop/CMakeLists.txt#L61

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_x509_read_value: don't count terminating null byte for OIDs
Nikos Mavrogiannopoulos [Thu, 12 Nov 2020 07:45:03 +0000 (08:45 +0100)] 
_gnutls_x509_read_value: don't count terminating null byte for OIDs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Co-authored-by: Daiki Ueno <ueno@gnu.org>
5 years agox509: clarify how to release memory allocated for DN
Daiki Ueno [Thu, 12 Nov 2020 08:19:30 +0000 (09:19 +0100)] 
x509: clarify how to release memory allocated for DN

The application can assume that DNs returned from
_gnutls_x509_get_dn() are allocated with gnutls_malloc() and thus
shall be freed with gnutls_free().

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/revert-allow-broken-sig' into 'master'
Daiki Ueno [Thu, 12 Nov 2020 08:11:18 +0000 (08:11 +0000)] 
Merge branch 'wip/dueno/revert-allow-broken-sig' into 'master'

tls-sig: defer allowed sigalg check to gnutls_pubkey_verify_data2

See merge request gnutls/gnutls!1352

5 years agoMerge branch 'mcatanzaro/close-session' into 'master'
Daiki Ueno [Thu, 12 Nov 2020 05:44:01 +0000 (05:44 +0000)] 
Merge branch 'mcatanzaro/close-session' into 'master'

pkcs11: fix session leak in error path

See merge request gnutls/gnutls!1343

5 years agopkcs11: fix session leak in error path
Michael Catanzaro [Mon, 12 Oct 2020 21:33:54 +0000 (16:33 -0500)] 
pkcs11: fix session leak in error path

gnutls_pkcs11_obj_set_info() fails to call pkcs11_close_session() after
a successful pkcs11_open_session() if called with an invalid itype
parameter. That would be programmer error, of course, but better not
forget to close the session regardless.

Signed-off-by: Michael Catanzaro <mcatanzaro@gnome.org>
5 years agoMerge branch 'cert_validation' into 'master'
Daiki Ueno [Tue, 10 Nov 2020 19:37:12 +0000 (19:37 +0000)] 
Merge branch 'cert_validation' into 'master'

Adds a new API gnutls_session_set_verify_output_function() that allows TLS applications

Closes #1012

See merge request gnutls/gnutls!1339

5 years agoMerge branch 'tmp-nettle-3.6' into 'master'
Daiki Ueno [Tue, 10 Nov 2020 13:49:00 +0000 (13:49 +0000)] 
Merge branch 'tmp-nettle-3.6' into 'master'

build: hard require nettle 3.6

See merge request gnutls/gnutls!1322

5 years agoAdds a new API gnutls_session_set_verify_output_function() that allows TLS applications
Sahana Prasad [Mon, 28 Sep 2020 08:21:40 +0000 (10:21 +0200)] 
Adds a new API gnutls_session_set_verify_output_function() that allows TLS applications
to have a way to pass the gnutls_verify_output_function() as a callback so that the full
path of the certificate chain to the trusted root can be avaiable as output.

Signed-off-by: Sahana Prasad <sahana@redhat.com>
5 years ago.gitlab-ci.yml: temporarily allow failures on Debian.cross.aarch64
Daiki Ueno [Thu, 5 Nov 2020 04:57:01 +0000 (05:57 +0100)] 
.gitlab-ci.yml: temporarily allow failures on Debian.cross.aarch64

qemu is currently causing segmentation fault:
  cipher: aes-128-gcm
  cipher: aes-192-gcm
  cipher: aes-256-gcm
  cipher: chacha20-poly1305
  qemu: uncaught target signal 11 (Segmentation fault) - core dumped
  Segmentation fault (core dumped)
  default cipher tests failed
  FAIL test-ciphers-openssl.sh (exit status: 139)

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: use nettle git master for FreeBSD.x86_64
Daiki Ueno [Thu, 5 Nov 2020 04:56:31 +0000 (05:56 +0100)] 
.gitlab-ci.yml: use nettle git master for FreeBSD.x86_64

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'mem-leak-client-cert-auth-rehandshake-ocsp' into 'master'
Daiki Ueno [Sat, 7 Nov 2020 04:09:17 +0000 (04:09 +0000)] 
Merge branch 'mem-leak-client-cert-auth-rehandshake-ocsp' into 'master'

Fix memory leak with client certificate auth

See merge request gnutls/gnutls!1347

5 years agotls-sig: defer allowed sigalg check to gnutls_pubkey_verify_data2
Daiki Ueno [Fri, 6 Nov 2020 08:54:54 +0000 (09:54 +0100)] 
tls-sig: defer allowed sigalg check to gnutls_pubkey_verify_data2

This reverts 485f2551e68d1b4ee70be2960f0a241b4a2b9fb9.  After the new
configuration file has been introduced, the allowed algorithms are
checked after this part.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoFix memory leak with client certificate auth
Remi Olivier [Thu, 29 Oct 2020 03:43:25 +0000 (20:43 -0700)] 
Fix memory leak with client certificate auth
Fix memory leak with client certificate auth when rehandshake with ocsp

More info in bug: gnutls/gnutls#1107

Signed-off-by: Remi Olivier <remi_8@hotmail.com>
5 years agoMerge branch 'dsa_import_optional_y' into 'master'
Daiki Ueno [Thu, 5 Nov 2020 14:37:13 +0000 (14:37 +0000)] 
Merge branch 'dsa_import_optional_y' into 'master'

Make y parameter optional in gnutls_privkey_import_dsa_raw().

See merge request gnutls/gnutls!1351

5 years agoRevert ".lgtm.yml: no longer bring nettle from master"
Daiki Ueno [Thu, 5 Nov 2020 04:51:56 +0000 (05:51 +0100)] 
Revert ".lgtm.yml: no longer bring nettle from master"

This reverts commit bbe93dc315009fe1f9a30426cbe20f4661b8435c.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agogostdsa: fix memleak in _gnutls_gostdsa_unmask_key
Daiki Ueno [Wed, 4 Nov 2020 18:05:58 +0000 (19:05 +0100)] 
gostdsa: fix memleak in _gnutls_gostdsa_unmask_key

Spotted by valgrind:
  ==5721== 40 bytes in 1 blocks are definitely lost in loss record 1 of 3
  ==5721==    at 0x4839809: malloc (vg_replace_malloc.c:307)
  ==5721==    by 0x4DC3E59: __gmp_default_allocate (in /usr/lib64/libgmp.so.10.4.0)
  ==5721==    by 0x4DD26A3: __gmpz_realloc (in /usr/lib64/libgmp.so.10.4.0)
  ==5721==    by 0x4DD8B9D: __gmpz_set_str (in /usr/lib64/libgmp.so.10.4.0)
  ==5721==    by 0x499339D: _gnutls_gostdsa_unmask_key (gostdsa-mask.c:68)

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotestcompat-openssl: use RC4-SHA instead of RC4-MD5 for testing
Daiki Ueno [Wed, 4 Nov 2020 17:58:25 +0000 (18:58 +0100)] 
testcompat-openssl: use RC4-SHA instead of RC4-MD5 for testing

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: use Fedora 33 with LEGACY policy for SSL 3.0 testing
Daiki Ueno [Wed, 4 Nov 2020 10:43:35 +0000 (11:43 +0100)] 
.gitlab-ci.yml: use Fedora 33 with LEGACY policy for SSL 3.0 testing

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: supply -fstack-protector required by latest MinGW
Daiki Ueno [Wed, 4 Nov 2020 08:46:10 +0000 (09:46 +0100)] 
.gitlab-ci.yml: supply -fstack-protector required by latest MinGW

https://sourceforge.net/p/mingw-w64/bugs/818/

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotls-fuzzer: update submodules
Daiki Ueno [Wed, 4 Nov 2020 07:56:04 +0000 (08:56 +0100)] 
tls-fuzzer: update submodules

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: avoid using fipshmac
Daiki Ueno [Mon, 12 Oct 2020 15:42:15 +0000 (17:42 +0200)] 
.gitlab-ci.yml: avoid using fipshmac

The new fipshmac command provided by libkcapi requires NETLINK_CRYPTO,
which is not enabled on gitlab CI.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agosrc: remove use of siginterrupt
Daiki Ueno [Sun, 4 Oct 2020 12:08:37 +0000 (14:08 +0200)] 
src: remove use of siginterrupt

GCC 10 warns this:
  tests.c:702:2: error: 'siginterrupt' is deprecated: Use sigaction with SA_RESTART instead [-Werror=deprecated-declarations]

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: update build-images for nettle 3.6
Daiki Ueno [Sat, 3 Oct 2020 14:15:25 +0000 (16:15 +0200)] 
.gitlab-ci.yml: update build-images for nettle 3.6

Also remove Debian.cross.mips-linux-gnu, as it is no longer supported.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobuild: hard require nettle 3.6
Daiki Ueno [Sun, 6 Sep 2020 06:56:07 +0000 (08:56 +0200)] 
build: hard require nettle 3.6

This allows us to remove several backports, including XTS, CFB8,
raw-ChaCha, CMAC64, Curve448, and the GOST curves and hashes.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMake y parameter optional in gnutls_privkey_import_dsa_raw().
Hans Leidekker [Tue, 3 Nov 2020 11:31:38 +0000 (12:31 +0100)] 
Make y parameter optional in gnutls_privkey_import_dsa_raw().

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
5 years agoMerge branch 'wip/dueno/psktool-realloc' into 'master'
Daiki Ueno [Mon, 2 Nov 2020 13:50:27 +0000 (13:50 +0000)] 
Merge branch 'wip/dueno/psktool-realloc' into 'master'

psktool: Fix hex-encoding logic of username

See merge request gnutls/gnutls!1349

5 years agoMerge branch 'remove_3des' into 'master'
Daiki Ueno [Mon, 2 Nov 2020 10:51:12 +0000 (10:51 +0000)] 
Merge branch 'remove_3des' into 'master'

PKCS #12: switch default encryption to AES-256-CBC

Closes #799

See merge request gnutls/gnutls!1348

5 years agopsktool: Fix hex-encoding logic of username
Daiki Ueno [Fri, 30 Oct 2020 15:53:47 +0000 (16:53 +0100)] 
psktool: Fix hex-encoding logic of username

The previous code didn't modify the pointer to the realloc'ed region
nor check overflow before calling realloc.

Spotted by Anderson Sasaki in:
<https://gitlab.com/gnutls/gnutls/-/merge_requests/1345#note_439063374>.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoPKCS#12: switch default encryption to AES-256-CBC
Sahana Prasad [Thu, 29 Oct 2020 09:18:56 +0000 (10:18 +0100)] 
PKCS#12: switch default encryption to AES-256-CBC

Signed-off-by: Sahana Prasad <sahana@redhat.com>
5 years agoMerge branch 'wip/dueno/psk-colon' into 'master'
Daiki Ueno [Fri, 30 Oct 2020 09:50:05 +0000 (09:50 +0000)] 
Merge branch 'wip/dueno/psk-colon' into 'master'

psktool: encode username if it contains special character

Closes #1103

See merge request gnutls/gnutls!1345

5 years agosrptool: fix FILE pointer leak
Daiki Ueno [Mon, 26 Oct 2020 15:32:59 +0000 (16:32 +0100)] 
srptool: fix FILE pointer leak

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agomini-record-timing: use only async-signal-safe functions in handler
Daiki Ueno [Sun, 25 Oct 2020 07:36:57 +0000 (08:36 +0100)] 
mini-record-timing: use only async-signal-safe functions in handler

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agopsktool: encode username if it contains special character
Daiki Ueno [Sat, 24 Oct 2020 08:23:03 +0000 (10:23 +0200)] 
psktool: encode username if it contains special character

This also moves the hex encoding of key to write_key for readability
and makes file stream closing robuster.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'fix-padlock' into 'master'
Daiki Ueno [Tue, 27 Oct 2020 07:46:17 +0000 (07:46 +0000)] 
Merge branch 'fix-padlock' into 'master'

x86:add detection of instruction set on Zhaoxin CPU

Closes #1079

See merge request gnutls/gnutls!1335

5 years agobootstrap.conf: exercise more tests from Gnulib
Daiki Ueno [Mon, 26 Oct 2020 14:42:22 +0000 (15:42 +0100)] 
bootstrap.conf: exercise more tests from Gnulib

This fixes the build failure with -Werror:

  configure:53786: gcc -o conftest -O0 -Wall -Werror -g3   conftest.c  -lev >&5
  conftest.c:412: error: "GNULIB_STRERROR" redefined [-Werror]
    412 | #define GNULIB_STRERROR 1
        |
  conftest.c:305: note: this is the location of the previous definition
    305 | #define GNULIB_STRERROR IN_GNUTLS_GNULIB_TESTS
        |
  cc1: all warnings being treated as errors

as well as improves code coverage.

Suggested by Bruno Haible in:
<https://lists.gnu.org/archive/html/bug-gnulib/2020-10/msg00148.html>.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognutls_psk_set_server_credentials_file: document the file format
Daiki Ueno [Sat, 24 Oct 2020 07:48:07 +0000 (09:48 +0200)] 
gnutls_psk_set_server_credentials_file: document the file format

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'fix-avx-detection' into 'master'
Daiki Ueno [Wed, 21 Oct 2020 15:28:49 +0000 (15:28 +0000)] 
Merge branch 'fix-avx-detection' into 'master'

x86: fix avx detection

Closes #1083

See merge request gnutls/gnutls!1334

5 years agoMerge branch 'tmp-src-fixes' into 'master'
Daiki Ueno [Mon, 19 Oct 2020 14:43:15 +0000 (14:43 +0000)] 
Merge branch 'tmp-src-fixes' into 'master'

Add extra checks on memory allocation in src/ and examples

Closes #1102

See merge request gnutls/gnutls!1344

5 years agoserv: use only async-signal-safe functions in signal handlers
Daiki Ueno [Sun, 18 Oct 2020 15:58:49 +0000 (17:58 +0200)] 
serv: use only async-signal-safe functions in signal handlers

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_asn2err: define as static inline
Daiki Ueno [Sun, 18 Oct 2020 07:50:46 +0000 (09:50 +0200)] 
_gnutls_asn2err: define as static inline

This pacifies -fanalyzer false-positive:
  common.c:552:3: warning: use of NULL '<unknown>' where non-null expected [CWE-690] [-Wanalyzer-null-argument]

Ideally, the function should be defined as 'extern inline' to avoid
code bloat by being copied across multiple translation units.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agodoc/examples/ex-ocsp-client.c: check malloc return value
Daiki Ueno [Sun, 18 Oct 2020 05:19:29 +0000 (07:19 +0200)] 
doc/examples/ex-ocsp-client.c: check malloc return value

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoserv: peer_print_info: add overflow check on realloc
Daiki Ueno [Sun, 18 Oct 2020 05:25:42 +0000 (07:25 +0200)] 
serv: peer_print_info: add overflow check on realloc

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoserv: replace our own list implementation with Gnulib's gl_list
Daiki Ueno [Sun, 18 Oct 2020 05:17:38 +0000 (07:17 +0200)] 
serv: replace our own list implementation with Gnulib's gl_list

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-kdf-tests' into 'master'
Daiki Ueno [Thu, 8 Oct 2020 16:28:18 +0000 (16:28 +0000)] 
Merge branch 'tmp-kdf-tests' into 'master'

fips: enable self-tests for KDF algorithms and CMAC

See merge request gnutls/gnutls!1341

5 years agoMerge branch 'tmp-dh-2048' into 'master'
Daiki Ueno [Thu, 8 Oct 2020 15:32:14 +0000 (15:32 +0000)] 
Merge branch 'tmp-dh-2048' into 'master'

fips: use 2048-bit prime for DH self-tests

See merge request gnutls/gnutls!1342

5 years agofips: run CMAC self-tests
Daiki Ueno [Mon, 5 Oct 2020 15:59:46 +0000 (17:59 +0200)] 
fips: run CMAC self-tests

FIPS140-2 IG D.8 mandates self-tests on CMAC.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agofips: add self-tests for TLS-PRF
Daiki Ueno [Mon, 5 Oct 2020 15:44:30 +0000 (17:44 +0200)] 
fips: add self-tests for TLS-PRF

FIPS140-2 IG D.8 mandates self-tests on approved KDF algorithms.  As
the guidance only requires to run a single instance of each KDF
mechanism, this only exercises TLS1.2 PRF with HMAC-SHA-256 as the
underlying MAC algorithm.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agofips: use larger prime for DH self-tests
Daiki Ueno [Tue, 6 Oct 2020 09:54:21 +0000 (11:54 +0200)] 
fips: use larger prime for DH self-tests

According to FIPS140-2 IG 7.5, the minimum key size of FFC through
2030 is defined as 2048 bits.  This updates the relevant self-test
using ffdhe3072 defined in RFC 7919.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agofips: add self-tests for PBKDF2
Daiki Ueno [Mon, 5 Oct 2020 14:59:50 +0000 (16:59 +0200)] 
fips: add self-tests for PBKDF2

FIPS140-2 IG D.8 mandates self-tests on approved KDF algorithms.  As
the guidance only requires running a single instance of each KDF
mechanism, this only exercises PBKDF2 with HMAC-SHA-256 as the
underlying MAC algorithm.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agofips: add self-tests for HKDF
Daiki Ueno [Mon, 5 Oct 2020 14:12:46 +0000 (16:12 +0200)] 
fips: add self-tests for HKDF

FIPS140-2 IG D.8 mandates self-test on approved KDF algorithms.  As
the guidance only requires running a single instance of each KDF
mechanism, this only exercises HKDF-Extract and HKDF-Expand operations
with HMAC-SHA-256 as the underlying MAC.

Although HKDF is non-approved, it would be sensible to do that as it
will be approved in FIPS140-3.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-sh-tests' into 'master'
Daiki Ueno [Sat, 3 Oct 2020 16:42:07 +0000 (16:42 +0000)] 
Merge branch 'tmp-sh-tests' into 'master'

tests: simplify shell-script usage

See merge request gnutls/gnutls!1337

5 years agotests: add missing ${EXEEXT}
Daiki Ueno [Sat, 3 Oct 2020 12:50:26 +0000 (14:50 +0200)] 
tests: add missing ${EXEEXT}

Pointed by Andreas Metzler.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: prolong timeout in wait_for_port
Daiki Ueno [Fri, 2 Oct 2020 15:23:27 +0000 (17:23 +0200)] 
tests: prolong timeout in wait_for_port

gnutls-serv invocations in cert-tests/dsa can take long time to launch
if valgrind tests are enabled.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: remove unused lock facility using lockfile-create
Daiki Ueno [Mon, 28 Sep 2020 17:05:52 +0000 (19:05 +0200)] 
tests: remove unused lock facility using lockfile-create

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: create lock for tests using GETPORT
Daiki Ueno [Sat, 26 Sep 2020 09:58:17 +0000 (11:58 +0200)] 
tests: create lock for tests using GETPORT

This fixes a race condition in the timings between when a free port is
detected and when the port is actually used.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: simplify program detection
Daiki Ueno [Thu, 24 Sep 2020 09:48:24 +0000 (11:48 +0200)] 
tests: simplify program detection

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: rewrite launch_server using launch_bare_server
Daiki Ueno [Thu, 24 Sep 2020 08:47:30 +0000 (10:47 +0200)] 
tests: rewrite launch_server using launch_bare_server

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-verify-output' into 'master'
Daiki Ueno [Mon, 28 Sep 2020 09:22:01 +0000 (09:22 +0000)] 
Merge branch 'tmp-verify-output' into 'master'

x509: correct argument of gnutls_verify_output_function

See merge request gnutls/gnutls!1338

5 years agox509: correct argument of gnutls_verify_output_function
Daiki Ueno [Sun, 27 Sep 2020 14:11:32 +0000 (16:11 +0200)] 
x509: correct argument of gnutls_verify_output_function

This is a leftover of 52e78f1e.  We need to call
gnutls_verify_output_function with the replaced CA cert instead of the
original cert.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: remove launch_pkcs11_server
Daiki Ueno [Wed, 23 Sep 2020 07:34:09 +0000 (09:34 +0200)] 
tests: remove launch_pkcs11_server

This function is only used by testpkcs11.sh.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: remove unused first argument from launch_server
Daiki Ueno [Wed, 23 Sep 2020 07:12:32 +0000 (09:12 +0200)] 
tests: remove unused first argument from launch_server

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: use ": ${FOO=BAR}" syntax for default handling in shell scripts
Daiki Ueno [Wed, 23 Sep 2020 07:09:45 +0000 (09:09 +0200)] 
tests: use ": ${FOO=BAR}" syntax for default handling in shell scripts

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agox86:Modify variable name
JonasZhou [Wed, 23 Sep 2020 11:22:50 +0000 (19:22 +0800)] 
x86:Modify variable name

Modify the variables _gnutls_sha_padlock and _gnutls_sha_padlock_nano.
Add a comment for detecting CPU. Modify the indentation. Delete
initialization etc.

Signed-off-by: JonasZhou <JonasZhou@zhaoxin.com>
5 years agox86:add detection of instruction set on Zhaoxin CPU
JonasZhou [Tue, 15 Sep 2020 08:36:57 +0000 (16:36 +0800)] 
x86:add detection of instruction set on Zhaoxin CPU

Add detection of extended instruction set on Zhaoxin cpu,e.g:ssse3,sha,
etc. Set the priority of the algorithm according to the benchmark
test result on Zhaoxin cpu.

Signed-off-by: JonasZhou <JonasZhou@zhaoxin.com>
5 years agox86: fix avx detection
JonasZhou [Wed, 16 Sep 2020 06:08:21 +0000 (14:08 +0800)] 
x86: fix avx detection

In the case of setting environment variables, AVX cannot be detected
correctly. Because only MOVBE is added to variable _gnutls_x86_cpuid_s,
there is no OSXSAVE. And according to the intel manual, using AVX
does not need to detect FMA.

Signed-off-by: JonasZhou <JonasZhou@zhaoxin.com>
5 years agoMerge branch 'fix-x86-padlock' into 'master'
Daiki Ueno [Wed, 23 Sep 2020 07:30:41 +0000 (07:30 +0000)] 
Merge branch 'fix-x86-padlock' into 'master'

padlock:fix exception in wrap_padlock_hmac_fast

See merge request gnutls/gnutls!1336

5 years agoMerge branch 'tmp-default-prio' into 'master'
Daiki Ueno [Wed, 23 Sep 2020 06:55:54 +0000 (06:55 +0000)] 
Merge branch 'tmp-default-prio' into 'master'

priority: add Ed448 to SECURE192 signing algorithms

See merge request gnutls/gnutls!1332

5 years agopadlock:fix exception in wrap_padlock_hmac_fast
JonasZhou [Wed, 23 Sep 2020 06:19:39 +0000 (14:19 +0800)] 
padlock:fix exception in wrap_padlock_hmac_fast

In function wrap_padlock_hmac_fast, use free to release local variables
ctx. Remove a call to wrap_padlock_hmac_deinit() to fix a crash.

Signed-off-by: JonasZhou <JonasZhou@zhaoxin.com>
5 years agoMerge branch 'tmp-clock_nanosleep' into 'master'
Daiki Ueno [Mon, 21 Sep 2020 11:25:59 +0000 (11:25 +0000)] 
Merge branch 'tmp-clock_nanosleep' into 'master'

tests: allow clock_nanosleep in seccomp tests

Closes #1086

See merge request gnutls/gnutls!1325

5 years agotestcompat-openssl: specify -sigalgs
Daiki Ueno [Mon, 14 Sep 2020 15:59:00 +0000 (17:59 +0200)] 
testcompat-openssl: specify -sigalgs

The default selection of signature schemes is also affected by the
crypto-policies, and needs to be explicitly enabled with -sigalgs.

Suggested by Tomas Mraz.

Signed-off-by: Daiki Ueno <ueno@gnu.org>