Gilles Peskine | 1d6a950 | 2024-09-13 13:53:50 +0200 | [diff] [blame] | 1 | # Miscellaneous tests of TLS 1.3 features. |
Jerry Yu | e599132 | 2022-11-07 14:03:44 +0800 | [diff] [blame] | 2 | |
Jerry Yu | e599132 | 2022-11-07 14:03:44 +0800 | [diff] [blame] | 3 | # Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 4 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Jerry Yu | e599132 | 2022-11-07 14:03:44 +0800 | [diff] [blame] | 5 | # |
| 6 | |
| 7 | requires_gnutls_tls1_3 |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 8 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 13 | |
| 14 | run_test "TLS 1.3: PSK: No valid ciphersuite. G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 15 | "$P_SRV tls13_kex_modes=all debug_level=5 $(get_srv_psk_list)" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 16 | "$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 \ |
| 17 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70 \ |
| 18 | localhost" \ |
| 19 | 1 \ |
| 20 | -s "found psk key exchange modes extension" \ |
| 21 | -s "found pre_shared_key extension" \ |
| 22 | -s "Found PSK_EPHEMERAL KEX MODE" \ |
| 23 | -s "Found PSK KEX MODE" \ |
| 24 | -s "No matched ciphersuite" |
| 25 | |
| 26 | requires_openssl_tls1_3 |
| 27 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 28 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 29 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 30 | requires_config_enabled MBEDTLS_DEBUG_C |
| 31 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 32 | |
| 33 | run_test "TLS 1.3: PSK: No valid ciphersuite. O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 34 | "$P_SRV tls13_kex_modes=all debug_level=5 $(get_srv_psk_list)" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 35 | "$O_NEXT_CLI -tls1_3 -msg -allow_no_dhe_kex -ciphersuites TLS_AES_256_GCM_SHA384\ |
| 36 | -psk_identity Client_identity -psk 6162636465666768696a6b6c6d6e6f70" \ |
| 37 | 1 \ |
| 38 | -s "found psk key exchange modes extension" \ |
| 39 | -s "found pre_shared_key extension" \ |
| 40 | -s "Found PSK_EPHEMERAL KEX MODE" \ |
| 41 | -s "Found PSK KEX MODE" \ |
| 42 | -s "No matched ciphersuite" |
| 43 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 44 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 45 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 46 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 47 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 48 | requires_config_enabled MBEDTLS_DEBUG_C |
| 49 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 50 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 51 | run_test "TLS 1.3 m->m: Multiple PSKs: valid ticket, reconnect with ticket" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 52 | "$P_SRV tls13_kex_modes=psk_ephemeral debug_level=5 psk_identity=Client_identity psk=6162636465666768696a6b6c6d6e6f70 tickets=8" \ |
| 53 | "$P_CLI tls13_kex_modes=psk_ephemeral debug_level=5 psk_identity=Client_identity psk=6162636465666768696a6b6c6d6e6f70 reco_mode=1 reconnect=1" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 54 | 0 \ |
| 55 | -c "Pre-configured PSK number = 2" \ |
| 56 | -s "sent selected_identity: 0" \ |
| 57 | -s "key exchange mode: psk_ephemeral" \ |
| 58 | -S "key exchange mode: psk$" \ |
| 59 | -S "key exchange mode: ephemeral$" \ |
| 60 | -S "ticket is not authentic" |
| 61 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 62 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 63 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 64 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 65 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 66 | requires_config_enabled MBEDTLS_DEBUG_C |
| 67 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 68 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 69 | run_test "TLS 1.3 m->m: Multiple PSKs: invalid ticket, reconnect with PSK" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 70 | "$P_SRV tls13_kex_modes=psk_ephemeral debug_level=5 psk_identity=Client_identity psk=6162636465666768696a6b6c6d6e6f70 tickets=8 dummy_ticket=1" \ |
| 71 | "$P_CLI tls13_kex_modes=psk_ephemeral debug_level=5 psk_identity=Client_identity psk=6162636465666768696a6b6c6d6e6f70 reco_mode=1 reconnect=1" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 72 | 0 \ |
| 73 | -c "Pre-configured PSK number = 2" \ |
| 74 | -s "sent selected_identity: 1" \ |
| 75 | -s "key exchange mode: psk_ephemeral" \ |
| 76 | -S "key exchange mode: psk$" \ |
| 77 | -S "key exchange mode: ephemeral$" \ |
| 78 | -s "ticket is not authentic" |
| 79 | |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 80 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 81 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 82 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 83 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 84 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 85 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 86 | run_test "TLS 1.3: G->m: ephemeral_all/psk, fail, no common kex mode" \ |
| 87 | "$P_SRV tls13_kex_modes=psk debug_level=5 $(get_srv_psk_list)" \ |
| 88 | "$G_NEXT_CLI -d 10 --priority NORMAL:-VERS-ALL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:-PSK:+VERS-TLS1.3 \ |
| 89 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70 \ |
| 90 | localhost" \ |
| 91 | 1 \ |
| 92 | -s "found psk key exchange modes extension" \ |
| 93 | -s "found pre_shared_key extension" \ |
| 94 | -s "Found PSK_EPHEMERAL KEX MODE" \ |
| 95 | -S "Found PSK KEX MODE" \ |
| 96 | -S "key exchange mode: psk$" \ |
| 97 | -S "key exchange mode: psk_ephemeral" \ |
| 98 | -S "key exchange mode: ephemeral" |
| 99 | |
| 100 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 102 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 103 | requires_config_enabled MBEDTLS_DEBUG_C |
| 104 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 105 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 106 | requires_config_disabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 107 | requires_config_disabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 108 | run_test "TLS 1.3: G->m: PSK: configured psk only, good." \ |
| 109 | "$P_SRV tls13_kex_modes=all debug_level=5 $(get_srv_psk_list)" \ |
| 110 | "$G_NEXT_CLI -d 10 --priority NORMAL:-VERS-ALL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK:+VERS-TLS1.3:+GROUP-ALL \ |
| 111 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70 \ |
| 112 | localhost" \ |
| 113 | 0 \ |
| 114 | -s "found psk key exchange modes extension" \ |
| 115 | -s "found pre_shared_key extension" \ |
| 116 | -s "Found PSK_EPHEMERAL KEX MODE" \ |
| 117 | -s "Found PSK KEX MODE" \ |
| 118 | -s "key exchange mode: psk$" |
| 119 | |
| 120 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 122 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 123 | requires_config_enabled MBEDTLS_DEBUG_C |
| 124 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 125 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 126 | requires_config_disabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 127 | requires_config_disabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 128 | run_test "TLS 1.3: G->m: PSK: configured psk_ephemeral only, good." \ |
| 129 | "$P_SRV tls13_kex_modes=all debug_level=5 $(get_srv_psk_list)" \ |
| 130 | "$G_NEXT_CLI -d 10 --priority NORMAL:-VERS-ALL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK:+VERS-TLS1.3:+GROUP-ALL \ |
| 131 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70 \ |
| 132 | localhost" \ |
| 133 | 0 \ |
| 134 | -s "found psk key exchange modes extension" \ |
| 135 | -s "found pre_shared_key extension" \ |
| 136 | -s "Found PSK_EPHEMERAL KEX MODE" \ |
| 137 | -s "Found PSK KEX MODE" \ |
| 138 | -s "key exchange mode: psk_ephemeral$" |
| 139 | |
| 140 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 142 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 143 | requires_config_enabled MBEDTLS_DEBUG_C |
| 144 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 145 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 146 | requires_config_disabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 147 | requires_config_disabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 148 | run_test "TLS 1.3: G->m: PSK: configured ephemeral only, good." \ |
| 149 | "$P_SRV tls13_kex_modes=all debug_level=5 $(get_srv_psk_list)" \ |
| 150 | "$G_NEXT_CLI -d 10 --priority NORMAL:-VERS-ALL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK:+VERS-TLS1.3:+GROUP-ALL \ |
| 151 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70 \ |
| 152 | localhost" \ |
| 153 | 0 \ |
| 154 | -s "key exchange mode: ephemeral$" |
| 155 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 157 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 158 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 159 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 160 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 161 | requires_config_enabled MBEDTLS_DEBUG_C |
| 162 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 163 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 164 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 165 | run_test "TLS 1.3 m->m: resumption" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 166 | "$P_SRV debug_level=2 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 167 | "$P_CLI reco_mode=1 reconnect=1" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 168 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 169 | -c "Protocol is TLSv1.3" \ |
| 170 | -c "Saving session for reuse... ok" \ |
| 171 | -c "Reconnecting with saved session... ok" \ |
| 172 | -c "HTTP/1.0 200 OK" \ |
| 173 | -s "Protocol is TLSv1.3" \ |
| 174 | -s "key exchange mode: psk" \ |
| 175 | -s "Select PSK ciphersuite" |
| 176 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 178 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 179 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 180 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 181 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 182 | requires_config_enabled MBEDTLS_DEBUG_C |
| 183 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 184 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 185 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 186 | run_test "TLS 1.3 m->m: resumption with servername" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 187 | "$P_SRV debug_level=2 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key \ |
| 188 | sni=localhost,../framework/data_files/server2.crt,../framework/data_files/server2.key,-,-,-,polarssl.example,../framework/data_files/server1-nospace.crt,../framework/data_files/server1.key,-,-,-" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 189 | "$P_CLI server_name=localhost reco_mode=1 reconnect=1" \ |
| 190 | 0 \ |
| 191 | -c "Protocol is TLSv1.3" \ |
| 192 | -c "Saving session for reuse... ok" \ |
| 193 | -c "Reconnecting with saved session... ok" \ |
| 194 | -c "HTTP/1.0 200 OK" \ |
| 195 | -s "Protocol is TLSv1.3" \ |
| 196 | -s "key exchange mode: psk" \ |
| 197 | -s "Select PSK ciphersuite" |
| 198 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 200 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 201 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 202 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 203 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 204 | requires_config_enabled MBEDTLS_DEBUG_C |
| 205 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 206 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 207 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 208 | run_test "TLS 1.3 m->m: resumption with ticket max lifetime (7d)" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 209 | "$P_SRV debug_level=2 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key ticket_timeout=604800 tickets=1" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 210 | "$P_CLI reco_mode=1 reconnect=1" \ |
| 211 | 0 \ |
| 212 | -c "Protocol is TLSv1.3" \ |
| 213 | -c "Saving session for reuse... ok" \ |
| 214 | -c "Reconnecting with saved session... ok" \ |
| 215 | -c "HTTP/1.0 200 OK" \ |
| 216 | -s "Protocol is TLSv1.3" \ |
| 217 | -s "key exchange mode: psk" \ |
| 218 | -s "Select PSK ciphersuite" |
| 219 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 221 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 222 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 223 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 224 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 225 | requires_config_enabled MBEDTLS_DEBUG_C |
| 226 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 227 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 228 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 229 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 |
| 230 | run_test "TLS 1.3 m->m: resumption with AES-256-GCM-SHA384 only" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 231 | "$P_SRV debug_level=2 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key" \ |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 232 | "$P_CLI force_ciphersuite=TLS1-3-AES-256-GCM-SHA384 reco_mode=1 reconnect=1" \ |
| 233 | 0 \ |
| 234 | -c "Protocol is TLSv1.3" \ |
| 235 | -c "Ciphersuite is TLS1-3-AES-256-GCM-SHA384" \ |
| 236 | -c "Saving session for reuse... ok" \ |
| 237 | -c "Reconnecting with saved session... ok" \ |
| 238 | -c "HTTP/1.0 200 OK" \ |
| 239 | -s "Protocol is TLSv1.3" \ |
| 240 | -s "key exchange mode: psk" \ |
| 241 | -s "Select PSK ciphersuite: 1302 - TLS1-3-AES-256-GCM-SHA384" |
| 242 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 244 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 245 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 246 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 247 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 248 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 249 | requires_config_enabled MBEDTLS_DEBUG_C |
| 250 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 251 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 252 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 253 | run_test "TLS 1.3 m->m: resumption with early data" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 254 | "$P_SRV debug_level=4 early_data=1 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key" \ |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 255 | "$P_CLI debug_level=3 early_data=1 reco_mode=1 reconnect=1" \ |
| 256 | 0 \ |
| 257 | -c "Protocol is TLSv1.3" \ |
| 258 | -c "Saving session for reuse... ok" \ |
| 259 | -c "Reconnecting with saved session" \ |
| 260 | -c "HTTP/1.0 200 OK" \ |
| 261 | -c "received max_early_data_size" \ |
| 262 | -c "NewSessionTicket: early_data(42) extension received." \ |
| 263 | -c "ClientHello: early_data(42) extension exists." \ |
| 264 | -c "EncryptedExtensions: early_data(42) extension received." \ |
| 265 | -c "bytes of early data written" \ |
| 266 | -C "0 bytes of early data written" \ |
| 267 | -s "Protocol is TLSv1.3" \ |
| 268 | -s "key exchange mode: psk" \ |
| 269 | -s "Select PSK ciphersuite" \ |
| 270 | -s "Sent max_early_data_size" \ |
| 271 | -s "NewSessionTicket: early_data(42) extension exists." \ |
| 272 | -s "ClientHello: early_data(42) extension exists." \ |
| 273 | -s "EncryptedExtensions: early_data(42) extension exists." \ |
| 274 | -s "early data bytes read" |
| 275 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 277 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 278 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 279 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 280 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 281 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 282 | requires_config_enabled MBEDTLS_DEBUG_C |
| 283 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 284 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 285 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 286 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 |
| 287 | run_test "TLS 1.3 m->m: resumption with early data, AES-256-GCM-SHA384 only" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 288 | "$P_SRV debug_level=4 early_data=1 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key" \ |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 289 | "$P_CLI debug_level=3 force_ciphersuite=TLS1-3-AES-256-GCM-SHA384 early_data=1 reco_mode=1 reconnect=1" \ |
| 290 | 0 \ |
| 291 | -c "Protocol is TLSv1.3" \ |
| 292 | -c "Ciphersuite is TLS1-3-AES-256-GCM-SHA384" \ |
| 293 | -c "Saving session for reuse... ok" \ |
| 294 | -c "Reconnecting with saved session" \ |
| 295 | -c "HTTP/1.0 200 OK" \ |
| 296 | -c "received max_early_data_size" \ |
| 297 | -c "NewSessionTicket: early_data(42) extension received." \ |
| 298 | -c "ClientHello: early_data(42) extension exists." \ |
| 299 | -c "EncryptedExtensions: early_data(42) extension received." \ |
| 300 | -c "bytes of early data written" \ |
| 301 | -C "0 bytes of early data written" \ |
| 302 | -s "Protocol is TLSv1.3" \ |
| 303 | -s "key exchange mode: psk" \ |
| 304 | -s "Select PSK ciphersuite: 1302 - TLS1-3-AES-256-GCM-SHA384" \ |
| 305 | -s "Sent max_early_data_size" \ |
| 306 | -s "NewSessionTicket: early_data(42) extension exists." \ |
| 307 | -s "ClientHello: early_data(42) extension exists." \ |
| 308 | -s "EncryptedExtensions: early_data(42) extension exists." \ |
| 309 | -s "early data bytes read" |
| 310 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 312 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 313 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 314 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 315 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 316 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 317 | requires_config_enabled MBEDTLS_DEBUG_C |
| 318 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 319 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 320 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 321 | run_test "TLS 1.3 m->m: resumption, early data cli-enabled/srv-default" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 322 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key" \ |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 323 | "$P_CLI debug_level=3 early_data=1 reco_mode=1 reconnect=1" \ |
| 324 | 0 \ |
| 325 | -c "Protocol is TLSv1.3" \ |
| 326 | -c "Saving session for reuse... ok" \ |
| 327 | -c "Reconnecting with saved session" \ |
| 328 | -c "HTTP/1.0 200 OK" \ |
| 329 | -C "received max_early_data_size" \ |
| 330 | -C "NewSessionTicket: early_data(42) extension received." \ |
| 331 | -C "ClientHello: early_data(42) extension exists." \ |
| 332 | -C "EncryptedExtensions: early_data(42) extension received." \ |
| 333 | -c "0 bytes of early data written" \ |
| 334 | -s "Protocol is TLSv1.3" \ |
| 335 | -s "key exchange mode: psk" \ |
| 336 | -s "Select PSK ciphersuite" \ |
| 337 | -S "Sent max_early_data_size" \ |
| 338 | -S "NewSessionTicket: early_data(42) extension exists." \ |
| 339 | -S "ClientHello: early_data(42) extension exists." \ |
| 340 | -S "EncryptedExtensions: early_data(42) extension exists." \ |
| 341 | -S "early data bytes read" |
| 342 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 344 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 345 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 346 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 347 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 348 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 349 | requires_config_enabled MBEDTLS_DEBUG_C |
| 350 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 351 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 352 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 353 | run_test "TLS 1.3 m->m: resumption, early data cli-enabled/srv-disabled" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 354 | "$P_SRV debug_level=4 early_data=0 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key" \ |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 355 | "$P_CLI debug_level=3 early_data=1 reco_mode=1 reconnect=1" \ |
| 356 | 0 \ |
| 357 | -c "Protocol is TLSv1.3" \ |
| 358 | -c "Saving session for reuse... ok" \ |
| 359 | -c "Reconnecting with saved session" \ |
| 360 | -c "HTTP/1.0 200 OK" \ |
| 361 | -C "received max_early_data_size" \ |
| 362 | -C "NewSessionTicket: early_data(42) extension received." \ |
| 363 | -C "ClientHello: early_data(42) extension exists." \ |
| 364 | -C "EncryptedExtensions: early_data(42) extension received." \ |
| 365 | -c "0 bytes of early data written" \ |
| 366 | -s "Protocol is TLSv1.3" \ |
| 367 | -s "key exchange mode: psk" \ |
| 368 | -s "Select PSK ciphersuite" \ |
| 369 | -S "Sent max_early_data_size" \ |
| 370 | -S "NewSessionTicket: early_data(42) extension exists." \ |
| 371 | -S "ClientHello: early_data(42) extension exists." \ |
| 372 | -S "EncryptedExtensions: early_data(42) extension exists." \ |
| 373 | -S "early data bytes read" |
| 374 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 376 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 377 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 378 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 379 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 380 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 381 | requires_config_enabled MBEDTLS_DEBUG_C |
| 382 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 383 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 384 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 385 | run_test "TLS 1.3 m->m: resumption, early data cli-default/srv-enabled" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 386 | "$P_SRV debug_level=4 early_data=1 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key" \ |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 387 | "$P_CLI debug_level=3 reco_mode=1 reconnect=1" \ |
| 388 | 0 \ |
| 389 | -c "Protocol is TLSv1.3" \ |
| 390 | -c "Saving session for reuse... ok" \ |
| 391 | -c "Reconnecting with saved session" \ |
| 392 | -c "HTTP/1.0 200 OK" \ |
| 393 | -c "received max_early_data_size" \ |
| 394 | -c "NewSessionTicket: early_data(42) extension received." \ |
| 395 | -C "ClientHello: early_data(42) extension exists." \ |
| 396 | -C "EncryptedExtensions: early_data(42) extension received." \ |
| 397 | -C "bytes of early data written" \ |
| 398 | -s "Protocol is TLSv1.3" \ |
| 399 | -s "key exchange mode: psk" \ |
| 400 | -s "Select PSK ciphersuite" \ |
| 401 | -s "Sent max_early_data_size" \ |
| 402 | -s "NewSessionTicket: early_data(42) extension exists." \ |
| 403 | -S "ClientHello: early_data(42) extension exists." \ |
| 404 | -S "EncryptedExtensions: early_data(42) extension exists." \ |
| 405 | -S "early data bytes read" |
| 406 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 408 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 409 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 410 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 411 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 412 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 413 | requires_config_enabled MBEDTLS_DEBUG_C |
| 414 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 415 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 416 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 417 | run_test "TLS 1.3 m->m: resumption, early data cli-disabled/srv-enabled" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 418 | "$P_SRV debug_level=4 early_data=1 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key" \ |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 419 | "$P_CLI debug_level=3 early_data=0 reco_mode=1 reconnect=1" \ |
| 420 | 0 \ |
| 421 | -c "Protocol is TLSv1.3" \ |
| 422 | -c "Saving session for reuse... ok" \ |
| 423 | -c "Reconnecting with saved session" \ |
| 424 | -c "HTTP/1.0 200 OK" \ |
| 425 | -c "received max_early_data_size" \ |
| 426 | -c "NewSessionTicket: early_data(42) extension received." \ |
| 427 | -C "ClientHello: early_data(42) extension exists." \ |
| 428 | -C "EncryptedExtensions: early_data(42) extension received." \ |
| 429 | -C "bytes of early data written" \ |
| 430 | -s "Protocol is TLSv1.3" \ |
| 431 | -s "key exchange mode: psk" \ |
| 432 | -s "Select PSK ciphersuite" \ |
| 433 | -s "Sent max_early_data_size" \ |
| 434 | -s "NewSessionTicket: early_data(42) extension exists." \ |
| 435 | -S "ClientHello: early_data(42) extension exists." \ |
| 436 | -S "EncryptedExtensions: early_data(42) extension exists." \ |
| 437 | -S "early data bytes read" |
| 438 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 440 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 441 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 442 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 443 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 444 | requires_config_enabled MBEDTLS_DEBUG_C |
| 445 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | dd2dc15 | 2024-03-15 10:08:32 +0100 | [diff] [blame] | 446 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 447 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 448 | run_test "TLS 1.3 m->m: resumption fails, ticket lifetime too long (7d + 1s)" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 449 | "$P_SRV debug_level=2 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key ticket_timeout=604801 tickets=1" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 450 | "$P_CLI reco_mode=1 reconnect=1" \ |
| 451 | 1 \ |
| 452 | -c "Protocol is TLSv1.3" \ |
| 453 | -C "Saving session for reuse... ok" \ |
| 454 | -c "Reconnecting with saved session... failed" \ |
| 455 | -S "Protocol is TLSv1.3" \ |
| 456 | -S "key exchange mode: psk" \ |
| 457 | -S "Select PSK ciphersuite" \ |
| 458 | -s "Ticket lifetime (604801) is greater than 7 days." |
| 459 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 461 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 462 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 463 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 464 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 465 | requires_config_enabled MBEDTLS_DEBUG_C |
| 466 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 467 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 468 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 469 | run_test "TLS 1.3 m->m: resumption fails, ticket lifetime=0" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 470 | "$P_SRV debug_level=2 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key ticket_timeout=0 tickets=1" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 471 | "$P_CLI debug_level=2 reco_mode=1 reconnect=1" \ |
| 472 | 1 \ |
| 473 | -c "Protocol is TLSv1.3" \ |
| 474 | -C "Saving session for reuse... ok" \ |
| 475 | -c "Discard new session ticket" \ |
| 476 | -c "Reconnecting with saved session... failed" \ |
| 477 | -s "Protocol is TLSv1.3" \ |
| 478 | -S "key exchange mode: psk" \ |
| 479 | -S "Select PSK ciphersuite" |
| 480 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 482 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 483 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 484 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 485 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 486 | requires_config_enabled MBEDTLS_DEBUG_C |
| 487 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 488 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 489 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 490 | run_test "TLS 1.3 m->m: resumption fails, servername check failed" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 491 | "$P_SRV debug_level=2 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key \ |
| 492 | sni=localhost,../framework/data_files/server2.crt,../framework/data_files/server2.key,-,-,-,polarssl.example,../framework/data_files/server1-nospace.crt,../framework/data_files/server1.key,-,-,-" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 493 | "$P_CLI debug_level=4 server_name=localhost reco_server_name=remote reco_mode=1 reconnect=1" \ |
| 494 | 1 \ |
| 495 | -c "Protocol is TLSv1.3" \ |
| 496 | -c "Saving session for reuse... ok" \ |
| 497 | -c "Reconnecting with saved session" \ |
| 498 | -c "Hostname mismatch the session ticket, disable session resumption." \ |
| 499 | -s "Protocol is TLSv1.3" \ |
| 500 | -S "key exchange mode: psk" \ |
| 501 | -S "Select PSK ciphersuite" |
| 502 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 504 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 505 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 506 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 507 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 508 | requires_config_enabled MBEDTLS_DEBUG_C |
| 509 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 510 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 511 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 512 | run_test "TLS 1.3 m->m: resumption fails, ticket auth failed." \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 513 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key tickets=8 dummy_ticket=1" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 514 | "$P_CLI reco_mode=1 reconnect=1" \ |
| 515 | 0 \ |
| 516 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 517 | -s "key exchange mode: ephemeral" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 518 | -s "Protocol is TLSv1.3" \ |
| 519 | -c "Saving session for reuse... ok" \ |
| 520 | -c "Reconnecting with saved session" \ |
| 521 | -S "key exchange mode: psk" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 522 | -s "ticket is not authentic" \ |
| 523 | -S "ticket is expired" \ |
Jerry Yu | 60e9972 | 2023-11-20 09:55:24 +0800 | [diff] [blame] | 524 | -S "Invalid ticket creation time" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 525 | -S "Ticket age exceeds limitation" \ |
| 526 | -S "Ticket age outside tolerance window" |
| 527 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 529 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 530 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 531 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 532 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 533 | requires_config_enabled MBEDTLS_DEBUG_C |
| 534 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 535 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
Ronald Cron | f5b4706 | 2022-12-15 13:46:23 +0100 | [diff] [blame] | 536 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 537 | run_test "TLS 1.3 m->m: resumption fails, ticket expired." \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 538 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key tickets=8 dummy_ticket=2" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 539 | "$P_CLI reco_mode=1 reconnect=1" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 540 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 541 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 542 | -s "key exchange mode: ephemeral" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 543 | -s "Protocol is TLSv1.3" \ |
| 544 | -c "Saving session for reuse... ok" \ |
| 545 | -c "Reconnecting with saved session" \ |
| 546 | -S "key exchange mode: psk" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 547 | -S "ticket is not authentic" \ |
| 548 | -s "ticket is expired" \ |
Jerry Yu | 60e9972 | 2023-11-20 09:55:24 +0800 | [diff] [blame] | 549 | -S "Invalid ticket creation time" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 550 | -S "Ticket age exceeds limitation" \ |
| 551 | -S "Ticket age outside tolerance window" |
| 552 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 554 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 555 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 556 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 557 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 558 | requires_config_enabled MBEDTLS_DEBUG_C |
| 559 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 560 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
Ronald Cron | f5b4706 | 2022-12-15 13:46:23 +0100 | [diff] [blame] | 561 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 562 | run_test "TLS 1.3 m->m: resumption fails, invalid creation time." \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 563 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key tickets=8 dummy_ticket=3" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 564 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
| 565 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 566 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 567 | -s "key exchange mode: ephemeral" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 568 | -s "Protocol is TLSv1.3" \ |
| 569 | -c "Saving session for reuse... ok" \ |
| 570 | -c "Reconnecting with saved session" \ |
| 571 | -S "key exchange mode: psk" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 572 | -S "ticket is not authentic" \ |
| 573 | -S "ticket is expired" \ |
Jerry Yu | 60e9972 | 2023-11-20 09:55:24 +0800 | [diff] [blame] | 574 | -s "Invalid ticket creation time" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 575 | -S "Ticket age exceeds limitation" \ |
| 576 | -S "Ticket age outside tolerance window" |
| 577 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 579 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 580 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 581 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 582 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 583 | requires_config_enabled MBEDTLS_DEBUG_C |
| 584 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 585 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
Ronald Cron | f5b4706 | 2022-12-15 13:46:23 +0100 | [diff] [blame] | 586 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 587 | run_test "TLS 1.3 m->m: resumption fails, ticket expired, too old" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 588 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key tickets=8 dummy_ticket=4" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 589 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
| 590 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 591 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 592 | -s "key exchange mode: ephemeral" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 593 | -s "Protocol is TLSv1.3" \ |
| 594 | -c "Saving session for reuse... ok" \ |
| 595 | -c "Reconnecting with saved session" \ |
| 596 | -S "key exchange mode: psk" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 597 | -S "ticket is not authentic" \ |
| 598 | -S "ticket is expired" \ |
Jerry Yu | 60e9972 | 2023-11-20 09:55:24 +0800 | [diff] [blame] | 599 | -S "Invalid ticket creation time" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 600 | -s "Ticket age exceeds limitation" \ |
| 601 | -S "Ticket age outside tolerance window" |
| 602 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 604 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 605 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 606 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 607 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 608 | requires_config_enabled MBEDTLS_DEBUG_C |
| 609 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 610 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
Ronald Cron | f5b4706 | 2022-12-15 13:46:23 +0100 | [diff] [blame] | 611 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 612 | run_test "TLS 1.3 m->m: resumption fails, age outside tolerance window, too young" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 613 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key tickets=8 dummy_ticket=5" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 614 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
| 615 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 616 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 617 | -s "key exchange mode: ephemeral" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 618 | -s "Protocol is TLSv1.3" \ |
| 619 | -c "Saving session for reuse... ok" \ |
| 620 | -c "Reconnecting with saved session" \ |
| 621 | -S "key exchange mode: psk" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 622 | -S "ticket is not authentic" \ |
| 623 | -S "ticket is expired" \ |
Jerry Yu | 60e9972 | 2023-11-20 09:55:24 +0800 | [diff] [blame] | 624 | -S "Invalid ticket creation time" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 625 | -S "Ticket age exceeds limitation" \ |
| 626 | -s "Ticket age outside tolerance window" |
| 627 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 629 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 630 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 631 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 632 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 633 | requires_config_enabled MBEDTLS_DEBUG_C |
| 634 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 635 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
Ronald Cron | f5b4706 | 2022-12-15 13:46:23 +0100 | [diff] [blame] | 636 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 637 | run_test "TLS 1.3 m->m: resumption fails, age outside tolerance window, too old" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 638 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key tickets=8 dummy_ticket=6" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 639 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
| 640 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 641 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 642 | -s "key exchange mode: ephemeral" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 643 | -s "Protocol is TLSv1.3" \ |
| 644 | -c "Saving session for reuse... ok" \ |
| 645 | -c "Reconnecting with saved session" \ |
| 646 | -S "key exchange mode: psk" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 647 | -S "ticket is not authentic" \ |
| 648 | -S "ticket is expired" \ |
Jerry Yu | 60e9972 | 2023-11-20 09:55:24 +0800 | [diff] [blame] | 649 | -S "Invalid ticket creation time" \ |
Jerry Yu | 616ba75 | 2022-11-08 21:49:47 +0800 | [diff] [blame] | 650 | -S "Ticket age exceeds limitation" \ |
| 651 | -s "Ticket age outside tolerance window" |
| 652 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 654 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 655 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 656 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 657 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 658 | requires_config_enabled MBEDTLS_DEBUG_C |
| 659 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 660 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 661 | run_test "TLS 1.3 m->m: resumption fails, cli/tkt kex modes psk/none" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 662 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=7" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 663 | "$P_CLI debug_level=4 tls13_kex_modes=psk_or_ephemeral reconnect=1" \ |
| 664 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 665 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 666 | -s "key exchange mode: ephemeral" \ |
| 667 | -S "key exchange mode: psk_ephemeral" \ |
| 668 | -S "key exchange mode: psk$" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 669 | -s "found matched identity" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 670 | -s "No suitable PSK key exchange mode" \ |
| 671 | -s "No usable PSK or ticket" |
Jerry Yu | e599132 | 2022-11-07 14:03:44 +0800 | [diff] [blame] | 672 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 674 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 675 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 676 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 677 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 678 | requires_config_enabled MBEDTLS_DEBUG_C |
| 679 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 680 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 681 | run_test "TLS 1.3 m->m: ephemeral over psk resumption, cli/tkt kex modes psk/psk" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 682 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=8" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 683 | "$P_CLI debug_level=4 tls13_kex_modes=psk_or_ephemeral reconnect=1" \ |
| 684 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 685 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 686 | -s "key exchange mode: ephemeral" \ |
| 687 | -S "key exchange mode: psk_ephemeral" \ |
| 688 | -S "key exchange mode: psk$" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 689 | -s "found matched identity" \ |
| 690 | -S "No suitable PSK key exchange mode" \ |
| 691 | -S "No usable PSK or ticket" |
| 692 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 694 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 695 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 696 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 697 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 698 | requires_config_enabled MBEDTLS_DEBUG_C |
| 699 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 700 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 701 | run_test "TLS 1.3 m->m: resumption fails, cli/tkt kex modes psk/psk_ephemeral" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 702 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=9" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 703 | "$P_CLI debug_level=4 tls13_kex_modes=psk_or_ephemeral reconnect=1" \ |
| 704 | 0 \ |
| 705 | -c "Protocol is TLSv1.3" \ |
| 706 | -s "key exchange mode: ephemeral" \ |
| 707 | -S "key exchange mode: psk_ephemeral" \ |
| 708 | -S "key exchange mode: psk$" \ |
| 709 | -s "found matched identity" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 710 | -s "No suitable PSK key exchange mode" \ |
| 711 | -s "No usable PSK or ticket" |
| 712 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 714 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 715 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 716 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 717 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 718 | requires_config_enabled MBEDTLS_DEBUG_C |
| 719 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 720 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 721 | run_test "TLS 1.3 m->m: ephemeral over psk resumption, cli/tkt kex modes psk/psk_all" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 722 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=10" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 723 | "$P_CLI debug_level=4 tls13_kex_modes=psk_or_ephemeral reconnect=1" \ |
| 724 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 725 | -c "Protocol is TLSv1.3" \ |
| 726 | -s "key exchange mode: ephemeral" \ |
| 727 | -S "key exchange mode: psk_ephemeral" \ |
| 728 | -S "key exchange mode: psk$" \ |
| 729 | -s "found matched identity" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 730 | -S "No suitable PSK key exchange mode" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 731 | -S "No usable PSK or ticket" |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 732 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 734 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 735 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 736 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 737 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 738 | requires_config_enabled MBEDTLS_DEBUG_C |
| 739 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 740 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 741 | run_test "TLS 1.3 m->m: resumption fails, cli/tkt kex modes psk_ephemeral/none" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 742 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=7" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 743 | "$P_CLI debug_level=4 tls13_kex_modes=ephemeral_all reconnect=1" \ |
| 744 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 745 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 746 | -s "key exchange mode: ephemeral" \ |
| 747 | -S "key exchange mode: psk_ephemeral" \ |
| 748 | -S "key exchange mode: psk$" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 749 | -s "found matched identity" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 750 | -s "No suitable PSK key exchange mode" \ |
| 751 | -s "No usable PSK or ticket" |
Jerry Yu | e599132 | 2022-11-07 14:03:44 +0800 | [diff] [blame] | 752 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 754 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 755 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 756 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 757 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 758 | requires_config_enabled MBEDTLS_DEBUG_C |
| 759 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 760 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 761 | run_test "TLS 1.3 m->m: resumption fails, cli/tkt kex modes psk_ephemeral/psk" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 762 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=8" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 763 | "$P_CLI debug_level=4 tls13_kex_modes=ephemeral_all reconnect=1" \ |
| 764 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 765 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 766 | -s "key exchange mode: ephemeral" \ |
| 767 | -S "key exchange mode: psk_ephemeral" \ |
| 768 | -S "key exchange mode: psk$" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 769 | -s "found matched identity" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 770 | -s "No suitable PSK key exchange mode" \ |
| 771 | -s "No usable PSK or ticket" |
| 772 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 774 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 775 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 776 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 777 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 778 | requires_config_enabled MBEDTLS_DEBUG_C |
| 779 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 780 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 781 | run_test "TLS 1.3 m->m: resumption, cli/tkt kex modes psk_ephemeral/psk_ephemeral" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 782 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=9" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 783 | "$P_CLI debug_level=4 tls13_kex_modes=ephemeral_all reconnect=1" \ |
| 784 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 785 | -c "Protocol is TLSv1.3" \ |
| 786 | -s "key exchange mode: ephemeral" \ |
| 787 | -s "key exchange mode: psk_ephemeral" \ |
| 788 | -S "key exchange mode: psk$" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 789 | -s "found matched identity" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 790 | -S "No suitable PSK key exchange mode" \ |
| 791 | -S "No usable PSK or ticket" |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 792 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 794 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 795 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 796 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 797 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 798 | requires_config_enabled MBEDTLS_DEBUG_C |
| 799 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 800 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 801 | run_test "TLS 1.3 m->m: resumption, cli/tkt kex modes psk_ephemeral/psk_all" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 802 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=10" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 803 | "$P_CLI debug_level=4 tls13_kex_modes=ephemeral_all reconnect=1" \ |
| 804 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 805 | -c "Protocol is TLSv1.3" \ |
| 806 | -s "key exchange mode: ephemeral" \ |
| 807 | -s "key exchange mode: psk_ephemeral" \ |
| 808 | -S "key exchange mode: psk$" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 809 | -s "found matched identity" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 810 | -S "No suitable PSK key exchange mode" \ |
| 811 | -S "No usable PSK or ticket" |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 812 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 814 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 815 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 816 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 817 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 818 | requires_config_enabled MBEDTLS_DEBUG_C |
| 819 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 820 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 821 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 822 | run_test "TLS 1.3 m->m: resumption fails, cli/tkt kex modes psk_all/none" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 823 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=7" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 824 | "$P_CLI debug_level=4 tls13_kex_modes=all reconnect=1" \ |
| 825 | 0 \ |
| 826 | -c "Pre-configured PSK number = 1" \ |
| 827 | -S "sent selected_identity:" \ |
| 828 | -s "key exchange mode: ephemeral" \ |
| 829 | -S "key exchange mode: psk_ephemeral" \ |
| 830 | -S "key exchange mode: psk$" \ |
| 831 | -s "No suitable PSK key exchange mode" \ |
| 832 | -s "No usable PSK or ticket" |
| 833 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 835 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 836 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 837 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 838 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 839 | requires_config_enabled MBEDTLS_DEBUG_C |
| 840 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 841 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 842 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 843 | run_test "TLS 1.3 m->m: ephemeral over psk resumption, cli/tkt kex modes psk_all/psk" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 844 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=8" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 845 | "$P_CLI debug_level=4 tls13_kex_modes=all reconnect=1" \ |
| 846 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 847 | -c "Protocol is TLSv1.3" \ |
| 848 | -s "key exchange mode: ephemeral" \ |
| 849 | -S "key exchange mode: psk_ephemeral" \ |
| 850 | -S "key exchange mode: psk$" \ |
| 851 | -s "found matched identity" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 852 | -S "No suitable PSK key exchange mode" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 853 | -S "No usable PSK or ticket" |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 854 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 856 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 857 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 858 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 859 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 860 | requires_config_enabled MBEDTLS_DEBUG_C |
| 861 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 862 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 863 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 864 | run_test "TLS 1.3 m->m: resumption, cli/tkt kex modes psk_all/psk_ephemeral" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 865 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=9" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 866 | "$P_CLI debug_level=4 tls13_kex_modes=all reconnect=1" \ |
| 867 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 868 | -c "Protocol is TLSv1.3" \ |
| 869 | -s "key exchange mode: ephemeral" \ |
| 870 | -s "key exchange mode: psk_ephemeral" \ |
| 871 | -S "key exchange mode: psk$" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 872 | -s "found matched identity" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 873 | -S "No suitable PSK key exchange mode" \ |
| 874 | -S "No usable PSK or ticket" |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 875 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 876 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 877 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 878 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 879 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 880 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 881 | requires_config_enabled MBEDTLS_DEBUG_C |
| 882 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 883 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 884 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 885 | run_test "TLS 1.3 m->m: resumption, cli/tkt kex modes psk_all/psk_all" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 886 | "$P_SRV debug_level=4 crt_file=../framework/data_files/server5.crt key_file=../framework/data_files/server5.key dummy_ticket=10" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 887 | "$P_CLI debug_level=4 tls13_kex_modes=all reconnect=1" \ |
| 888 | 0 \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 889 | -c "Protocol is TLSv1.3" \ |
| 890 | -s "key exchange mode: ephemeral" \ |
| 891 | -s "key exchange mode: psk_ephemeral" \ |
| 892 | -S "key exchange mode: psk$" \ |
Ronald Cron | 3cf4145 | 2024-03-10 10:44:14 +0100 | [diff] [blame] | 893 | -s "found matched identity" \ |
Ronald Cron | e739892 | 2024-03-10 12:11:02 +0100 | [diff] [blame] | 894 | -S "No suitable PSK key exchange mode" \ |
| 895 | -S "No usable PSK or ticket" |
Jerry Yu | e599132 | 2022-11-07 14:03:44 +0800 | [diff] [blame] | 896 | |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 897 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 898 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 899 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 900 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 901 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 902 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 00fa13b | 2024-03-05 17:45:44 +0100 | [diff] [blame] | 903 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 904 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 905 | run_test "TLS 1.3 m->O: resumption" \ |
| 906 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 1" \ |
| 907 | "$P_CLI reco_mode=1 reconnect=1" \ |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 908 | 0 \ |
| 909 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 00fa13b | 2024-03-05 17:45:44 +0100 | [diff] [blame] | 910 | -c "Saving session for reuse... ok" \ |
| 911 | -c "Reconnecting with saved session... ok" \ |
| 912 | -c "HTTP/1.0 200 ok" |
| 913 | |
Ronald Cron | ceae4f8 | 2024-03-26 11:17:10 +0100 | [diff] [blame] | 914 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 915 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 916 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 917 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ceae4f8 | 2024-03-26 11:17:10 +0100 | [diff] [blame] | 918 | requires_config_disabled MBEDTLS_SSL_SESSION_TICKETS |
| 919 | run_test "TLS 1.3 m->O: resumption fails, no ticket support" \ |
| 920 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 1" \ |
| 921 | "$P_CLI debug_level=3 reco_mode=1 reconnect=1" \ |
| 922 | 1 \ |
| 923 | -c "Protocol is TLSv1.3" \ |
| 924 | -C "Saving session for reuse... ok" \ |
| 925 | -C "Reconnecting with saved session... ok" \ |
| 926 | -c "Ignore NewSessionTicket, not supported." |
| 927 | |
Ronald Cron | 00fa13b | 2024-03-05 17:45:44 +0100 | [diff] [blame] | 928 | # No early data m->O tests for the time being. The option -early_data is needed |
| 929 | # to enable early data on OpenSSL server and it is not compatible with the |
| 930 | # -www option we usually use for testing with OpenSSL server (see |
| 931 | # O_NEXT_SRV_EARLY_DATA definition). In this configuration when running the |
| 932 | # ephemeral then ticket based scenario we use for early data testing the first |
| 933 | # handshake fails. The following skipped test is here to illustrate the kind |
| 934 | # of testing we would like to do. |
| 935 | skip_next_test |
| 936 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 937 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 938 | requires_config_enabled MBEDTLS_DEBUG_C |
| 939 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 940 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 941 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 00fa13b | 2024-03-05 17:45:44 +0100 | [diff] [blame] | 942 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 943 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 944 | run_test "TLS 1.3 m->O: resumption with early data" \ |
| 945 | "$O_NEXT_SRV_EARLY_DATA -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 1" \ |
| 946 | "$P_CLI debug_level=3 early_data=1 reco_mode=1 reconnect=1" \ |
| 947 | 0 \ |
| 948 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 949 | -c "Saving session for reuse... ok" \ |
| 950 | -c "Reconnecting with saved session" \ |
Ronald Cron | 00fa13b | 2024-03-05 17:45:44 +0100 | [diff] [blame] | 951 | -c "HTTP/1.0 200 OK" \ |
| 952 | -c "received max_early_data_size: 16384" \ |
| 953 | -c "NewSessionTicket: early_data(42) extension received." \ |
| 954 | -c "ClientHello: early_data(42) extension exists." \ |
| 955 | -c "EncryptedExtensions: early_data(42) extension received." \ |
| 956 | -c "bytes of early data written" \ |
| 957 | -s "decrypted early data with length:" |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 958 | |
| 959 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 960 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 961 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 962 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 963 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 964 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 965 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 966 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 967 | run_test "TLS 1.3 m->G: resumption" \ |
| 968 | "$G_NEXT_SRV -d 5 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert" \ |
| 969 | "$P_CLI reco_mode=1 reconnect=1" \ |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 970 | 0 \ |
| 971 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 972 | -c "Saving session for reuse... ok" \ |
| 973 | -c "Reconnecting with saved session... ok" \ |
| 974 | -c "HTTP/1.0 200 OK" |
| 975 | |
| 976 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 977 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 978 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 979 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ceae4f8 | 2024-03-26 11:17:10 +0100 | [diff] [blame] | 980 | requires_config_disabled MBEDTLS_SSL_SESSION_TICKETS |
| 981 | run_test "TLS 1.3 m->G: resumption fails, no ticket support" \ |
| 982 | "$G_NEXT_SRV -d 5 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert" \ |
| 983 | "$P_CLI debug_level=3 reco_mode=1 reconnect=1" \ |
| 984 | 1 \ |
| 985 | -c "Protocol is TLSv1.3" \ |
| 986 | -C "Saving session for reuse... ok" \ |
| 987 | -C "Reconnecting with saved session... ok" \ |
| 988 | -c "Ignore NewSessionTicket, not supported." |
| 989 | |
| 990 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 991 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 992 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 993 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 994 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 995 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 996 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 997 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 998 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 |
| 999 | run_test "TLS 1.3 m->G: resumption with AES-256-GCM-SHA384 only" \ |
| 1000 | "$G_NEXT_SRV -d 5 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert" \ |
| 1001 | "$P_CLI force_ciphersuite=TLS1-3-AES-256-GCM-SHA384 reco_mode=1 reconnect=1" \ |
| 1002 | 0 \ |
| 1003 | -c "Protocol is TLSv1.3" \ |
| 1004 | -c "Ciphersuite is TLS1-3-AES-256-GCM-SHA384" \ |
| 1005 | -c "Saving session for reuse... ok" \ |
| 1006 | -c "Reconnecting with saved session... ok" \ |
| 1007 | -c "HTTP/1.0 200 OK" |
| 1008 | |
| 1009 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1010 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 1011 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1012 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1013 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1014 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 1015 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 1016 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 1017 | run_test "TLS 1.3 m->G: resumption with early data" \ |
| 1018 | "$G_NEXT_SRV -d 5 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert \ |
| 1019 | --earlydata --maxearlydata 16384" \ |
| 1020 | "$P_CLI debug_level=3 early_data=1 reco_mode=1 reconnect=1" \ |
| 1021 | 0 \ |
| 1022 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1023 | -c "Saving session for reuse... ok" \ |
| 1024 | -c "Reconnecting with saved session" \ |
| 1025 | -c "HTTP/1.0 200 OK" \ |
Ronald Cron | c8d604d | 2024-03-05 15:05:47 +0100 | [diff] [blame] | 1026 | -c "received max_early_data_size: 16384" \ |
Ronald Cron | c8d604d | 2024-03-05 15:05:47 +0100 | [diff] [blame] | 1027 | -c "NewSessionTicket: early_data(42) extension received." \ |
| 1028 | -c "ClientHello: early_data(42) extension exists." \ |
| 1029 | -c "EncryptedExtensions: early_data(42) extension received." \ |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 1030 | -c "bytes of early data written" \ |
| 1031 | -s "decrypted early data with length:" |
Ronald Cron | c8d604d | 2024-03-05 15:05:47 +0100 | [diff] [blame] | 1032 | |
| 1033 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1034 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 1035 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1036 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1037 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1038 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | c8d604d | 2024-03-05 15:05:47 +0100 | [diff] [blame] | 1039 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 1040 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 1041 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 |
| 1042 | run_test "TLS 1.3 m->G: resumption with early data, AES-256-GCM-SHA384 only" \ |
| 1043 | "$G_NEXT_SRV -d 5 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert \ |
| 1044 | --earlydata --maxearlydata 16384" \ |
| 1045 | "$P_CLI debug_level=3 force_ciphersuite=TLS1-3-AES-256-GCM-SHA384 early_data=1 reco_mode=1 reconnect=1" \ |
Ronald Cron | c8d604d | 2024-03-05 15:05:47 +0100 | [diff] [blame] | 1046 | 0 \ |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 1047 | -c "Protocol is TLSv1.3" \ |
| 1048 | -c "Ciphersuite is TLS1-3-AES-256-GCM-SHA384" \ |
| 1049 | -c "Saving session for reuse... ok" \ |
Ronald Cron | c8d604d | 2024-03-05 15:05:47 +0100 | [diff] [blame] | 1050 | -c "Reconnecting with saved session" \ |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 1051 | -c "HTTP/1.0 200 OK" \ |
| 1052 | -c "received max_early_data_size: 16384" \ |
| 1053 | -c "NewSessionTicket: early_data(42) extension received." \ |
| 1054 | -c "ClientHello: early_data(42) extension exists." \ |
| 1055 | -c "EncryptedExtensions: early_data(42) extension received." \ |
| 1056 | -c "bytes of early data written" \ |
| 1057 | -s "decrypted early data with length:" |
| 1058 | |
| 1059 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1060 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 1061 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1062 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1063 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1064 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 1065 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 1066 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 1067 | run_test "TLS 1.3 m->G: resumption, early data cli-enabled/srv-disabled" \ |
| 1068 | "$G_NEXT_SRV -d 5 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:+ECDHE-PSK:+PSK --disable-client-cert" \ |
| 1069 | "$P_CLI debug_level=3 early_data=1 reco_mode=1 reconnect=1" \ |
| 1070 | 0 \ |
| 1071 | -c "Protocol is TLSv1.3" \ |
| 1072 | -c "Saving session for reuse... ok" \ |
| 1073 | -c "Reconnecting with saved session" \ |
| 1074 | -c "HTTP/1.0 200 OK" \ |
| 1075 | -C "received max_early_data_size: 16384" \ |
Ronald Cron | c8d604d | 2024-03-05 15:05:47 +0100 | [diff] [blame] | 1076 | -C "NewSessionTicket: early_data(42) extension received." \ |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 1077 | |
| 1078 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1079 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 1080 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1081 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1082 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1083 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 1084 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 1085 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 1086 | run_test "TLS 1.3 m->G: resumption, early data cli-default/srv-enabled" \ |
| 1087 | "$G_NEXT_SRV -d 5 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert \ |
| 1088 | --earlydata --maxearlydata 16384" \ |
| 1089 | "$P_CLI debug_level=3 reco_mode=1 reconnect=1" \ |
| 1090 | 0 \ |
| 1091 | -c "Protocol is TLSv1.3" \ |
| 1092 | -c "Saving session for reuse... ok" \ |
| 1093 | -c "Reconnecting with saved session" \ |
| 1094 | -c "HTTP/1.0 200 OK" \ |
| 1095 | -c "received max_early_data_size: 16384" \ |
| 1096 | -c "NewSessionTicket: early_data(42) extension received." \ |
| 1097 | -C "ClientHello: early_data(42) extension exists." \ |
| 1098 | |
| 1099 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1100 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 1101 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1102 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1103 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1104 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 0521008 | 2024-03-05 16:34:51 +0100 | [diff] [blame] | 1105 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED \ |
| 1106 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 1107 | run_test "TLS 1.3 m->G: resumption, early data cli-disabled/srv-enabled" \ |
| 1108 | "$G_NEXT_SRV -d 5 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert \ |
| 1109 | --earlydata --maxearlydata 16384" \ |
| 1110 | "$P_CLI debug_level=3 early_data=0 reco_mode=1 reconnect=1" \ |
| 1111 | 0 \ |
| 1112 | -c "Protocol is TLSv1.3" \ |
| 1113 | -c "Saving session for reuse... ok" \ |
| 1114 | -c "Reconnecting with saved session" \ |
| 1115 | -c "HTTP/1.0 200 OK" \ |
| 1116 | -c "received max_early_data_size: 16384" \ |
| 1117 | -c "NewSessionTicket: early_data(42) extension received." \ |
| 1118 | -C "ClientHello: early_data(42) extension exists." \ |
Ronald Cron | c8d604d | 2024-03-05 15:05:47 +0100 | [diff] [blame] | 1119 | |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1120 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1121 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 1122 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1123 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1124 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 820199a | 2024-03-10 10:39:26 +0100 | [diff] [blame] | 1125 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1126 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 1127 | # https://github.com/openssl/openssl/issues/10714 |
| 1128 | # Until now, OpenSSL client does not support reconnect. |
| 1129 | skip_next_test |
Ronald Cron | 820199a | 2024-03-10 10:39:26 +0100 | [diff] [blame] | 1130 | run_test "TLS 1.3 O->m: resumption" \ |
| 1131 | "$P_SRV debug_level=2 tickets=1" \ |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1132 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 1133 | 0 \ |
Ronald Cron | 820199a | 2024-03-10 10:39:26 +0100 | [diff] [blame] | 1134 | -s "Protocol is TLSv1.3" \ |
| 1135 | -s "key exchange mode: psk" \ |
| 1136 | -s "Select PSK ciphersuite" |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1137 | |
| 1138 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1139 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 1140 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1141 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1142 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1143 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1144 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1145 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1146 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1147 | run_test "TLS 1.3 G->m: resumption" \ |
| 1148 | "$P_SRV debug_level=2 tickets=1" \ |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1149 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r" \ |
| 1150 | 0 \ |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1151 | -s "Protocol is TLSv1.3" \ |
| 1152 | -s "key exchange mode: psk" \ |
| 1153 | -s "Select PSK ciphersuite" |
| 1154 | |
| 1155 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1156 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 1157 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1158 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1159 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1160 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1161 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1162 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 1163 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 1164 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 |
| 1165 | # Test the session resumption when the cipher suite for the original session is |
| 1166 | # TLS1-3-AES-256-GCM-SHA384. In that case, the PSK is 384 bits long and not |
| 1167 | # 256 bits long as with all the other TLS 1.3 cipher suites. |
| 1168 | run_test "TLS 1.3 G->m: resumption with AES-256-GCM-SHA384 only" \ |
| 1169 | "$P_SRV debug_level=2 tickets=1" \ |
| 1170 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-256-GCM -V -r" \ |
| 1171 | 0 \ |
| 1172 | -s "Protocol is TLSv1.3" \ |
| 1173 | -s "key exchange mode: psk" \ |
| 1174 | -s "Select PSK ciphersuite: 1302 - TLS1-3-AES-256-GCM-SHA384" |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1175 | |
Ronald Cron | 854df13 | 2024-03-05 17:50:50 +0100 | [diff] [blame] | 1176 | EARLY_DATA_INPUT_LEN_BLOCKS=$(( ( $( cat $EARLY_DATA_INPUT | wc -c ) + 31 ) / 32 )) |
| 1177 | EARLY_DATA_INPUT_LEN=$(( $EARLY_DATA_INPUT_LEN_BLOCKS * 32 )) |
| 1178 | |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1179 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1180 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 1181 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1182 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1183 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1184 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1185 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1186 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 854df13 | 2024-03-05 17:50:50 +0100 | [diff] [blame] | 1187 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 1188 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1189 | run_test "TLS 1.3 G->m: resumption with early data" \ |
| 1190 | "$P_SRV debug_level=4 tickets=1 early_data=1 max_early_data_size=$EARLY_DATA_INPUT_LEN" \ |
| 1191 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r \ |
| 1192 | --earlydata $EARLY_DATA_INPUT" \ |
Ronald Cron | 854df13 | 2024-03-05 17:50:50 +0100 | [diff] [blame] | 1193 | 0 \ |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1194 | -s "Protocol is TLSv1.3" \ |
| 1195 | -s "key exchange mode: psk" \ |
| 1196 | -s "Select PSK ciphersuite" \ |
| 1197 | -s "Sent max_early_data_size=$EARLY_DATA_INPUT_LEN" \ |
| 1198 | -s "NewSessionTicket: early_data(42) extension exists." \ |
| 1199 | -s "ClientHello: early_data(42) extension exists." \ |
| 1200 | -s "EncryptedExtensions: early_data(42) extension exists." \ |
| 1201 | -s "$( head -1 $EARLY_DATA_INPUT )" \ |
| 1202 | -s "$( tail -1 $EARLY_DATA_INPUT )" \ |
| 1203 | -s "200 early data bytes read" \ |
Ronald Cron | 854df13 | 2024-03-05 17:50:50 +0100 | [diff] [blame] | 1204 | -s "106 early data bytes read" |
| 1205 | |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1206 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1207 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 1208 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1209 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1210 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1211 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1212 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1213 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1214 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1215 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1216 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1217 | run_test "TLS 1.3 G->m: resumption with early data, AES-256-GCM-SHA384 only" \ |
| 1218 | "$P_SRV debug_level=4 tickets=1 early_data=1 max_early_data_size=$EARLY_DATA_INPUT_LEN" \ |
| 1219 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-256-GCM -V -r \ |
| 1220 | --earlydata $EARLY_DATA_INPUT" \ |
| 1221 | 0 \ |
| 1222 | -s "Protocol is TLSv1.3" \ |
| 1223 | -s "key exchange mode: psk" \ |
| 1224 | -s "Select PSK ciphersuite: 1302 - TLS1-3-AES-256-GCM-SHA384" \ |
| 1225 | -s "Sent max_early_data_size=$EARLY_DATA_INPUT_LEN" \ |
| 1226 | -s "NewSessionTicket: early_data(42) extension exists." \ |
| 1227 | -s "ClientHello: early_data(42) extension exists." \ |
| 1228 | -s "EncryptedExtensions: early_data(42) extension exists." \ |
| 1229 | -s "$( head -1 $EARLY_DATA_INPUT )" \ |
| 1230 | -s "$( tail -1 $EARLY_DATA_INPUT )" \ |
| 1231 | -s "200 early data bytes read" \ |
| 1232 | -s "106 early data bytes read" |
| 1233 | |
| 1234 | # The Mbed TLS server does not allow early data for the ticket it sends but |
| 1235 | # the GnuTLS indicates early data anyway when resuming with the ticket and |
| 1236 | # sends early data. The Mbed TLS server does not expect early data in |
| 1237 | # association with the ticket thus it eventually fails the resumption |
| 1238 | # handshake. The GnuTLS client behavior is not compliant here with the TLS 1.3 |
| 1239 | # specification and thus its behavior may change in following versions. |
| 1240 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1241 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 1242 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1243 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1244 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1245 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1246 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1247 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1248 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 1249 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 1250 | run_test "TLS 1.3 G->m: resumption, early data cli-enabled/srv-default" \ |
| 1251 | "$P_SRV debug_level=4 tickets=1" \ |
| 1252 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r \ |
| 1253 | --earlydata $EARLY_DATA_INPUT" \ |
| 1254 | 1 \ |
| 1255 | -s "Protocol is TLSv1.3" \ |
| 1256 | -s "key exchange mode: psk" \ |
| 1257 | -s "Select PSK ciphersuite" \ |
| 1258 | -S "Sent max_early_data_size" \ |
| 1259 | -S "NewSessionTicket: early_data(42) extension exists." \ |
| 1260 | -s "ClientHello: early_data(42) extension exists." \ |
| 1261 | -s "EarlyData: rejected, feature disabled in server configuration." \ |
| 1262 | -S "EncryptedExtensions: early_data(42) extension exists." \ |
| 1263 | -s "EarlyData: deprotect and discard app data records" \ |
| 1264 | -s "EarlyData: Too much early data received" |
| 1265 | |
| 1266 | # The Mbed TLS server does not allow early data for the ticket it sends but |
| 1267 | # the GnuTLS indicates early data anyway when resuming with the ticket and |
| 1268 | # sends early data. The Mbed TLS server does not expect early data in |
| 1269 | # association with the ticket thus it eventually fails the resumption |
| 1270 | # handshake. The GnuTLS client behavior is not compliant here with the TLS 1.3 |
| 1271 | # specification and thus its behavior may change in following versions. |
| 1272 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1273 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 1274 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1275 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1276 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1277 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1278 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1279 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1280 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 1281 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 1282 | run_test "TLS 1.3 G->m: resumption, early data cli-enabled/srv-disabled" \ |
| 1283 | "$P_SRV debug_level=4 tickets=1 early_data=0" \ |
| 1284 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r \ |
| 1285 | --earlydata $EARLY_DATA_INPUT" \ |
| 1286 | 1 \ |
| 1287 | -s "Protocol is TLSv1.3" \ |
| 1288 | -s "key exchange mode: psk" \ |
| 1289 | -s "Select PSK ciphersuite" \ |
| 1290 | -S "Sent max_early_data_size" \ |
| 1291 | -S "NewSessionTicket: early_data(42) extension exists." \ |
| 1292 | -s "ClientHello: early_data(42) extension exists." \ |
| 1293 | -s "EarlyData: rejected, feature disabled in server configuration." \ |
| 1294 | -S "EncryptedExtensions: early_data(42) extension exists." \ |
| 1295 | -s "EarlyData: deprotect and discard app data records" \ |
| 1296 | -s "EarlyData: Too much early data received" |
| 1297 | |
| 1298 | requires_gnutls_tls1_3 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1299 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 1300 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1301 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1302 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1303 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1304 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 1305 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 1ccd7a7 | 2024-03-05 23:31:07 +0100 | [diff] [blame] | 1306 | requires_any_configs_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \ |
| 1307 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 1308 | run_test "TLS 1.3 G->m: resumption, early data cli-disabled/srv-enabled" \ |
| 1309 | "$P_SRV debug_level=4 tickets=1 early_data=1" \ |
| 1310 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r" \ |
| 1311 | 0 \ |
| 1312 | -s "Protocol is TLSv1.3" \ |
| 1313 | -s "key exchange mode: psk" \ |
| 1314 | -s "Select PSK ciphersuite" \ |
| 1315 | -s "Sent max_early_data_size" \ |
| 1316 | -s "NewSessionTicket: early_data(42) extension exists." \ |
| 1317 | -S "ClientHello: early_data(42) extension exists." \ |
| 1318 | -S "EncryptedExtensions: early_data(42) extension exists." |
Ronald Cron | f1ad73f | 2024-03-05 08:38:49 +0100 | [diff] [blame] | 1319 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame^] | 1320 | requires_config_enabled MBEDTLS_SSL_EARLY_DATA |
| 1321 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 1322 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 1323 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1324 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1325 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1326 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 1327 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 1f63fe4 | 2024-02-23 15:49:12 +0100 | [diff] [blame] | 1328 | run_test "TLS 1.3 m->m: Ephemeral over PSK kex with early data enabled" \ |
Ronald Cron | 74191a5 | 2024-03-09 17:38:16 +0100 | [diff] [blame] | 1329 | "$P_SRV force_version=tls13 debug_level=4 early_data=1 max_early_data_size=1024" \ |
Ronald Cron | e14770f | 2024-03-08 08:57:36 +0100 | [diff] [blame] | 1330 | "$P_CLI debug_level=4 early_data=1 tls13_kex_modes=psk_or_ephemeral reco_mode=1 reconnect=1" \ |
Ronald Cron | 1f63fe4 | 2024-02-23 15:49:12 +0100 | [diff] [blame] | 1331 | 0 \ |
| 1332 | -s "key exchange mode: ephemeral" \ |
| 1333 | -S "key exchange mode: psk" \ |
| 1334 | -s "found matched identity" \ |
| 1335 | -s "EarlyData: rejected, not a session resumption" \ |
| 1336 | -C "EncryptedExtensions: early_data(42) extension exists." |