Jerry Yu | e599132 | 2022-11-07 14:03:44 +0800 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | # tls13-misc.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 | |
| 21 | requires_gnutls_tls1_3 |
| 22 | requires_all_configs_enabled MBEDTLS_SSL_PROTO_TLS1_3 MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C \ |
| 23 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 24 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 25 | requires_all_configs_disabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 26 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 27 | run_test "TLS 1.3: G->m: PSK: configured psk only, good." \ |
| 28 | "$P_SRV force_version=tls13 tls13_kex_modes=all debug_level=5 $(get_srv_psk_list)" \ |
| 29 | "$G_NEXT_CLI -d 10 --priority NORMAL:-VERS-ALL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK:+VERS-TLS1.3:+GROUP-ALL \ |
| 30 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70 \ |
| 31 | localhost" \ |
| 32 | 0 \ |
| 33 | -s "found psk key exchange modes extension" \ |
| 34 | -s "found pre_shared_key extension" \ |
| 35 | -s "Found PSK_EPHEMERAL KEX MODE" \ |
| 36 | -s "Found PSK KEX MODE" \ |
| 37 | -s "key exchange mode: psk$" |
| 38 | |
| 39 | requires_gnutls_tls1_3 |
| 40 | requires_all_configs_enabled MBEDTLS_SSL_PROTO_TLS1_3 MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C \ |
| 41 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 42 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 43 | requires_all_configs_disabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 44 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 45 | run_test "TLS 1.3: G->m: PSK: configured psk_ephemeral only, good." \ |
| 46 | "$P_SRV force_version=tls13 tls13_kex_modes=all debug_level=5 $(get_srv_psk_list)" \ |
| 47 | "$G_NEXT_CLI -d 10 --priority NORMAL:-VERS-ALL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK:+VERS-TLS1.3:+GROUP-ALL \ |
| 48 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70 \ |
| 49 | localhost" \ |
| 50 | 0 \ |
| 51 | -s "found psk key exchange modes extension" \ |
| 52 | -s "found pre_shared_key extension" \ |
| 53 | -s "Found PSK_EPHEMERAL KEX MODE" \ |
| 54 | -s "Found PSK KEX MODE" \ |
| 55 | -s "key exchange mode: psk_ephemeral$" |
| 56 | |
| 57 | requires_gnutls_tls1_3 |
| 58 | requires_all_configs_enabled MBEDTLS_SSL_PROTO_TLS1_3 MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C \ |
| 59 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 60 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 61 | requires_all_configs_disabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 62 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 63 | run_test "TLS 1.3: G->m: PSK: configured ephemeral only, good." \ |
| 64 | "$P_SRV force_version=tls13 tls13_kex_modes=all debug_level=5 $(get_srv_psk_list)" \ |
| 65 | "$G_NEXT_CLI -d 10 --priority NORMAL:-VERS-ALL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK:+VERS-TLS1.3:+GROUP-ALL \ |
| 66 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70 \ |
| 67 | localhost" \ |
| 68 | 0 \ |
| 69 | -s "key exchange mode: ephemeral$" |
| 70 | |