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 | |
| 12 | component_test_no_renegotiation () { |
| 13 | msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min |
| 14 | scripts/config.py unset MBEDTLS_SSL_RENEGOTIATION |
| 15 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 16 | make |
| 17 | |
| 18 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 19 | make test |
| 20 | |
| 21 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - ssl-opt.sh (ASan build)" # ~ 6 min |
| 22 | tests/ssl-opt.sh |
| 23 | } |
| 24 | |
| 25 | component_test_tls1_2_default_stream_cipher_only () { |
| 26 | msg "build: default with only stream cipher" |
| 27 | |
| 28 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C |
| 29 | scripts/config.py unset MBEDTLS_GCM_C |
| 30 | scripts/config.py unset MBEDTLS_CCM_C |
| 31 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 32 | #Disable TLS 1.3 (as no AEAD) |
| 33 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 34 | # Disable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 35 | scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC |
| 36 | # Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 37 | scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 38 | # Enable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 39 | scripts/config.py set MBEDTLS_CIPHER_NULL_CIPHER |
| 40 | # Modules that depend on AEAD |
| 41 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 42 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 43 | |
| 44 | make |
| 45 | |
| 46 | msg "test: default with only stream cipher" |
| 47 | make test |
| 48 | |
| 49 | # Not running ssl-opt.sh because most tests require a non-NULL ciphersuite. |
| 50 | } |
| 51 | |
| 52 | component_test_tls1_2_default_cbc_legacy_cipher_only () { |
| 53 | msg "build: default with only CBC-legacy cipher" |
| 54 | |
| 55 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 56 | scripts/config.py unset MBEDTLS_GCM_C |
| 57 | scripts/config.py unset MBEDTLS_CCM_C |
| 58 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 59 | #Disable TLS 1.3 (as no AEAD) |
| 60 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 61 | # Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 62 | scripts/config.py set MBEDTLS_CIPHER_MODE_CBC |
| 63 | # Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 64 | scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 65 | # Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 66 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 67 | # Modules that depend on AEAD |
| 68 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 69 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 70 | |
| 71 | make |
| 72 | |
| 73 | msg "test: default with only CBC-legacy cipher" |
| 74 | make test |
| 75 | |
| 76 | msg "test: default with only CBC-legacy cipher - ssl-opt.sh (subset)" |
| 77 | tests/ssl-opt.sh -f "TLS 1.2" |
| 78 | } |
| 79 | |
| 80 | component_test_tls1_2_default_cbc_legacy_cbc_etm_cipher_only () { |
| 81 | msg "build: default with only CBC-legacy and CBC-EtM ciphers" |
| 82 | |
| 83 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 84 | scripts/config.py unset MBEDTLS_GCM_C |
| 85 | scripts/config.py unset MBEDTLS_CCM_C |
| 86 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 87 | #Disable TLS 1.3 (as no AEAD) |
| 88 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 89 | # Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 90 | scripts/config.py set MBEDTLS_CIPHER_MODE_CBC |
| 91 | # Enable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 92 | scripts/config.py set MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 93 | # Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 94 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 95 | # Modules that depend on AEAD |
| 96 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 97 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 98 | |
| 99 | make |
| 100 | |
| 101 | msg "test: default with only CBC-legacy and CBC-EtM ciphers" |
| 102 | make test |
| 103 | |
| 104 | msg "test: default with only CBC-legacy and CBC-EtM ciphers - ssl-opt.sh (subset)" |
| 105 | tests/ssl-opt.sh -f "TLS 1.2" |
| 106 | } |
| 107 | |
| 108 | # We're not aware of any other (open source) implementation of EC J-PAKE in TLS |
| 109 | # that we could use for interop testing. However, we now have sort of two |
| 110 | # implementations ourselves: one using PSA, the other not. At least test that |
| 111 | # these two interoperate with each other. |
| 112 | component_test_tls1_2_ecjpake_compatibility () { |
| 113 | msg "build: TLS1.2 server+client w/ EC-JPAKE w/o USE_PSA" |
| 114 | scripts/config.py set MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 115 | # Explicitly make lib first to avoid a race condition: |
| 116 | # https://github.com/Mbed-TLS/mbedtls/issues/8229 |
| 117 | make lib |
| 118 | make -C programs ssl/ssl_server2 ssl/ssl_client2 |
| 119 | cp programs/ssl/ssl_server2 s2_no_use_psa |
| 120 | cp programs/ssl/ssl_client2 c2_no_use_psa |
| 121 | |
| 122 | msg "build: TLS1.2 server+client w/ EC-JPAKE w/ USE_PSA" |
| 123 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 124 | make clean |
| 125 | make lib |
| 126 | make -C programs ssl/ssl_server2 ssl/ssl_client2 |
| 127 | make -C programs test/udp_proxy test/query_compile_time_config |
| 128 | |
| 129 | msg "test: server w/o USE_PSA - client w/ USE_PSA, text password" |
| 130 | P_SRV=../s2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: working, TLS" |
| 131 | msg "test: server w/o USE_PSA - client w/ USE_PSA, opaque password" |
| 132 | P_SRV=../s2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: opaque password client only, working, TLS" |
| 133 | msg "test: client w/o USE_PSA - server w/ USE_PSA, text password" |
| 134 | P_CLI=../c2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: working, TLS" |
| 135 | msg "test: client w/o USE_PSA - server w/ USE_PSA, opaque password" |
| 136 | P_CLI=../c2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: opaque password server only, working, TLS" |
| 137 | |
| 138 | rm s2_no_use_psa c2_no_use_psa |
| 139 | } |
| 140 | |
| 141 | component_test_small_ssl_out_content_len () { |
| 142 | msg "build: small SSL_OUT_CONTENT_LEN (ASan build)" |
| 143 | scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 16384 |
| 144 | scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 4096 |
| 145 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 146 | make |
| 147 | |
| 148 | msg "test: small SSL_OUT_CONTENT_LEN - ssl-opt.sh MFL and large packet tests" |
| 149 | tests/ssl-opt.sh -f "Max fragment\|Large packet" |
| 150 | } |
| 151 | |
| 152 | component_test_small_ssl_in_content_len () { |
| 153 | msg "build: small SSL_IN_CONTENT_LEN (ASan build)" |
| 154 | scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 4096 |
| 155 | scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 16384 |
| 156 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 157 | make |
| 158 | |
| 159 | msg "test: small SSL_IN_CONTENT_LEN - ssl-opt.sh MFL tests" |
| 160 | tests/ssl-opt.sh -f "Max fragment" |
| 161 | } |
| 162 | |
| 163 | component_test_small_ssl_dtls_max_buffering () { |
| 164 | msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0" |
| 165 | scripts/config.py set MBEDTLS_SSL_DTLS_MAX_BUFFERING 1000 |
| 166 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 167 | make |
| 168 | |
| 169 | msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0 - ssl-opt.sh specific reordering test" |
| 170 | tests/ssl-opt.sh -f "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" |
| 171 | } |
| 172 | |
| 173 | component_test_small_mbedtls_ssl_dtls_max_buffering () { |
| 174 | msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1" |
| 175 | scripts/config.py set MBEDTLS_SSL_DTLS_MAX_BUFFERING 190 |
| 176 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 177 | make |
| 178 | |
| 179 | msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1 - ssl-opt.sh specific reordering test" |
| 180 | tests/ssl-opt.sh -f "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" |
| 181 | } |
| 182 | |
| 183 | component_test_depends_py_kex () { |
| 184 | msg "test/build: depends.py kex (gcc)" |
| 185 | tests/scripts/depends.py kex --unset-use-psa |
| 186 | } |
| 187 | |
| 188 | component_test_depends_py_kex_psa () { |
| 189 | msg "test/build: depends.py kex (gcc) with MBEDTLS_USE_PSA_CRYPTO defined" |
| 190 | tests/scripts/depends.py kex |
| 191 | } |
| 192 | |
| 193 | # Common helper for component_full_without_ecdhe_ecdsa() and |
| 194 | # component_full_without_ecdhe_ecdsa_and_tls13() which: |
| 195 | # - starts from the "full" configuration minus the list of symbols passed in |
| 196 | # as 1st parameter |
| 197 | # - build |
| 198 | # - test only TLS (i.e. test_suite_tls and ssl-opt) |
| 199 | build_full_minus_something_and_test_tls () { |
| 200 | symbols_to_disable="$1" |
| 201 | |
| 202 | msg "build: full minus something, test TLS" |
| 203 | |
| 204 | scripts/config.py full |
| 205 | for sym in $symbols_to_disable; do |
| 206 | echo "Disabling $sym" |
| 207 | scripts/config.py unset $sym |
| 208 | done |
| 209 | |
| 210 | make |
| 211 | |
| 212 | msg "test: full minus something, test TLS" |
| 213 | ( cd tests; ./test_suite_ssl ) |
| 214 | |
| 215 | msg "ssl-opt: full minus something, test TLS" |
| 216 | tests/ssl-opt.sh |
| 217 | } |
| 218 | |
| 219 | component_full_without_ecdhe_ecdsa () { |
| 220 | build_full_minus_something_and_test_tls "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED" |
| 221 | } |
| 222 | |
| 223 | component_full_without_ecdhe_ecdsa_and_tls13 () { |
| 224 | build_full_minus_something_and_test_tls "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 225 | MBEDTLS_SSL_PROTO_TLS1_3" |
| 226 | } |
| 227 | |
| 228 | component_build_no_ssl_srv () { |
| 229 | msg "build: full config except SSL server, make, gcc" # ~ 30s |
| 230 | scripts/config.py full |
| 231 | scripts/config.py unset MBEDTLS_SSL_SRV_C |
| 232 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1' |
| 233 | } |
| 234 | |
| 235 | component_build_no_ssl_cli () { |
| 236 | msg "build: full config except SSL client, make, gcc" # ~ 30s |
| 237 | scripts/config.py full |
| 238 | scripts/config.py unset MBEDTLS_SSL_CLI_C |
| 239 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1' |
| 240 | } |
| 241 | |
| 242 | component_test_no_max_fragment_length () { |
| 243 | # Run max fragment length tests with MFL disabled |
| 244 | msg "build: default config except MFL extension (ASan build)" # ~ 30s |
| 245 | scripts/config.py unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 246 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 247 | make |
| 248 | |
| 249 | msg "test: ssl-opt.sh, MFL-related tests" |
| 250 | tests/ssl-opt.sh -f "Max fragment length" |
| 251 | } |
| 252 | |
| 253 | component_test_asan_remove_peer_certificate () { |
| 254 | msg "build: default config with MBEDTLS_SSL_KEEP_PEER_CERTIFICATE disabled (ASan build)" |
| 255 | scripts/config.py unset MBEDTLS_SSL_KEEP_PEER_CERTIFICATE |
| 256 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 257 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 258 | make |
| 259 | |
| 260 | msg "test: !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 261 | make test |
| 262 | |
| 263 | msg "test: ssl-opt.sh, !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 264 | tests/ssl-opt.sh |
| 265 | |
| 266 | msg "test: compat.sh, !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 267 | tests/compat.sh |
| 268 | |
| 269 | msg "test: context-info.sh, !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 270 | tests/context-info.sh |
| 271 | } |
| 272 | |
| 273 | component_test_no_max_fragment_length_small_ssl_out_content_len () { |
| 274 | msg "build: no MFL extension, small SSL_OUT_CONTENT_LEN (ASan build)" |
| 275 | scripts/config.py unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 276 | scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 16384 |
| 277 | scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 4096 |
| 278 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 279 | make |
| 280 | |
| 281 | msg "test: MFL tests (disabled MFL extension case) & large packet tests" |
| 282 | tests/ssl-opt.sh -f "Max fragment length\|Large buffer" |
| 283 | |
| 284 | msg "test: context-info.sh (disabled MFL extension case)" |
| 285 | tests/context-info.sh |
| 286 | } |
| 287 | |
| 288 | component_test_variable_ssl_in_out_buffer_len () { |
| 289 | msg "build: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled (ASan build)" |
| 290 | scripts/config.py set MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 291 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 292 | make |
| 293 | |
| 294 | msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled" |
| 295 | make test |
| 296 | |
| 297 | msg "test: ssl-opt.sh, MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled" |
| 298 | tests/ssl-opt.sh |
| 299 | |
| 300 | msg "test: compat.sh, MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled" |
| 301 | tests/compat.sh |
| 302 | } |
| 303 | |
| 304 | component_test_dtls_cid_legacy () { |
| 305 | msg "build: MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy) enabled (ASan build)" |
| 306 | scripts/config.py set MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 1 |
| 307 | |
| 308 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 309 | make |
| 310 | |
| 311 | msg "test: MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy)" |
| 312 | make test |
| 313 | |
| 314 | msg "test: ssl-opt.sh, MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy) enabled" |
| 315 | tests/ssl-opt.sh |
| 316 | |
| 317 | msg "test: compat.sh, MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy) enabled" |
| 318 | tests/compat.sh |
| 319 | } |
| 320 | |
| 321 | component_test_ssl_alloc_buffer_and_mfl () { |
| 322 | msg "build: default config with memory buffer allocator and MFL extension" |
| 323 | scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 324 | scripts/config.py set MBEDTLS_PLATFORM_MEMORY |
| 325 | scripts/config.py set MBEDTLS_MEMORY_DEBUG |
| 326 | scripts/config.py set MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 327 | scripts/config.py set MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 328 | cmake -DCMAKE_BUILD_TYPE:String=Release . |
| 329 | make |
| 330 | |
| 331 | msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH, MBEDTLS_MEMORY_BUFFER_ALLOC_C, MBEDTLS_MEMORY_DEBUG and MBEDTLS_SSL_MAX_FRAGMENT_LENGTH" |
| 332 | make test |
| 333 | |
| 334 | msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH, MBEDTLS_MEMORY_BUFFER_ALLOC_C, MBEDTLS_MEMORY_DEBUG and MBEDTLS_SSL_MAX_FRAGMENT_LENGTH" |
| 335 | tests/ssl-opt.sh -f "Handshake memory usage" |
| 336 | } |
| 337 | |
| 338 | component_test_when_no_ciphersuites_have_mac () { |
| 339 | msg "build: when no ciphersuites have MAC" |
| 340 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 341 | scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC |
| 342 | scripts/config.py unset MBEDTLS_CMAC_C |
| 343 | make |
| 344 | |
| 345 | msg "test: !MBEDTLS_SSL_SOME_SUITES_USE_MAC" |
| 346 | make test |
| 347 | |
| 348 | msg "test ssl-opt.sh: !MBEDTLS_SSL_SOME_SUITES_USE_MAC" |
| 349 | tests/ssl-opt.sh -f 'Default\|EtM' -e 'without EtM' |
| 350 | } |
| 351 | |
| 352 | component_test_tls12_only () { |
| 353 | msg "build: default config without MBEDTLS_SSL_PROTO_TLS1_3, cmake, gcc, ASan" |
| 354 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 355 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 356 | make |
| 357 | |
| 358 | msg "test: main suites (inc. selftests) (ASan build)" |
| 359 | make test |
| 360 | |
| 361 | msg "test: ssl-opt.sh (ASan build)" |
| 362 | tests/ssl-opt.sh |
| 363 | |
| 364 | msg "test: compat.sh (ASan build)" |
| 365 | tests/compat.sh |
| 366 | } |
| 367 | |
| 368 | component_test_tls13_only () { |
| 369 | msg "build: default config without MBEDTLS_SSL_PROTO_TLS1_2" |
| 370 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 371 | scripts/config.py set MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 372 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 373 | |
| 374 | msg "test: TLS 1.3 only, all key exchange modes enabled" |
| 375 | make test |
| 376 | |
| 377 | msg "ssl-opt.sh: TLS 1.3 only, all key exchange modes enabled" |
| 378 | tests/ssl-opt.sh |
| 379 | } |
| 380 | |
| 381 | component_test_tls13_only_psk () { |
| 382 | msg "build: TLS 1.3 only from default, only PSK key exchange mode" |
| 383 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 384 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 385 | scripts/config.py unset MBEDTLS_ECDH_C |
| 386 | scripts/config.py unset MBEDTLS_DHM_C |
| 387 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 388 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 389 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 390 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 391 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 392 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 393 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 394 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 395 | |
| 396 | msg "test_suite_ssl: TLS 1.3 only, only PSK key exchange mode enabled" |
| 397 | cd tests; ./test_suite_ssl; cd .. |
| 398 | |
| 399 | msg "ssl-opt.sh: TLS 1.3 only, only PSK key exchange mode enabled" |
| 400 | tests/ssl-opt.sh |
| 401 | } |
| 402 | |
| 403 | component_test_tls13_only_ephemeral () { |
| 404 | msg "build: TLS 1.3 only from default, only ephemeral key exchange mode" |
| 405 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 406 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 407 | scripts/config.py unset MBEDTLS_SSL_EARLY_DATA |
| 408 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 409 | |
| 410 | msg "test_suite_ssl: TLS 1.3 only, only ephemeral key exchange mode" |
| 411 | cd tests; ./test_suite_ssl; cd .. |
| 412 | |
| 413 | msg "ssl-opt.sh: TLS 1.3 only, only ephemeral key exchange mode" |
| 414 | tests/ssl-opt.sh |
| 415 | } |
| 416 | |
| 417 | component_test_tls13_only_ephemeral_ffdh () { |
| 418 | msg "build: TLS 1.3 only from default, only ephemeral ffdh key exchange mode" |
| 419 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 420 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 421 | scripts/config.py unset MBEDTLS_SSL_EARLY_DATA |
| 422 | scripts/config.py unset MBEDTLS_ECDH_C |
| 423 | |
| 424 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 425 | |
| 426 | msg "test_suite_ssl: TLS 1.3 only, only ephemeral ffdh key exchange mode" |
| 427 | cd tests; ./test_suite_ssl; cd .. |
| 428 | |
| 429 | msg "ssl-opt.sh: TLS 1.3 only, only ephemeral ffdh key exchange mode" |
| 430 | tests/ssl-opt.sh |
| 431 | } |
| 432 | |
| 433 | component_test_tls13_only_psk_ephemeral () { |
| 434 | msg "build: TLS 1.3 only from default, only PSK ephemeral key exchange mode" |
| 435 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 436 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 437 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 438 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 439 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 440 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 441 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 442 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 443 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 444 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 445 | |
| 446 | msg "test_suite_ssl: TLS 1.3 only, only PSK ephemeral key exchange mode" |
| 447 | cd tests; ./test_suite_ssl; cd .. |
| 448 | |
| 449 | msg "ssl-opt.sh: TLS 1.3 only, only PSK ephemeral key exchange mode" |
| 450 | tests/ssl-opt.sh |
| 451 | } |
| 452 | |
| 453 | component_test_tls13_only_psk_ephemeral_ffdh () { |
| 454 | msg "build: TLS 1.3 only from default, only PSK ephemeral ffdh key exchange mode" |
| 455 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 456 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 457 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 458 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 459 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 460 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 461 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 462 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 463 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 464 | scripts/config.py unset MBEDTLS_ECDH_C |
| 465 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 466 | |
| 467 | msg "test_suite_ssl: TLS 1.3 only, only PSK ephemeral ffdh key exchange mode" |
| 468 | cd tests; ./test_suite_ssl; cd .. |
| 469 | |
| 470 | msg "ssl-opt.sh: TLS 1.3 only, only PSK ephemeral ffdh key exchange mode" |
| 471 | tests/ssl-opt.sh |
| 472 | } |
| 473 | |
| 474 | component_test_tls13_only_psk_all () { |
| 475 | msg "build: TLS 1.3 only from default, without ephemeral key exchange mode" |
| 476 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 477 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 478 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 479 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 480 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 481 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 482 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 483 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 484 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 485 | |
| 486 | msg "test_suite_ssl: TLS 1.3 only, PSK and PSK ephemeral key exchange modes" |
| 487 | cd tests; ./test_suite_ssl; cd .. |
| 488 | |
| 489 | msg "ssl-opt.sh: TLS 1.3 only, PSK and PSK ephemeral key exchange modes" |
| 490 | tests/ssl-opt.sh |
| 491 | } |
| 492 | |
| 493 | component_test_tls13_only_ephemeral_all () { |
| 494 | msg "build: TLS 1.3 only from default, without PSK key exchange mode" |
| 495 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 496 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 497 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 498 | |
| 499 | msg "test_suite_ssl: TLS 1.3 only, ephemeral and PSK ephemeral key exchange modes" |
| 500 | cd tests; ./test_suite_ssl; cd .. |
| 501 | |
| 502 | msg "ssl-opt.sh: TLS 1.3 only, ephemeral and PSK ephemeral key exchange modes" |
| 503 | tests/ssl-opt.sh |
| 504 | } |
| 505 | |
| 506 | component_test_tls13_no_padding () { |
| 507 | msg "build: default config plus early data minus padding" |
| 508 | scripts/config.py set MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 1 |
| 509 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 510 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 511 | make |
| 512 | msg "test: default config plus early data minus padding" |
| 513 | make test |
| 514 | msg "ssl-opt.sh (TLS 1.3 no padding)" |
| 515 | tests/ssl-opt.sh |
| 516 | } |
| 517 | |
| 518 | component_test_tls13_no_compatibility_mode () { |
| 519 | msg "build: default config plus early data minus middlebox compatibility mode" |
| 520 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 521 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 522 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 523 | make |
| 524 | msg "test: default config plus early data minus middlebox compatibility mode" |
| 525 | make test |
| 526 | msg "ssl-opt.sh (TLS 1.3 no compatibility mode)" |
| 527 | tests/ssl-opt.sh |
| 528 | } |
| 529 | |
| 530 | component_test_full_minus_session_tickets () { |
| 531 | msg "build: full config without session tickets" |
| 532 | scripts/config.py full |
| 533 | scripts/config.py unset MBEDTLS_SSL_SESSION_TICKETS |
| 534 | scripts/config.py unset MBEDTLS_SSL_EARLY_DATA |
| 535 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 536 | make |
| 537 | msg "test: full config without session tickets" |
| 538 | make test |
| 539 | msg "ssl-opt.sh (full config without session tickets)" |
| 540 | tests/ssl-opt.sh |
| 541 | } |