Minos Galanakis | 7771119 | 2024-07-25 14:24:37 +0100 | [diff] [blame] | 1 | # components-configuration-tls.sh |
| 2 | # |
| 3 | # Copyright The Mbed TLS Contributors |
| 4 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
| 5 | |
| 6 | # This file contains test components that are executed by all.sh |
| 7 | |
| 8 | ################################################################ |
| 9 | #### Configuration Testing - TLS |
| 10 | ################################################################ |
Minos Galanakis | 5b4386c | 2024-08-01 17:12:24 +0100 | [diff] [blame] | 11 | |
Gilles Peskine | e9cd6a7 | 2024-09-14 11:21:29 +0200 | [diff] [blame^] | 12 | component_test_config_suite_b_legacy () { |
| 13 | msg "build: configs/config-suite-b.h" |
| 14 | cp configs/config-suite-b.h "$CONFIG_H" |
| 15 | # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake |
| 16 | # want to re-generate generated files that depend on it, quite correctly. |
| 17 | # However this doesn't work as the generation script expects a specific |
| 18 | # format for mbedtls_config.h, which the other files don't follow. Also, |
| 19 | # cmake can't know this, but re-generation is actually not necessary as |
| 20 | # the generated files only depend on the list of available options, not |
| 21 | # whether they're on or off. So, disable cmake's (over-sensitive here) |
| 22 | # dependency resolution for generated files and just rely on them being |
| 23 | # present (thanks to pre_generate_files) by turning GEN_FILES off. |
| 24 | CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . |
| 25 | make |
| 26 | |
| 27 | msg "test: configs/config-suite-b.h - unit tests" |
| 28 | make test |
| 29 | |
| 30 | msg "test: configs/config-suite-b.h - compat.sh" |
| 31 | tests/compat.sh -m tls12 -f 'ECDHE_ECDSA.*AES.*GCM' -p mbedTLS |
| 32 | |
| 33 | msg "build: configs/config-suite-b.h + DEBUG" |
| 34 | MBEDTLS_TEST_CONFIGURATION="$MBEDTLS_TEST_CONFIGURATION+DEBUG" |
| 35 | make clean |
| 36 | scripts/config.py set MBEDTLS_DEBUG_C |
| 37 | scripts/config.py set MBEDTLS_ERROR_C |
| 38 | make ssl-opt |
| 39 | |
| 40 | msg "test: configs/config-suite-b.h + DEBUG - ssl-opt.sh" |
| 41 | tests/ssl-opt.sh |
| 42 | } |
| 43 | |
| 44 | component_test_config_suite_b_psa () { |
| 45 | msg "build: configs/config-suite-b.h + USE_PSA_CRYPTO" |
| 46 | cp configs/config-suite-b.h "$CONFIG_H" |
| 47 | scripts/config.py set MBEDTLS_PSA_CRYPTO_C |
| 48 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 49 | # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake |
| 50 | # want to re-generate generated files that depend on it, quite correctly. |
| 51 | # However this doesn't work as the generation script expects a specific |
| 52 | # format for mbedtls_config.h, which the other files don't follow. Also, |
| 53 | # cmake can't know this, but re-generation is actually not necessary as |
| 54 | # the generated files only depend on the list of available options, not |
| 55 | # whether they're on or off. So, disable cmake's (over-sensitive here) |
| 56 | # dependency resolution for generated files and just rely on them being |
| 57 | # present (thanks to pre_generate_files) by turning GEN_FILES off. |
| 58 | CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . |
| 59 | make |
| 60 | |
| 61 | msg "test: configs/config-suite-b.h + USE_PSA_CRYPTO - unit tests" |
| 62 | make test |
| 63 | |
| 64 | msg "test: configs/config-suite-b.h + USE_PSA_CRYPTO - compat.sh" |
| 65 | tests/compat.sh -m tls12 -f 'ECDHE_ECDSA.*AES.*GCM' -p mbedTLS |
| 66 | |
| 67 | msg "build: configs/config-suite-b.h + USE_PSA_CRYPTO + DEBUG" |
| 68 | MBEDTLS_TEST_CONFIGURATION="$MBEDTLS_TEST_CONFIGURATION+DEBUG" |
| 69 | make clean |
| 70 | scripts/config.py set MBEDTLS_DEBUG_C |
| 71 | scripts/config.py set MBEDTLS_ERROR_C |
| 72 | make ssl-opt |
| 73 | |
| 74 | msg "test: configs/config-suite-b.h + USE_PSA_CRYPTO + DEBUG - ssl-opt.sh" |
| 75 | tests/ssl-opt.sh |
| 76 | } |
| 77 | |
Minos Galanakis | 5b4386c | 2024-08-01 17:12:24 +0100 | [diff] [blame] | 78 | component_test_no_renegotiation () { |
| 79 | msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min |
| 80 | scripts/config.py unset MBEDTLS_SSL_RENEGOTIATION |
| 81 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 82 | make |
| 83 | |
| 84 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 85 | make test |
| 86 | |
| 87 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - ssl-opt.sh (ASan build)" # ~ 6 min |
| 88 | tests/ssl-opt.sh |
| 89 | } |
| 90 | |
| 91 | component_test_tls1_2_default_stream_cipher_only () { |
| 92 | msg "build: default with only stream cipher" |
| 93 | |
| 94 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C |
| 95 | scripts/config.py unset MBEDTLS_GCM_C |
| 96 | scripts/config.py unset MBEDTLS_CCM_C |
| 97 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 98 | #Disable TLS 1.3 (as no AEAD) |
| 99 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 100 | # Disable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 101 | scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC |
| 102 | # Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 103 | scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 104 | # Enable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 105 | scripts/config.py set MBEDTLS_CIPHER_NULL_CIPHER |
| 106 | # Modules that depend on AEAD |
| 107 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 108 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 109 | |
| 110 | make |
| 111 | |
| 112 | msg "test: default with only stream cipher" |
| 113 | make test |
| 114 | |
| 115 | # Not running ssl-opt.sh because most tests require a non-NULL ciphersuite. |
| 116 | } |
| 117 | |
Minos Galanakis | 85347d1 | 2024-08-01 22:45:10 +0100 | [diff] [blame] | 118 | component_test_tls1_2_default_stream_cipher_only_use_psa () { |
| 119 | msg "build: default with only stream cipher use psa" |
| 120 | |
| 121 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 122 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 123 | scripts/config.py unset MBEDTLS_GCM_C |
| 124 | scripts/config.py unset MBEDTLS_CCM_C |
| 125 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 126 | #Disable TLS 1.3 (as no AEAD) |
| 127 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 128 | # Disable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 129 | scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC |
| 130 | # Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 131 | scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 132 | # Enable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 133 | scripts/config.py set MBEDTLS_CIPHER_NULL_CIPHER |
| 134 | # Modules that depend on AEAD |
| 135 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 136 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 137 | |
| 138 | make |
| 139 | |
| 140 | msg "test: default with only stream cipher use psa" |
| 141 | make test |
| 142 | |
| 143 | # Not running ssl-opt.sh because most tests require a non-NULL ciphersuite. |
| 144 | } |
| 145 | |
Minos Galanakis | 5b4386c | 2024-08-01 17:12:24 +0100 | [diff] [blame] | 146 | component_test_tls1_2_default_cbc_legacy_cipher_only () { |
| 147 | msg "build: default with only CBC-legacy cipher" |
| 148 | |
| 149 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 150 | scripts/config.py unset MBEDTLS_GCM_C |
| 151 | scripts/config.py unset MBEDTLS_CCM_C |
| 152 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 153 | #Disable TLS 1.3 (as no AEAD) |
| 154 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 155 | # Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 156 | scripts/config.py set MBEDTLS_CIPHER_MODE_CBC |
| 157 | # Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 158 | scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 159 | # Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 160 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 161 | # Modules that depend on AEAD |
| 162 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 163 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 164 | |
| 165 | make |
| 166 | |
| 167 | msg "test: default with only CBC-legacy cipher" |
| 168 | make test |
| 169 | |
| 170 | msg "test: default with only CBC-legacy cipher - ssl-opt.sh (subset)" |
| 171 | tests/ssl-opt.sh -f "TLS 1.2" |
| 172 | } |
| 173 | |
Minos Galanakis | 4ca7b14 | 2024-08-05 12:20:21 +0100 | [diff] [blame] | 174 | component_test_tls1_2_default_cbc_legacy_cipher_only_use_psa () { |
Minos Galanakis | 85347d1 | 2024-08-01 22:45:10 +0100 | [diff] [blame] | 175 | msg "build: default with only CBC-legacy cipher use psa" |
| 176 | |
| 177 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 178 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 179 | scripts/config.py unset MBEDTLS_GCM_C |
| 180 | scripts/config.py unset MBEDTLS_CCM_C |
| 181 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 182 | #Disable TLS 1.3 (as no AEAD) |
| 183 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 184 | # Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 185 | scripts/config.py set MBEDTLS_CIPHER_MODE_CBC |
| 186 | # Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 187 | scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 188 | # Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 189 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 190 | # Modules that depend on AEAD |
| 191 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 192 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 193 | |
| 194 | make |
| 195 | |
| 196 | msg "test: default with only CBC-legacy cipher use psa" |
| 197 | make test |
| 198 | |
| 199 | msg "test: default with only CBC-legacy cipher use psa - ssl-opt.sh (subset)" |
| 200 | tests/ssl-opt.sh -f "TLS 1.2" |
| 201 | } |
| 202 | |
Minos Galanakis | 5b4386c | 2024-08-01 17:12:24 +0100 | [diff] [blame] | 203 | component_test_tls1_2_default_cbc_legacy_cbc_etm_cipher_only () { |
| 204 | msg "build: default with only CBC-legacy and CBC-EtM ciphers" |
| 205 | |
| 206 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 207 | scripts/config.py unset MBEDTLS_GCM_C |
| 208 | scripts/config.py unset MBEDTLS_CCM_C |
| 209 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 210 | #Disable TLS 1.3 (as no AEAD) |
| 211 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 212 | # Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 213 | scripts/config.py set MBEDTLS_CIPHER_MODE_CBC |
| 214 | # Enable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 215 | scripts/config.py set MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 216 | # Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 217 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 218 | # Modules that depend on AEAD |
| 219 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 220 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 221 | |
| 222 | make |
| 223 | |
| 224 | msg "test: default with only CBC-legacy and CBC-EtM ciphers" |
| 225 | make test |
| 226 | |
| 227 | msg "test: default with only CBC-legacy and CBC-EtM ciphers - ssl-opt.sh (subset)" |
| 228 | tests/ssl-opt.sh -f "TLS 1.2" |
| 229 | } |
| 230 | |
Minos Galanakis | 85347d1 | 2024-08-01 22:45:10 +0100 | [diff] [blame] | 231 | component_test_tls1_2_default_cbc_legacy_cbc_etm_cipher_only_use_psa () { |
| 232 | msg "build: default with only CBC-legacy and CBC-EtM ciphers use psa" |
| 233 | |
| 234 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 235 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 236 | scripts/config.py unset MBEDTLS_GCM_C |
| 237 | scripts/config.py unset MBEDTLS_CCM_C |
| 238 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 239 | #Disable TLS 1.3 (as no AEAD) |
| 240 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 241 | # Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 242 | scripts/config.py set MBEDTLS_CIPHER_MODE_CBC |
| 243 | # Enable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 244 | scripts/config.py set MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 245 | # Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 246 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 247 | # Modules that depend on AEAD |
| 248 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 249 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 250 | |
| 251 | make |
| 252 | |
| 253 | msg "test: default with only CBC-legacy and CBC-EtM ciphers use psa" |
| 254 | make test |
| 255 | |
| 256 | msg "test: default with only CBC-legacy and CBC-EtM ciphers use psa - ssl-opt.sh (subset)" |
| 257 | tests/ssl-opt.sh -f "TLS 1.2" |
| 258 | } |
| 259 | |
Minos Galanakis | 5b4386c | 2024-08-01 17:12:24 +0100 | [diff] [blame] | 260 | # We're not aware of any other (open source) implementation of EC J-PAKE in TLS |
| 261 | # that we could use for interop testing. However, we now have sort of two |
| 262 | # implementations ourselves: one using PSA, the other not. At least test that |
| 263 | # these two interoperate with each other. |
| 264 | component_test_tls1_2_ecjpake_compatibility () { |
| 265 | msg "build: TLS1.2 server+client w/ EC-JPAKE w/o USE_PSA" |
| 266 | scripts/config.py set MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 267 | # Explicitly make lib first to avoid a race condition: |
| 268 | # https://github.com/Mbed-TLS/mbedtls/issues/8229 |
| 269 | make lib |
| 270 | make -C programs ssl/ssl_server2 ssl/ssl_client2 |
| 271 | cp programs/ssl/ssl_server2 s2_no_use_psa |
| 272 | cp programs/ssl/ssl_client2 c2_no_use_psa |
| 273 | |
| 274 | msg "build: TLS1.2 server+client w/ EC-JPAKE w/ USE_PSA" |
| 275 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 276 | make clean |
| 277 | make lib |
| 278 | make -C programs ssl/ssl_server2 ssl/ssl_client2 |
| 279 | make -C programs test/udp_proxy test/query_compile_time_config |
| 280 | |
| 281 | msg "test: server w/o USE_PSA - client w/ USE_PSA, text password" |
| 282 | P_SRV=../s2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: working, TLS" |
| 283 | msg "test: server w/o USE_PSA - client w/ USE_PSA, opaque password" |
| 284 | P_SRV=../s2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: opaque password client only, working, TLS" |
| 285 | msg "test: client w/o USE_PSA - server w/ USE_PSA, text password" |
| 286 | P_CLI=../c2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: working, TLS" |
| 287 | msg "test: client w/o USE_PSA - server w/ USE_PSA, opaque password" |
| 288 | P_CLI=../c2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: opaque password server only, working, TLS" |
| 289 | |
| 290 | rm s2_no_use_psa c2_no_use_psa |
| 291 | } |
| 292 | |
Gilles Peskine | f3d5019 | 2024-09-14 11:10:05 +0200 | [diff] [blame] | 293 | component_test_tls1_2_ccm_psk_legacy () { |
| 294 | msg "build: configs/config-ccm-psk-tls1_2.h" |
| 295 | cp configs/config-ccm-psk-tls1_2.h "$CONFIG_H" |
| 296 | # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake |
| 297 | # want to re-generate generated files that depend on it, quite correctly. |
| 298 | # However this doesn't work as the generation script expects a specific |
| 299 | # format for mbedtls_config.h, which the other files don't follow. Also, |
| 300 | # cmake can't know this, but re-generation is actually not necessary as |
| 301 | # the generated files only depend on the list of available options, not |
| 302 | # whether they're on or off. So, disable cmake's (over-sensitive here) |
| 303 | # dependency resolution for generated files and just rely on them being |
| 304 | # present (thanks to pre_generate_files) by turning GEN_FILES off. |
| 305 | CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . |
| 306 | make |
| 307 | |
| 308 | msg "test: configs/config-ccm-psk-tls1_2.h - unit tests" |
| 309 | make test |
| 310 | |
| 311 | msg "test: configs/config-ccm-psk-tls1_2.h - compat.sh" |
| 312 | tests/compat.sh -m tls12 -f '^TLS_PSK_WITH_AES_..._CCM_8' |
| 313 | } |
| 314 | |
| 315 | component_test_tls1_2_ccm_psk_psa () { |
| 316 | msg "build: configs/config-ccm-psk-tls1_2.h + USE_PSA_CRYPTO" |
| 317 | cp configs/config-ccm-psk-tls1_2.h "$CONFIG_H" |
| 318 | scripts/config.py set MBEDTLS_PSA_CRYPTO_C |
| 319 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 320 | # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake |
| 321 | # want to re-generate generated files that depend on it, quite correctly. |
| 322 | # However this doesn't work as the generation script expects a specific |
| 323 | # format for mbedtls_config.h, which the other files don't follow. Also, |
| 324 | # cmake can't know this, but re-generation is actually not necessary as |
| 325 | # the generated files only depend on the list of available options, not |
| 326 | # whether they're on or off. So, disable cmake's (over-sensitive here) |
| 327 | # dependency resolution for generated files and just rely on them being |
| 328 | # present (thanks to pre_generate_files) by turning GEN_FILES off. |
| 329 | CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . |
| 330 | make |
| 331 | |
| 332 | msg "test: configs/config-ccm-psk-tls1_2.h + USE_PSA_CRYPTO - unit tests" |
| 333 | make test |
| 334 | |
| 335 | msg "test: configs/config-ccm-psk-tls1_2.h + USE_PSA_CRYPTO - compat.sh" |
| 336 | tests/compat.sh -m tls12 -f '^TLS_PSK_WITH_AES_..._CCM_8' |
| 337 | } |
| 338 | |
Gilles Peskine | 9929237 | 2024-09-14 11:19:31 +0200 | [diff] [blame] | 339 | component_test_tls1_2_ccm_psk_dtls_legacy () { |
| 340 | msg "build: configs/config-ccm-psk-dtls1_2.h" |
| 341 | cp configs/config-ccm-psk-dtls1_2.h "$CONFIG_H" |
| 342 | # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake |
| 343 | # want to re-generate generated files that depend on it, quite correctly. |
| 344 | # However this doesn't work as the generation script expects a specific |
| 345 | # format for mbedtls_config.h, which the other files don't follow. Also, |
| 346 | # cmake can't know this, but re-generation is actually not necessary as |
| 347 | # the generated files only depend on the list of available options, not |
| 348 | # whether they're on or off. So, disable cmake's (over-sensitive here) |
| 349 | # dependency resolution for generated files and just rely on them being |
| 350 | # present (thanks to pre_generate_files) by turning GEN_FILES off. |
| 351 | CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . |
| 352 | make |
| 353 | |
| 354 | msg "test: configs/config-ccm-psk-dtls1_2.h - unit tests" |
| 355 | make test |
| 356 | |
| 357 | msg "test: configs/config-ccm-psk-dtls1_2.h - compat.sh" |
| 358 | tests/compat.sh -m dtls12 -f '^TLS_PSK_WITH_AES_..._CCM_8' |
| 359 | |
| 360 | msg "build: configs/config-ccm-psk-dtls1_2.h + DEBUG" |
| 361 | MBEDTLS_TEST_CONFIGURATION="$MBEDTLS_TEST_CONFIGURATION+DEBUG" |
| 362 | make clean |
| 363 | scripts/config.py set MBEDTLS_DEBUG_C |
| 364 | scripts/config.py set MBEDTLS_ERROR_C |
| 365 | make ssl-opt |
| 366 | |
| 367 | msg "test: configs/config-ccm-psk-dtls1_2.h + DEBUG - ssl-opt.sh" |
| 368 | tests/ssl-opt.sh |
| 369 | } |
| 370 | |
| 371 | component_test_tls1_2_ccm_psk_dtls_psa () { |
| 372 | msg "build: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO" |
| 373 | cp configs/config-ccm-psk-dtls1_2.h "$CONFIG_H" |
| 374 | scripts/config.py set MBEDTLS_PSA_CRYPTO_C |
| 375 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 376 | # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake |
| 377 | # want to re-generate generated files that depend on it, quite correctly. |
| 378 | # However this doesn't work as the generation script expects a specific |
| 379 | # format for mbedtls_config.h, which the other files don't follow. Also, |
| 380 | # cmake can't know this, but re-generation is actually not necessary as |
| 381 | # the generated files only depend on the list of available options, not |
| 382 | # whether they're on or off. So, disable cmake's (over-sensitive here) |
| 383 | # dependency resolution for generated files and just rely on them being |
| 384 | # present (thanks to pre_generate_files) by turning GEN_FILES off. |
| 385 | CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . |
| 386 | make |
| 387 | |
| 388 | msg "test: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO - unit tests" |
| 389 | make test |
| 390 | |
| 391 | msg "test: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO - compat.sh" |
| 392 | tests/compat.sh -m dtls12 -f '^TLS_PSK_WITH_AES_..._CCM_8' |
| 393 | |
| 394 | msg "build: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO + DEBUG" |
| 395 | MBEDTLS_TEST_CONFIGURATION="$MBEDTLS_TEST_CONFIGURATION+DEBUG" |
| 396 | make clean |
| 397 | scripts/config.py set MBEDTLS_DEBUG_C |
| 398 | scripts/config.py set MBEDTLS_ERROR_C |
| 399 | make ssl-opt |
| 400 | |
| 401 | msg "test: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO + DEBUG - ssl-opt.sh" |
| 402 | tests/ssl-opt.sh |
| 403 | } |
| 404 | |
Minos Galanakis | 5b4386c | 2024-08-01 17:12:24 +0100 | [diff] [blame] | 405 | component_test_small_ssl_out_content_len () { |
| 406 | msg "build: small SSL_OUT_CONTENT_LEN (ASan build)" |
| 407 | scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 16384 |
| 408 | scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 4096 |
| 409 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 410 | make |
| 411 | |
| 412 | msg "test: small SSL_OUT_CONTENT_LEN - ssl-opt.sh MFL and large packet tests" |
| 413 | tests/ssl-opt.sh -f "Max fragment\|Large packet" |
| 414 | } |
| 415 | |
| 416 | component_test_small_ssl_in_content_len () { |
| 417 | msg "build: small SSL_IN_CONTENT_LEN (ASan build)" |
| 418 | scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 4096 |
| 419 | scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 16384 |
| 420 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 421 | make |
| 422 | |
| 423 | msg "test: small SSL_IN_CONTENT_LEN - ssl-opt.sh MFL tests" |
| 424 | tests/ssl-opt.sh -f "Max fragment" |
| 425 | } |
| 426 | |
| 427 | component_test_small_ssl_dtls_max_buffering () { |
| 428 | msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0" |
| 429 | scripts/config.py set MBEDTLS_SSL_DTLS_MAX_BUFFERING 1000 |
| 430 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 431 | make |
| 432 | |
| 433 | msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0 - ssl-opt.sh specific reordering test" |
| 434 | tests/ssl-opt.sh -f "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" |
| 435 | } |
| 436 | |
| 437 | component_test_small_mbedtls_ssl_dtls_max_buffering () { |
| 438 | msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1" |
| 439 | scripts/config.py set MBEDTLS_SSL_DTLS_MAX_BUFFERING 190 |
| 440 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 441 | make |
| 442 | |
| 443 | msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1 - ssl-opt.sh specific reordering test" |
| 444 | tests/ssl-opt.sh -f "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" |
| 445 | } |
| 446 | |
| 447 | component_test_depends_py_kex () { |
| 448 | msg "test/build: depends.py kex (gcc)" |
| 449 | tests/scripts/depends.py kex --unset-use-psa |
| 450 | } |
| 451 | |
| 452 | component_test_depends_py_kex_psa () { |
| 453 | msg "test/build: depends.py kex (gcc) with MBEDTLS_USE_PSA_CRYPTO defined" |
| 454 | tests/scripts/depends.py kex |
| 455 | } |
| 456 | |
| 457 | # Common helper for component_full_without_ecdhe_ecdsa() and |
| 458 | # component_full_without_ecdhe_ecdsa_and_tls13() which: |
| 459 | # - starts from the "full" configuration minus the list of symbols passed in |
| 460 | # as 1st parameter |
| 461 | # - build |
| 462 | # - test only TLS (i.e. test_suite_tls and ssl-opt) |
| 463 | build_full_minus_something_and_test_tls () { |
| 464 | symbols_to_disable="$1" |
| 465 | |
| 466 | msg "build: full minus something, test TLS" |
| 467 | |
| 468 | scripts/config.py full |
| 469 | for sym in $symbols_to_disable; do |
| 470 | echo "Disabling $sym" |
| 471 | scripts/config.py unset $sym |
| 472 | done |
| 473 | |
| 474 | make |
| 475 | |
| 476 | msg "test: full minus something, test TLS" |
| 477 | ( cd tests; ./test_suite_ssl ) |
| 478 | |
| 479 | msg "ssl-opt: full minus something, test TLS" |
| 480 | tests/ssl-opt.sh |
| 481 | } |
| 482 | |
| 483 | component_full_without_ecdhe_ecdsa () { |
| 484 | build_full_minus_something_and_test_tls "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED" |
| 485 | } |
| 486 | |
| 487 | component_full_without_ecdhe_ecdsa_and_tls13 () { |
| 488 | build_full_minus_something_and_test_tls "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 489 | MBEDTLS_SSL_PROTO_TLS1_3" |
| 490 | } |
| 491 | |
| 492 | component_build_no_ssl_srv () { |
| 493 | msg "build: full config except SSL server, make, gcc" # ~ 30s |
| 494 | scripts/config.py full |
| 495 | scripts/config.py unset MBEDTLS_SSL_SRV_C |
Minos Galanakis | 83222b8 | 2024-08-06 12:06:51 +0100 | [diff] [blame] | 496 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1 -Wmissing-prototypes' |
Minos Galanakis | 5b4386c | 2024-08-01 17:12:24 +0100 | [diff] [blame] | 497 | } |
| 498 | |
| 499 | component_build_no_ssl_cli () { |
| 500 | msg "build: full config except SSL client, make, gcc" # ~ 30s |
| 501 | scripts/config.py full |
| 502 | scripts/config.py unset MBEDTLS_SSL_CLI_C |
Minos Galanakis | 83222b8 | 2024-08-06 12:06:51 +0100 | [diff] [blame] | 503 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1 -Wmissing-prototypes' |
Minos Galanakis | 5b4386c | 2024-08-01 17:12:24 +0100 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | component_test_no_max_fragment_length () { |
| 507 | # Run max fragment length tests with MFL disabled |
| 508 | msg "build: default config except MFL extension (ASan build)" # ~ 30s |
| 509 | scripts/config.py unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 510 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 511 | make |
| 512 | |
| 513 | msg "test: ssl-opt.sh, MFL-related tests" |
| 514 | tests/ssl-opt.sh -f "Max fragment length" |
| 515 | } |
| 516 | |
| 517 | component_test_asan_remove_peer_certificate () { |
| 518 | msg "build: default config with MBEDTLS_SSL_KEEP_PEER_CERTIFICATE disabled (ASan build)" |
| 519 | scripts/config.py unset MBEDTLS_SSL_KEEP_PEER_CERTIFICATE |
| 520 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 521 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 522 | make |
| 523 | |
| 524 | msg "test: !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 525 | make test |
| 526 | |
| 527 | msg "test: ssl-opt.sh, !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 528 | tests/ssl-opt.sh |
| 529 | |
| 530 | msg "test: compat.sh, !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 531 | tests/compat.sh |
| 532 | |
| 533 | msg "test: context-info.sh, !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 534 | tests/context-info.sh |
| 535 | } |
| 536 | |
| 537 | component_test_no_max_fragment_length_small_ssl_out_content_len () { |
| 538 | msg "build: no MFL extension, small SSL_OUT_CONTENT_LEN (ASan build)" |
| 539 | scripts/config.py unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 540 | scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 16384 |
| 541 | scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 4096 |
| 542 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 543 | make |
| 544 | |
| 545 | msg "test: MFL tests (disabled MFL extension case) & large packet tests" |
| 546 | tests/ssl-opt.sh -f "Max fragment length\|Large buffer" |
| 547 | |
| 548 | msg "test: context-info.sh (disabled MFL extension case)" |
| 549 | tests/context-info.sh |
| 550 | } |
| 551 | |
| 552 | component_test_variable_ssl_in_out_buffer_len () { |
| 553 | msg "build: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled (ASan build)" |
| 554 | scripts/config.py set MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 555 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 556 | make |
| 557 | |
| 558 | msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled" |
| 559 | make test |
| 560 | |
| 561 | msg "test: ssl-opt.sh, MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled" |
| 562 | tests/ssl-opt.sh |
| 563 | |
| 564 | msg "test: compat.sh, MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled" |
| 565 | tests/compat.sh |
| 566 | } |
| 567 | |
| 568 | component_test_dtls_cid_legacy () { |
| 569 | msg "build: MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy) enabled (ASan build)" |
| 570 | scripts/config.py set MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 1 |
| 571 | |
| 572 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 573 | make |
| 574 | |
| 575 | msg "test: MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy)" |
| 576 | make test |
| 577 | |
| 578 | msg "test: ssl-opt.sh, MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy) enabled" |
| 579 | tests/ssl-opt.sh |
| 580 | |
| 581 | msg "test: compat.sh, MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy) enabled" |
| 582 | tests/compat.sh |
| 583 | } |
| 584 | |
| 585 | component_test_ssl_alloc_buffer_and_mfl () { |
| 586 | msg "build: default config with memory buffer allocator and MFL extension" |
| 587 | scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 588 | scripts/config.py set MBEDTLS_PLATFORM_MEMORY |
| 589 | scripts/config.py set MBEDTLS_MEMORY_DEBUG |
| 590 | scripts/config.py set MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 591 | scripts/config.py set MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 592 | cmake -DCMAKE_BUILD_TYPE:String=Release . |
| 593 | make |
| 594 | |
| 595 | msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH, MBEDTLS_MEMORY_BUFFER_ALLOC_C, MBEDTLS_MEMORY_DEBUG and MBEDTLS_SSL_MAX_FRAGMENT_LENGTH" |
| 596 | make test |
| 597 | |
| 598 | msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH, MBEDTLS_MEMORY_BUFFER_ALLOC_C, MBEDTLS_MEMORY_DEBUG and MBEDTLS_SSL_MAX_FRAGMENT_LENGTH" |
| 599 | tests/ssl-opt.sh -f "Handshake memory usage" |
| 600 | } |
| 601 | |
| 602 | component_test_when_no_ciphersuites_have_mac () { |
| 603 | msg "build: when no ciphersuites have MAC" |
| 604 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 605 | scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC |
| 606 | scripts/config.py unset MBEDTLS_CMAC_C |
| 607 | make |
| 608 | |
| 609 | msg "test: !MBEDTLS_SSL_SOME_SUITES_USE_MAC" |
| 610 | make test |
| 611 | |
| 612 | msg "test ssl-opt.sh: !MBEDTLS_SSL_SOME_SUITES_USE_MAC" |
| 613 | tests/ssl-opt.sh -f 'Default\|EtM' -e 'without EtM' |
| 614 | } |
| 615 | |
| 616 | component_test_tls12_only () { |
| 617 | msg "build: default config without MBEDTLS_SSL_PROTO_TLS1_3, cmake, gcc, ASan" |
| 618 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 619 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 620 | make |
| 621 | |
| 622 | msg "test: main suites (inc. selftests) (ASan build)" |
| 623 | make test |
| 624 | |
| 625 | msg "test: ssl-opt.sh (ASan build)" |
| 626 | tests/ssl-opt.sh |
| 627 | |
| 628 | msg "test: compat.sh (ASan build)" |
| 629 | tests/compat.sh |
| 630 | } |
| 631 | |
| 632 | component_test_tls13_only () { |
| 633 | msg "build: default config without MBEDTLS_SSL_PROTO_TLS1_2" |
| 634 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 635 | scripts/config.py set MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 636 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 637 | |
| 638 | msg "test: TLS 1.3 only, all key exchange modes enabled" |
| 639 | make test |
| 640 | |
| 641 | msg "ssl-opt.sh: TLS 1.3 only, all key exchange modes enabled" |
| 642 | tests/ssl-opt.sh |
| 643 | } |
| 644 | |
| 645 | component_test_tls13_only_psk () { |
| 646 | msg "build: TLS 1.3 only from default, only PSK key exchange mode" |
| 647 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 648 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 649 | scripts/config.py unset MBEDTLS_ECDH_C |
| 650 | scripts/config.py unset MBEDTLS_DHM_C |
| 651 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 652 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 653 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 654 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 655 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 656 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 657 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 658 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 659 | |
| 660 | msg "test_suite_ssl: TLS 1.3 only, only PSK key exchange mode enabled" |
| 661 | cd tests; ./test_suite_ssl; cd .. |
| 662 | |
| 663 | msg "ssl-opt.sh: TLS 1.3 only, only PSK key exchange mode enabled" |
| 664 | tests/ssl-opt.sh |
| 665 | } |
| 666 | |
| 667 | component_test_tls13_only_ephemeral () { |
| 668 | msg "build: TLS 1.3 only from default, only ephemeral key exchange mode" |
| 669 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 670 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 671 | scripts/config.py unset MBEDTLS_SSL_EARLY_DATA |
| 672 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 673 | |
| 674 | msg "test_suite_ssl: TLS 1.3 only, only ephemeral key exchange mode" |
| 675 | cd tests; ./test_suite_ssl; cd .. |
| 676 | |
| 677 | msg "ssl-opt.sh: TLS 1.3 only, only ephemeral key exchange mode" |
| 678 | tests/ssl-opt.sh |
| 679 | } |
| 680 | |
| 681 | component_test_tls13_only_ephemeral_ffdh () { |
| 682 | msg "build: TLS 1.3 only from default, only ephemeral ffdh key exchange mode" |
| 683 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 684 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 685 | scripts/config.py unset MBEDTLS_SSL_EARLY_DATA |
| 686 | scripts/config.py unset MBEDTLS_ECDH_C |
| 687 | |
| 688 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 689 | |
| 690 | msg "test_suite_ssl: TLS 1.3 only, only ephemeral ffdh key exchange mode" |
| 691 | cd tests; ./test_suite_ssl; cd .. |
| 692 | |
| 693 | msg "ssl-opt.sh: TLS 1.3 only, only ephemeral ffdh key exchange mode" |
| 694 | tests/ssl-opt.sh |
| 695 | } |
| 696 | |
| 697 | component_test_tls13_only_psk_ephemeral () { |
| 698 | msg "build: TLS 1.3 only from default, only PSK ephemeral key exchange mode" |
| 699 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 700 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 701 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 702 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 703 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 704 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 705 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 706 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 707 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 708 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 709 | |
| 710 | msg "test_suite_ssl: TLS 1.3 only, only PSK ephemeral key exchange mode" |
| 711 | cd tests; ./test_suite_ssl; cd .. |
| 712 | |
| 713 | msg "ssl-opt.sh: TLS 1.3 only, only PSK ephemeral key exchange mode" |
| 714 | tests/ssl-opt.sh |
| 715 | } |
| 716 | |
| 717 | component_test_tls13_only_psk_ephemeral_ffdh () { |
| 718 | msg "build: TLS 1.3 only from default, only PSK ephemeral ffdh key exchange mode" |
| 719 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 720 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 721 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 722 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 723 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 724 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 725 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 726 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 727 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 728 | scripts/config.py unset MBEDTLS_ECDH_C |
| 729 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 730 | |
| 731 | msg "test_suite_ssl: TLS 1.3 only, only PSK ephemeral ffdh key exchange mode" |
| 732 | cd tests; ./test_suite_ssl; cd .. |
| 733 | |
| 734 | msg "ssl-opt.sh: TLS 1.3 only, only PSK ephemeral ffdh key exchange mode" |
| 735 | tests/ssl-opt.sh |
| 736 | } |
| 737 | |
| 738 | component_test_tls13_only_psk_all () { |
| 739 | msg "build: TLS 1.3 only from default, without ephemeral key exchange mode" |
| 740 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 741 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 742 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 743 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 744 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 745 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 746 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 747 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 748 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 749 | |
| 750 | msg "test_suite_ssl: TLS 1.3 only, PSK and PSK ephemeral key exchange modes" |
| 751 | cd tests; ./test_suite_ssl; cd .. |
| 752 | |
| 753 | msg "ssl-opt.sh: TLS 1.3 only, PSK and PSK ephemeral key exchange modes" |
| 754 | tests/ssl-opt.sh |
| 755 | } |
| 756 | |
| 757 | component_test_tls13_only_ephemeral_all () { |
| 758 | msg "build: TLS 1.3 only from default, without PSK key exchange mode" |
| 759 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 760 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 761 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 762 | |
| 763 | msg "test_suite_ssl: TLS 1.3 only, ephemeral and PSK ephemeral key exchange modes" |
| 764 | cd tests; ./test_suite_ssl; cd .. |
| 765 | |
| 766 | msg "ssl-opt.sh: TLS 1.3 only, ephemeral and PSK ephemeral key exchange modes" |
| 767 | tests/ssl-opt.sh |
| 768 | } |
| 769 | |
| 770 | component_test_tls13_no_padding () { |
| 771 | msg "build: default config plus early data minus padding" |
| 772 | scripts/config.py set MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 1 |
| 773 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 774 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 775 | make |
| 776 | msg "test: default config plus early data minus padding" |
| 777 | make test |
| 778 | msg "ssl-opt.sh (TLS 1.3 no padding)" |
| 779 | tests/ssl-opt.sh |
| 780 | } |
| 781 | |
| 782 | component_test_tls13_no_compatibility_mode () { |
| 783 | msg "build: default config plus early data minus middlebox compatibility mode" |
| 784 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 785 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 786 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 787 | make |
| 788 | msg "test: default config plus early data minus middlebox compatibility mode" |
| 789 | make test |
| 790 | msg "ssl-opt.sh (TLS 1.3 no compatibility mode)" |
| 791 | tests/ssl-opt.sh |
| 792 | } |
| 793 | |
| 794 | component_test_full_minus_session_tickets () { |
| 795 | msg "build: full config without session tickets" |
| 796 | scripts/config.py full |
| 797 | scripts/config.py unset MBEDTLS_SSL_SESSION_TICKETS |
| 798 | scripts/config.py unset MBEDTLS_SSL_EARLY_DATA |
| 799 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 800 | make |
| 801 | msg "test: full config without session tickets" |
| 802 | make test |
| 803 | msg "ssl-opt.sh (full config without session tickets)" |
| 804 | tests/ssl-opt.sh |
| 805 | } |