From 77cbeff04cfbbaab11c0c5b4c865b2a1dbfd963b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 30 Jan 2020 10:58:57 +0100 Subject: [PATCH 1/2] Fix ssl-opt.sh for GnuTLS versions rejecting SHA-1 While the whole script makes (often implicit) assumptions about the version of GnuTLS used, generally speaking it should work out of the box with the version packaged on our reference testing platform, which is Ubuntu 16.04 so far. With the update from Jan 8 2020 (3.4.10-4ubuntu1.6), the patches for rejecting SHA-1 in certificate signatures were backported, so we should avoid presenting SHA-1 signed certificates to a GnuTLS peer in ssl-opt.sh. --- tests/ssl-opt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index afaae69d8..e55d9b7e2 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -5489,14 +5489,14 @@ run_test "Per-version suites: TLS 1.2" \ requires_gnutls run_test "ClientHello without extensions, SHA-1 allowed" \ - "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt" \ + "$P_SRV debug_level=3" \ "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ 0 \ -s "dumping 'client hello extensions' (0 bytes)" requires_gnutls run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ - "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ + "$P_SRV debug_level=3 allow_sha1=0" \ "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ 0 \ -s "dumping 'client hello extensions' (0 bytes)" From bc4da29d060916f94f1c08f6dbd2e74e09f24b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 30 Jan 2020 12:45:14 +0100 Subject: [PATCH 2/2] De-duplicate SHA1-independent test in ssl-opt.sh The splitting of this test into two versions depending on whether SHA-1 was allowed by the server was a mistake in 5d2511c4d48eb197697466d1bd6b776cf09b0e7c - the test has nothing to do with SHA-1 in the first place, as the server doesn't request a certificate from the client so it doesn't matter if the server accepts SHA-1 or not. --- tests/ssl-opt.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index e55d9b7e2..aa18ac4ea 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -5488,19 +5488,12 @@ run_test "Per-version suites: TLS 1.2" \ # Test for ClientHello without extensions requires_gnutls -run_test "ClientHello without extensions, SHA-1 allowed" \ +run_test "ClientHello without extensions" \ "$P_SRV debug_level=3" \ "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ 0 \ -s "dumping 'client hello extensions' (0 bytes)" -requires_gnutls -run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ - "$P_SRV debug_level=3 allow_sha1=0" \ - "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ - 0 \ - -s "dumping 'client hello extensions' (0 bytes)" - # Tests for mbedtls_ssl_get_bytes_avail() run_test "mbedtls_ssl_get_bytes_avail: no extra data" \