From f467d46bbbcee711d647441152d0f316a354e855 Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Mon, 7 Nov 2022 13:12:44 +0800 Subject: [PATCH] move get_srv_psk_list It can be reused in other test-suites Signed-off-by: Jerry Yu --- tests/opt-testcases/tls13-kex-modes.sh | 9 --------- tests/ssl-opt.sh | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/opt-testcases/tls13-kex-modes.sh b/tests/opt-testcases/tls13-kex-modes.sh index 4f62ed69bf..b1320c5b59 100755 --- a/tests/opt-testcases/tls13-kex-modes.sh +++ b/tests/opt-testcases/tls13-kex-modes.sh @@ -18,15 +18,6 @@ # limitations under the License. # -get_srv_psk_list () -{ - case $(( TESTS % 3 )) in - 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; - 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; - 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; - esac -} - requires_gnutls_tls1_3 requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index a75b3f593c..f264b5ed12 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -1024,6 +1024,16 @@ is_gnutls() { esac } +# Generate random psk_list argument for ssl_server2 +get_srv_psk_list () +{ + case $(( TESTS % 3 )) in + 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; + 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; + 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; + esac +} + # Determine what calc_verify trace is to be expected, if any. # # calc_verify is only called for two things: to calculate the