lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 18 Jun 2021 15:45:32 -0500
From:   Seth Forshee <seth.forshee@...onical.com>
To:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, Shuah Khan <shuah@...nel.org>
Cc:     netdev@...r.kernel.org, linux-kselftest@...r.kernel.org,
        seth.forshee@...onical.com
Subject: [PATCH] selftests/tls: don't change cipher type in bidirectional test

The bidirectional test attempts to change the cipher to
TLS_CIPHER_AES_GCM_128. The test fixture setup will have already set
the cipher to be tested, and if it was different than the one set by
the bidir test setsockopt() will fail on account of having different
ciphers for rx and tx, causing the test to fail.

Forcing the use of GCM when testing ChaCha doesn't make sense anyway,
so just use the cipher configured by the test fixture setup.

Fixes: 4f336e88a870 ("selftests/tls: add CHACHA20-POLY1305 to tls selftests")
Signed-off-by: Seth Forshee <seth.forshee@...onical.com>
---
 tools/testing/selftests/net/tls.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index 426d07875a48..9f4c87f4ce1e 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -831,23 +831,6 @@ TEST_F(tls, bidir)
 	char const *test_str = "test_read";
 	int send_len = 10;
 	char buf[10];
-	int ret;
-
-	if (!self->notls) {
-		struct tls12_crypto_info_aes_gcm_128 tls12;
-
-		memset(&tls12, 0, sizeof(tls12));
-		tls12.info.version = variant->tls_version;
-		tls12.info.cipher_type = TLS_CIPHER_AES_GCM_128;
-
-		ret = setsockopt(self->fd, SOL_TLS, TLS_RX, &tls12,
-				 sizeof(tls12));
-		ASSERT_EQ(ret, 0);
-
-		ret = setsockopt(self->cfd, SOL_TLS, TLS_TX, &tls12,
-				 sizeof(tls12));
-		ASSERT_EQ(ret, 0);
-	}
 
 	ASSERT_EQ(strlen(test_str) + 1, send_len);
 
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ