blob: 869426d8ca6d6149237cd8bdd045414fb8981605 [file] [log] [blame]
Jerry Yu6a9beba2022-07-31 12:45:25 +08001#!/bin/sh
2
3# tls13-kex-modes.sh
4#
5# Copyright The Mbed TLS Contributors
6# SPDX-License-Identifier: Apache-2.0
7#
8# Licensed under the Apache License, Version 2.0 (the "License"); you may
9# not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19#
20
Jerry Yu66f35f22022-08-22 17:27:41 +080021requires_gnutls_tls1_3
Jerry Yu6a9beba2022-07-31 12:45:25 +080022requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
23requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
24requires_config_enabled MBEDTLS_SSL_SRV_C
25requires_config_enabled MBEDTLS_DEBUG_C
Jerry Yu9b83fa12022-07-31 13:13:51 +080026# SOME_ECDHE_ENABLED?
27requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \
28 MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
Jerry Yu3e06fce2022-08-25 17:51:57 +080029run_test "TLS 1.3: PSK: No valid ciphersuite. G->m" \
Jerry Yu2185c0f2022-08-23 16:12:43 +080030 "$P_SRV force_version=tls13 tls13_kex_modes=all debug_level=5 psk_identity=Client_identity psk=6162636465666768696a6b6c6d6e6f70" \
31 "$G_NEXT_CLI -d 10 --priority NORMAL:-VERS-ALL:-CIPHER-ALL:+AES-256-GCM:+AEAD:+SHA384:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK:+VERS-TLS1.3 \
32 --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70 \
33 localhost" \
34 1 \
35 -s "found psk key exchange modes extension" \
36 -s "found pre_shared_key extension" \
37 -s "Found PSK_EPHEMERAL KEX MODE" \
38 -s "Found PSK KEX MODE" \
Jerry Yu3e06fce2022-08-25 17:51:57 +080039 -s "No matched ciphersuite"
Jerry Yu2185c0f2022-08-23 16:12:43 +080040
41requires_openssl_tls1_3
42requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
43requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
44requires_config_enabled MBEDTLS_SSL_SRV_C
45requires_config_enabled MBEDTLS_DEBUG_C
46# SOME_ECDHE_ENABLED?
47requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \
48 MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
Jerry Yu3e06fce2022-08-25 17:51:57 +080049run_test "TLS 1.3: PSK: No valid ciphersuite. O->m" \
Jerry Yu2185c0f2022-08-23 16:12:43 +080050 "$P_SRV force_version=tls13 tls13_kex_modes=all debug_level=5 psk_identity=Client_identity psk=6162636465666768696a6b6c6d6e6f70" \
51 "$O_NEXT_CLI -tls1_3 -msg -allow_no_dhe_kex -ciphersuites TLS_AES_256_GCM_SHA384\
52 -psk_identity Client_identity -psk 6162636465666768696a6b6c6d6e6f70" \
53 1 \
54 -s "found psk key exchange modes extension" \
55 -s "found pre_shared_key extension" \
56 -s "Found PSK_EPHEMERAL KEX MODE" \
57 -s "Found PSK KEX MODE" \
Jerry Yu3e06fce2022-08-25 17:51:57 +080058 -s "No matched ciphersuite"