Minos Galanakis | 6aab5b7 | 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 the test components that are executed by all.sh |
| 7 | |
| 8 | ################################################################ |
| 9 | #### Configuration Testing - TLS |
| 10 | ################################################################ |
| 11 | |
Minos Galanakis | 7665a93 | 2024-07-26 15:45:11 +0100 | [diff] [blame] | 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_no_pem_no_fs () { |
| 26 | msg "build: Default + !MBEDTLS_PEM_PARSE_C + !MBEDTLS_FS_IO (ASan build)" |
| 27 | scripts/config.py unset MBEDTLS_PEM_PARSE_C |
| 28 | scripts/config.py unset MBEDTLS_FS_IO |
| 29 | scripts/config.py unset MBEDTLS_PSA_ITS_FILE_C # requires a filesystem |
| 30 | scripts/config.py unset MBEDTLS_PSA_CRYPTO_STORAGE_C # requires PSA ITS |
| 31 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 32 | make |
| 33 | |
| 34 | msg "test: !MBEDTLS_PEM_PARSE_C !MBEDTLS_FS_IO - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 35 | make test |
| 36 | |
| 37 | msg "test: !MBEDTLS_PEM_PARSE_C !MBEDTLS_FS_IO - ssl-opt.sh (ASan build)" # ~ 6 min |
| 38 | tests/ssl-opt.sh |
| 39 | } |
| 40 | |
| 41 | component_test_rsa_no_crt () { |
| 42 | msg "build: Default + RSA_NO_CRT (ASan build)" # ~ 6 min |
| 43 | scripts/config.py set MBEDTLS_RSA_NO_CRT |
| 44 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 45 | make |
| 46 | |
| 47 | msg "test: RSA_NO_CRT - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 48 | make test |
| 49 | |
| 50 | msg "test: RSA_NO_CRT - RSA-related part of ssl-opt.sh (ASan build)" # ~ 5s |
| 51 | tests/ssl-opt.sh -f RSA |
| 52 | |
| 53 | msg "test: RSA_NO_CRT - RSA-related part of compat.sh (ASan build)" # ~ 3 min |
| 54 | tests/compat.sh -t RSA |
| 55 | |
| 56 | msg "test: RSA_NO_CRT - RSA-related part of context-info.sh (ASan build)" # ~ 15 sec |
| 57 | tests/context-info.sh |
| 58 | } |
| 59 | |
| 60 | component_test_no_ctr_drbg_classic () { |
| 61 | msg "build: Full minus CTR_DRBG, classic crypto in TLS" |
| 62 | scripts/config.py full |
| 63 | scripts/config.py unset MBEDTLS_CTR_DRBG_C |
| 64 | scripts/config.py unset MBEDTLS_USE_PSA_CRYPTO |
| 65 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 66 | |
| 67 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 68 | make |
| 69 | |
| 70 | msg "test: Full minus CTR_DRBG, classic crypto - main suites" |
| 71 | make test |
| 72 | |
| 73 | # In this configuration, the TLS test programs use HMAC_DRBG. |
| 74 | # The SSL tests are slow, so run a small subset, just enough to get |
| 75 | # confidence that the SSL code copes with HMAC_DRBG. |
| 76 | msg "test: Full minus CTR_DRBG, classic crypto - ssl-opt.sh (subset)" |
| 77 | tests/ssl-opt.sh -f 'Default\|SSL async private.*delay=\|tickets enabled on server' |
| 78 | |
| 79 | msg "test: Full minus CTR_DRBG, classic crypto - compat.sh (subset)" |
| 80 | tests/compat.sh -m tls12 -t 'ECDSA PSK' -V NO -p OpenSSL |
| 81 | } |
| 82 | |
| 83 | component_test_no_ctr_drbg_use_psa () { |
| 84 | msg "build: Full minus CTR_DRBG, PSA crypto in TLS" |
| 85 | scripts/config.py full |
| 86 | scripts/config.py unset MBEDTLS_CTR_DRBG_C |
| 87 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 88 | |
| 89 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 90 | make |
| 91 | |
| 92 | msg "test: Full minus CTR_DRBG, USE_PSA_CRYPTO - main suites" |
| 93 | make test |
| 94 | |
| 95 | # In this configuration, the TLS test programs use HMAC_DRBG. |
| 96 | # The SSL tests are slow, so run a small subset, just enough to get |
| 97 | # confidence that the SSL code copes with HMAC_DRBG. |
| 98 | msg "test: Full minus CTR_DRBG, USE_PSA_CRYPTO - ssl-opt.sh (subset)" |
| 99 | tests/ssl-opt.sh -f 'Default\|SSL async private.*delay=\|tickets enabled on server' |
| 100 | |
| 101 | msg "test: Full minus CTR_DRBG, USE_PSA_CRYPTO - compat.sh (subset)" |
| 102 | tests/compat.sh -m tls12 -t 'ECDSA PSK' -V NO -p OpenSSL |
| 103 | } |
| 104 | |
| 105 | component_test_no_hmac_drbg_classic () { |
| 106 | msg "build: Full minus HMAC_DRBG, classic crypto in TLS" |
| 107 | scripts/config.py full |
| 108 | scripts/config.py unset MBEDTLS_HMAC_DRBG_C |
| 109 | scripts/config.py unset MBEDTLS_ECDSA_DETERMINISTIC # requires HMAC_DRBG |
| 110 | scripts/config.py unset MBEDTLS_USE_PSA_CRYPTO |
| 111 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 112 | |
| 113 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 114 | make |
| 115 | |
| 116 | msg "test: Full minus HMAC_DRBG, classic crypto - main suites" |
| 117 | make test |
| 118 | |
| 119 | # Normally our ECDSA implementation uses deterministic ECDSA. But since |
| 120 | # HMAC_DRBG is disabled in this configuration, randomized ECDSA is used |
| 121 | # instead. |
| 122 | # Test SSL with non-deterministic ECDSA. Only test features that |
| 123 | # might be affected by how ECDSA signature is performed. |
| 124 | msg "test: Full minus HMAC_DRBG, classic crypto - ssl-opt.sh (subset)" |
| 125 | tests/ssl-opt.sh -f 'Default\|SSL async private: sign' |
| 126 | |
| 127 | # To save time, only test one protocol version, since this part of |
| 128 | # the protocol is identical in (D)TLS up to 1.2. |
| 129 | msg "test: Full minus HMAC_DRBG, classic crypto - compat.sh (ECDSA)" |
| 130 | tests/compat.sh -m tls12 -t 'ECDSA' |
| 131 | } |
| 132 | |
| 133 | component_test_no_hmac_drbg_use_psa () { |
| 134 | msg "build: Full minus HMAC_DRBG, PSA crypto in TLS" |
| 135 | scripts/config.py full |
| 136 | scripts/config.py unset MBEDTLS_HMAC_DRBG_C |
| 137 | scripts/config.py unset MBEDTLS_ECDSA_DETERMINISTIC # requires HMAC_DRBG |
| 138 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 139 | |
| 140 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 141 | make |
| 142 | |
| 143 | msg "test: Full minus HMAC_DRBG, USE_PSA_CRYPTO - main suites" |
| 144 | make test |
| 145 | |
| 146 | # Normally our ECDSA implementation uses deterministic ECDSA. But since |
| 147 | # HMAC_DRBG is disabled in this configuration, randomized ECDSA is used |
| 148 | # instead. |
| 149 | # Test SSL with non-deterministic ECDSA. Only test features that |
| 150 | # might be affected by how ECDSA signature is performed. |
| 151 | msg "test: Full minus HMAC_DRBG, USE_PSA_CRYPTO - ssl-opt.sh (subset)" |
| 152 | tests/ssl-opt.sh -f 'Default\|SSL async private: sign' |
| 153 | |
| 154 | # To save time, only test one protocol version, since this part of |
| 155 | # the protocol is identical in (D)TLS up to 1.2. |
| 156 | msg "test: Full minus HMAC_DRBG, USE_PSA_CRYPTO - compat.sh (ECDSA)" |
| 157 | tests/compat.sh -m tls12 -t 'ECDSA' |
| 158 | } |
| 159 | |
| 160 | component_test_psa_external_rng_no_drbg_classic () { |
| 161 | msg "build: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, classic crypto in TLS" |
| 162 | scripts/config.py full |
| 163 | scripts/config.py unset MBEDTLS_USE_PSA_CRYPTO |
| 164 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 165 | scripts/config.py set MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG |
| 166 | scripts/config.py unset MBEDTLS_ENTROPY_C |
| 167 | scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED |
| 168 | scripts/config.py unset MBEDTLS_PLATFORM_NV_SEED_ALT |
| 169 | scripts/config.py unset MBEDTLS_CTR_DRBG_C |
| 170 | scripts/config.py unset MBEDTLS_HMAC_DRBG_C |
| 171 | scripts/config.py unset MBEDTLS_ECDSA_DETERMINISTIC # requires HMAC_DRBG |
| 172 | # When MBEDTLS_USE_PSA_CRYPTO is disabled and there is no DRBG, |
| 173 | # the SSL test programs don't have an RNG and can't work. Explicitly |
| 174 | # make them use the PSA RNG with -DMBEDTLS_TEST_USE_PSA_CRYPTO_RNG. |
| 175 | make CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS -DMBEDTLS_TEST_USE_PSA_CRYPTO_RNG" LDFLAGS="$ASAN_CFLAGS" |
| 176 | |
| 177 | msg "test: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, classic crypto - main suites" |
| 178 | make test |
| 179 | |
| 180 | msg "test: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, classic crypto - ssl-opt.sh (subset)" |
| 181 | tests/ssl-opt.sh -f 'Default' |
| 182 | } |
| 183 | |
| 184 | component_test_psa_external_rng_no_drbg_use_psa () { |
| 185 | msg "build: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, PSA crypto in TLS" |
| 186 | scripts/config.py full |
| 187 | scripts/config.py set MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG |
| 188 | scripts/config.py unset MBEDTLS_ENTROPY_C |
| 189 | scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED |
| 190 | scripts/config.py unset MBEDTLS_PLATFORM_NV_SEED_ALT |
| 191 | scripts/config.py unset MBEDTLS_CTR_DRBG_C |
| 192 | scripts/config.py unset MBEDTLS_HMAC_DRBG_C |
| 193 | scripts/config.py unset MBEDTLS_ECDSA_DETERMINISTIC # requires HMAC_DRBG |
| 194 | make CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" |
| 195 | |
| 196 | msg "test: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, PSA crypto - main suites" |
| 197 | make test |
| 198 | |
| 199 | msg "test: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, PSA crypto - ssl-opt.sh (subset)" |
| 200 | tests/ssl-opt.sh -f 'Default\|opaque' |
| 201 | } |
| 202 | |
| 203 | component_test_sw_inet_pton () { |
| 204 | msg "build: default plus MBEDTLS_TEST_SW_INET_PTON" |
| 205 | |
| 206 | # MBEDTLS_TEST_HOOKS required for x509_crt_parse_cn_inet_pton |
| 207 | scripts/config.py set MBEDTLS_TEST_HOOKS |
| 208 | make CFLAGS="-DMBEDTLS_TEST_SW_INET_PTON" |
| 209 | |
| 210 | msg "test: default plus MBEDTLS_TEST_SW_INET_PTON" |
| 211 | make test |
| 212 | } |
| 213 | |
| 214 | component_test_tls1_2_default_stream_cipher_only () { |
| 215 | msg "build: default with only stream cipher use psa" |
| 216 | |
| 217 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 218 | scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG |
| 219 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 220 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CCM |
| 221 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CCM_STAR_NO_TAG |
| 222 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_GCM |
| 223 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CHACHA20_POLY1305 |
| 224 | # Note: The three unsets below are to be removed for Mbed TLS 4.0 |
| 225 | scripts/config.py unset MBEDTLS_GCM_C |
| 226 | scripts/config.py unset MBEDTLS_CCM_C |
| 227 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 228 | #Disable TLS 1.3 (as no AEAD) |
| 229 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 230 | # Disable CBC. Note: When implemented, PSA_WANT_ALG_CBC_MAC will also need to be unset here to fully disable CBC |
| 231 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CBC_NO_PADDING |
| 232 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CBC_PKCS7 |
| 233 | # Disable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 234 | # Note: The unset below is to be removed for 4.0 |
| 235 | scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC |
| 236 | # Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 237 | scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 238 | # Enable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 239 | scripts/config.py set MBEDTLS_CIPHER_NULL_CIPHER |
| 240 | # Modules that depend on AEAD |
| 241 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 242 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 243 | |
| 244 | make |
| 245 | |
| 246 | msg "test: default with only stream cipher use psa" |
| 247 | make test |
| 248 | |
| 249 | # Not running ssl-opt.sh because most tests require a non-NULL ciphersuite. |
| 250 | } |
| 251 | |
| 252 | component_test_tls1_2_default_cbc_legacy_cipher_only () { |
| 253 | msg "build: default with only CBC-legacy cipher use psa" |
| 254 | |
| 255 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 256 | scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG |
| 257 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 258 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CCM |
| 259 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CCM_STAR_NO_TAG |
| 260 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_GCM |
| 261 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CHACHA20_POLY1305 |
| 262 | # Note: The three unsets below are to be removed for Mbed TLS 4.0 |
| 263 | scripts/config.py unset MBEDTLS_GCM_C |
| 264 | scripts/config.py unset MBEDTLS_CCM_C |
| 265 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 266 | #Disable TLS 1.3 (as no AEAD) |
| 267 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 268 | # Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 269 | scripts/config.py -f $CRYPTO_CONFIG_H set PSA_WANT_ALG_CBC_NO_PADDING |
| 270 | # Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 271 | scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 272 | # Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 273 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 274 | # Modules that depend on AEAD |
| 275 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 276 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 277 | |
| 278 | make |
| 279 | |
| 280 | msg "test: default with only CBC-legacy cipher use psa" |
| 281 | make test |
| 282 | |
| 283 | msg "test: default with only CBC-legacy cipher use psa - ssl-opt.sh (subset)" |
| 284 | tests/ssl-opt.sh -f "TLS 1.2" |
| 285 | } |
| 286 | |
| 287 | component_test_tls1_2_default_cbc_legacy_cbc_etm_cipher_only () { |
| 288 | msg "build: default with only CBC-legacy and CBC-EtM ciphers use psa" |
| 289 | |
| 290 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 291 | scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG |
| 292 | # Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C) |
| 293 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CCM |
| 294 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CCM_STAR_NO_TAG |
| 295 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_GCM |
| 296 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CHACHA20_POLY1305 |
| 297 | # Note: The three unsets below are to be removed for Mbed TLS 4.0 |
| 298 | scripts/config.py unset MBEDTLS_GCM_C |
| 299 | scripts/config.py unset MBEDTLS_CCM_C |
| 300 | scripts/config.py unset MBEDTLS_CHACHAPOLY_C |
| 301 | #Disable TLS 1.3 (as no AEAD) |
| 302 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 303 | # Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES)) |
| 304 | scripts/config.py -f $CRYPTO_CONFIG_H set PSA_WANT_ALG_CBC_NO_PADDING |
| 305 | # Enable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC) |
| 306 | scripts/config.py set MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 307 | # Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER)) |
| 308 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 309 | # Modules that depend on AEAD |
| 310 | scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 311 | scripts/config.py unset MBEDTLS_SSL_TICKET_C |
| 312 | |
| 313 | make |
| 314 | |
| 315 | msg "test: default with only CBC-legacy and CBC-EtM ciphers use psa" |
| 316 | make test |
| 317 | |
| 318 | msg "test: default with only CBC-legacy and CBC-EtM ciphers use psa - ssl-opt.sh (subset)" |
| 319 | tests/ssl-opt.sh -f "TLS 1.2" |
| 320 | } |
| 321 | |
| 322 | # We're not aware of any other (open source) implementation of EC J-PAKE in TLS |
| 323 | # that we could use for interop testing. However, we now have sort of two |
| 324 | # implementations ourselves: one using PSA, the other not. At least test that |
| 325 | # these two interoperate with each other. |
| 326 | |
Minos Galanakis | f78447f | 2024-07-26 20:49:51 +0100 | [diff] [blame^] | 327 | component_test_tls1_2_ecjpake_compatibility () { |
Minos Galanakis | 7665a93 | 2024-07-26 15:45:11 +0100 | [diff] [blame] | 328 | msg "build: TLS1.2 server+client w/ EC-JPAKE w/o USE_PSA" |
| 329 | scripts/config.py set MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 330 | # Explicitly make lib first to avoid a race condition: |
| 331 | # https://github.com/Mbed-TLS/mbedtls/issues/8229 |
| 332 | make lib |
| 333 | make -C programs ssl/ssl_server2 ssl/ssl_client2 |
| 334 | cp programs/ssl/ssl_server2 s2_no_use_psa |
| 335 | cp programs/ssl/ssl_client2 c2_no_use_psa |
| 336 | |
| 337 | msg "build: TLS1.2 server+client w/ EC-JPAKE w/ USE_PSA" |
| 338 | scripts/config.py set MBEDTLS_USE_PSA_CRYPTO |
| 339 | make clean |
| 340 | make lib |
| 341 | make -C programs ssl/ssl_server2 ssl/ssl_client2 |
| 342 | make -C programs test/udp_proxy test/query_compile_time_config |
| 343 | |
| 344 | msg "test: server w/o USE_PSA - client w/ USE_PSA, text password" |
| 345 | P_SRV=../s2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: working, TLS" |
| 346 | msg "test: server w/o USE_PSA - client w/ USE_PSA, opaque password" |
| 347 | P_SRV=../s2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: opaque password client only, working, TLS" |
| 348 | msg "test: client w/o USE_PSA - server w/ USE_PSA, text password" |
| 349 | P_CLI=../c2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: working, TLS" |
| 350 | msg "test: client w/o USE_PSA - server w/ USE_PSA, opaque password" |
| 351 | P_CLI=../c2_no_use_psa tests/ssl-opt.sh -f "ECJPAKE: opaque password server only, working, TLS" |
| 352 | |
| 353 | rm s2_no_use_psa c2_no_use_psa |
| 354 | } |
| 355 | |
| 356 | component_test_everest () { |
| 357 | msg "build: Everest ECDH context (ASan build)" # ~ 6 min |
| 358 | scripts/config.py set MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED |
| 359 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 360 | make |
| 361 | |
| 362 | msg "test: Everest ECDH context - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 363 | make test |
| 364 | |
| 365 | msg "test: metatests (clang, ASan)" |
| 366 | tests/scripts/run-metatests.sh any asan poison |
| 367 | |
| 368 | msg "test: Everest ECDH context - ECDH-related part of ssl-opt.sh (ASan build)" # ~ 5s |
| 369 | tests/ssl-opt.sh -f ECDH |
| 370 | |
| 371 | msg "test: Everest ECDH context - compat.sh with some ECDH ciphersuites (ASan build)" # ~ 3 min |
| 372 | # Exclude some symmetric ciphers that are redundant here to gain time. |
| 373 | tests/compat.sh -f ECDH -V NO -e 'ARIA\|CAMELLIA\|CHACHA' |
| 374 | } |
| 375 | |
| 376 | component_test_everest_curve25519_only () { |
| 377 | msg "build: Everest ECDH context, only Curve25519" # ~ 6 min |
| 378 | scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG |
| 379 | scripts/config.py set MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED |
| 380 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 381 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_DETERMINISTIC_ECDSA |
| 382 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_ECDSA |
| 383 | scripts/config.py -f $CRYPTO_CONFIG_H set PSA_WANT_ALG_ECDH |
| 384 | scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED |
| 385 | scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 386 | scripts/config.py unset MBEDTLS_ECJPAKE_C |
| 387 | scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_JPAKE |
| 388 | |
| 389 | # Disable all curves |
| 390 | scripts/config.py unset-all "MBEDTLS_ECP_DP_[0-9A-Z_a-z]*_ENABLED" |
| 391 | scripts/config.py -f $CRYPTO_CONFIG_H unset-all "PSA_WANT_ECC_[0-9A-Z_a-z]*$" |
| 392 | scripts/config.py -f $CRYPTO_CONFIG_H set PSA_WANT_ECC_MONTGOMERY_255 |
| 393 | |
| 394 | make CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" |
| 395 | |
| 396 | msg "test: Everest ECDH context, only Curve25519" # ~ 50s |
| 397 | make test |
| 398 | } |
| 399 | |
| 400 | component_test_small_ssl_out_content_len () { |
| 401 | msg "build: small SSL_OUT_CONTENT_LEN (ASan build)" |
| 402 | scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 16384 |
| 403 | scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 4096 |
| 404 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 405 | make |
| 406 | |
| 407 | msg "test: small SSL_OUT_CONTENT_LEN - ssl-opt.sh MFL and large packet tests" |
| 408 | tests/ssl-opt.sh -f "Max fragment\|Large packet" |
| 409 | } |
| 410 | |
| 411 | component_test_small_ssl_in_content_len () { |
| 412 | msg "build: small SSL_IN_CONTENT_LEN (ASan build)" |
| 413 | scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 4096 |
| 414 | scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 16384 |
| 415 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 416 | make |
| 417 | |
| 418 | msg "test: small SSL_IN_CONTENT_LEN - ssl-opt.sh MFL tests" |
| 419 | tests/ssl-opt.sh -f "Max fragment" |
| 420 | } |
| 421 | |
| 422 | component_test_small_ssl_dtls_max_buffering () { |
| 423 | msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0" |
| 424 | scripts/config.py set MBEDTLS_SSL_DTLS_MAX_BUFFERING 1000 |
| 425 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 426 | make |
| 427 | |
| 428 | msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0 - ssl-opt.sh specific reordering test" |
| 429 | tests/ssl-opt.sh -f "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" |
| 430 | } |
| 431 | |
| 432 | component_test_small_mbedtls_ssl_dtls_max_buffering () { |
| 433 | msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1" |
| 434 | scripts/config.py set MBEDTLS_SSL_DTLS_MAX_BUFFERING 190 |
| 435 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 436 | make |
| 437 | |
| 438 | msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1 - ssl-opt.sh specific reordering test" |
| 439 | tests/ssl-opt.sh -f "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" |
| 440 | } |
| 441 | |
| 442 | # Common helper for component_full_without_ecdhe_ecdsa() and |
| 443 | # component_full_without_ecdhe_ecdsa_and_tls13() which: |
| 444 | # - starts from the "full" configuration minus the list of symbols passed in |
| 445 | # as 1st parameter |
| 446 | # - build |
| 447 | # - test only TLS (i.e. test_suite_tls and ssl-opt) |
| 448 | build_full_minus_something_and_test_tls () { |
| 449 | symbols_to_disable="$1" |
| 450 | |
| 451 | msg "build: full minus something, test TLS" |
| 452 | |
| 453 | scripts/config.py full |
| 454 | for sym in $symbols_to_disable; do |
| 455 | echo "Disabling $sym" |
| 456 | scripts/config.py unset $sym |
| 457 | done |
| 458 | |
| 459 | make |
| 460 | |
| 461 | msg "test: full minus something, test TLS" |
| 462 | ( cd tests; ./test_suite_ssl ) |
| 463 | |
| 464 | msg "ssl-opt: full minus something, test TLS" |
| 465 | tests/ssl-opt.sh |
| 466 | } |
| 467 | |
| 468 | component_full_without_ecdhe_ecdsa () { |
| 469 | build_full_minus_something_and_test_tls "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED" |
| 470 | } |
| 471 | |
| 472 | component_full_without_ecdhe_ecdsa_and_tls13 () { |
| 473 | build_full_minus_something_and_test_tls "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 474 | MBEDTLS_SSL_PROTO_TLS1_3" |
| 475 | } |
| 476 | |
| 477 | # This is an helper used by: |
| 478 | # - component_test_psa_ecc_key_pair_no_derive |
| 479 | # - component_test_psa_ecc_key_pair_no_generate |
| 480 | # The goal is to test with all PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_yyy symbols |
| 481 | # enabled, but one. Input arguments are as follows: |
| 482 | # - $1 is the key type under test, i.e. ECC/RSA/DH |
| 483 | # - $2 is the key option to be unset (i.e. generate, derive, etc) |
| 484 | |
| 485 | component_build_no_ssl_srv () { |
| 486 | msg "build: full config except SSL server, make, gcc" # ~ 30s |
| 487 | scripts/config.py full |
| 488 | scripts/config.py unset MBEDTLS_SSL_SRV_C |
| 489 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1' |
| 490 | } |
| 491 | |
| 492 | component_build_no_ssl_cli () { |
| 493 | msg "build: full config except SSL client, make, gcc" # ~ 30s |
| 494 | scripts/config.py full |
| 495 | scripts/config.py unset MBEDTLS_SSL_CLI_C |
| 496 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1' |
| 497 | } |
| 498 | |
| 499 | component_test_memory_buffer_allocator_backtrace () { |
| 500 | msg "build: default config with memory buffer allocator and backtrace enabled" |
| 501 | scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 502 | scripts/config.py set MBEDTLS_PLATFORM_MEMORY |
| 503 | scripts/config.py set MBEDTLS_MEMORY_BACKTRACE |
| 504 | scripts/config.py set MBEDTLS_MEMORY_DEBUG |
| 505 | cmake -DCMAKE_BUILD_TYPE:String=Release . |
| 506 | make |
| 507 | |
| 508 | msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C and MBEDTLS_MEMORY_BACKTRACE" |
| 509 | make test |
| 510 | } |
| 511 | |
| 512 | component_test_memory_buffer_allocator () { |
| 513 | msg "build: default config with memory buffer allocator" |
| 514 | scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 515 | scripts/config.py set MBEDTLS_PLATFORM_MEMORY |
| 516 | cmake -DCMAKE_BUILD_TYPE:String=Release . |
| 517 | make |
| 518 | |
| 519 | msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C" |
| 520 | make test |
| 521 | |
| 522 | msg "test: ssl-opt.sh, MBEDTLS_MEMORY_BUFFER_ALLOC_C" |
| 523 | # MBEDTLS_MEMORY_BUFFER_ALLOC is slow. Skip tests that tend to time out. |
| 524 | tests/ssl-opt.sh -e '^DTLS proxy' |
| 525 | } |
| 526 | |
| 527 | component_test_no_max_fragment_length () { |
| 528 | # Run max fragment length tests with MFL disabled |
| 529 | msg "build: default config except MFL extension (ASan build)" # ~ 30s |
| 530 | scripts/config.py unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 531 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 532 | make |
| 533 | |
| 534 | msg "test: ssl-opt.sh, MFL-related tests" |
| 535 | tests/ssl-opt.sh -f "Max fragment length" |
| 536 | } |
| 537 | |
| 538 | component_test_asan_remove_peer_certificate () { |
| 539 | msg "build: default config with MBEDTLS_SSL_KEEP_PEER_CERTIFICATE disabled (ASan build)" |
| 540 | scripts/config.py unset MBEDTLS_SSL_KEEP_PEER_CERTIFICATE |
| 541 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 542 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 543 | make |
| 544 | |
| 545 | msg "test: !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 546 | make test |
| 547 | |
| 548 | msg "test: ssl-opt.sh, !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 549 | tests/ssl-opt.sh |
| 550 | |
| 551 | msg "test: compat.sh, !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 552 | tests/compat.sh |
| 553 | |
| 554 | msg "test: context-info.sh, !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" |
| 555 | tests/context-info.sh |
| 556 | } |
| 557 | |
| 558 | component_test_no_max_fragment_length_small_ssl_out_content_len () { |
| 559 | msg "build: no MFL extension, small SSL_OUT_CONTENT_LEN (ASan build)" |
| 560 | scripts/config.py unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 561 | scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 16384 |
| 562 | scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 4096 |
| 563 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 564 | make |
| 565 | |
| 566 | msg "test: MFL tests (disabled MFL extension case) & large packet tests" |
| 567 | tests/ssl-opt.sh -f "Max fragment length\|Large buffer" |
| 568 | |
| 569 | msg "test: context-info.sh (disabled MFL extension case)" |
| 570 | tests/context-info.sh |
| 571 | } |
| 572 | |
| 573 | component_test_variable_ssl_in_out_buffer_len () { |
| 574 | msg "build: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled (ASan build)" |
| 575 | scripts/config.py set MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 576 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 577 | make |
| 578 | |
| 579 | msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled" |
| 580 | make test |
| 581 | |
| 582 | msg "test: ssl-opt.sh, MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled" |
| 583 | tests/ssl-opt.sh |
| 584 | |
| 585 | msg "test: compat.sh, MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH enabled" |
| 586 | tests/compat.sh |
| 587 | } |
| 588 | |
| 589 | component_test_dtls_cid_legacy () { |
| 590 | msg "build: MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy) enabled (ASan build)" |
| 591 | scripts/config.py set MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 1 |
| 592 | |
| 593 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 594 | make |
| 595 | |
| 596 | msg "test: MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy)" |
| 597 | make test |
| 598 | |
| 599 | msg "test: ssl-opt.sh, MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy) enabled" |
| 600 | tests/ssl-opt.sh |
| 601 | |
| 602 | msg "test: compat.sh, MBEDTLS_SSL_DTLS_CONNECTION_ID (legacy) enabled" |
| 603 | tests/compat.sh |
| 604 | } |
| 605 | |
| 606 | component_test_ssl_alloc_buffer_and_mfl () { |
| 607 | msg "build: default config with memory buffer allocator and MFL extension" |
| 608 | scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 609 | scripts/config.py set MBEDTLS_PLATFORM_MEMORY |
| 610 | scripts/config.py set MBEDTLS_MEMORY_DEBUG |
| 611 | scripts/config.py set MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 612 | scripts/config.py set MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 613 | cmake -DCMAKE_BUILD_TYPE:String=Release . |
| 614 | make |
| 615 | |
| 616 | msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH, MBEDTLS_MEMORY_BUFFER_ALLOC_C, MBEDTLS_MEMORY_DEBUG and MBEDTLS_SSL_MAX_FRAGMENT_LENGTH" |
| 617 | make test |
| 618 | |
| 619 | msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH, MBEDTLS_MEMORY_BUFFER_ALLOC_C, MBEDTLS_MEMORY_DEBUG and MBEDTLS_SSL_MAX_FRAGMENT_LENGTH" |
| 620 | tests/ssl-opt.sh -f "Handshake memory usage" |
| 621 | } |
| 622 | |
| 623 | component_test_when_no_ciphersuites_have_mac () { |
| 624 | msg "build: when no ciphersuites have MAC" |
| 625 | scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG |
| 626 | scripts/config.py -f "$CRYPTO_CONFIG_H" unset PSA_WANT_ALG_CBC_NO_PADDING |
| 627 | scripts/config.py -f "$CRYPTO_CONFIG_H" unset PSA_WANT_ALG_CBC_PKCS7 |
| 628 | scripts/config.py -f "$CRYPTO_CONFIG_H" unset PSA_WANT_ALG_CMAC |
| 629 | scripts/config.py -f "$CRYPTO_CONFIG_H" unset PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 |
| 630 | |
| 631 | scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER |
| 632 | scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC |
| 633 | scripts/config.py unset MBEDTLS_CMAC_C |
| 634 | |
| 635 | make |
| 636 | |
| 637 | msg "test: !MBEDTLS_SSL_SOME_SUITES_USE_MAC" |
| 638 | make test |
| 639 | |
| 640 | msg "test ssl-opt.sh: !MBEDTLS_SSL_SOME_SUITES_USE_MAC" |
| 641 | tests/ssl-opt.sh -f 'Default\|EtM' -e 'without EtM' |
| 642 | } |
| 643 | |
| 644 | component_test_tls12_only () { |
| 645 | msg "build: default config without MBEDTLS_SSL_PROTO_TLS1_3, cmake, gcc, ASan" |
| 646 | scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 |
| 647 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 648 | make |
| 649 | |
| 650 | msg "test: main suites (inc. selftests) (ASan build)" |
| 651 | make test |
| 652 | |
| 653 | msg "test: ssl-opt.sh (ASan build)" |
| 654 | tests/ssl-opt.sh |
| 655 | |
| 656 | msg "test: compat.sh (ASan build)" |
| 657 | tests/compat.sh |
| 658 | } |
| 659 | |
| 660 | component_test_tls13_only () { |
| 661 | msg "build: default config without MBEDTLS_SSL_PROTO_TLS1_2" |
| 662 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 663 | scripts/config.py set MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 664 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 665 | |
| 666 | msg "test: TLS 1.3 only, all key exchange modes enabled" |
| 667 | make test |
| 668 | |
| 669 | msg "ssl-opt.sh: TLS 1.3 only, all key exchange modes enabled" |
| 670 | tests/ssl-opt.sh |
| 671 | } |
| 672 | |
| 673 | component_test_tls13_only_psk () { |
| 674 | msg "build: TLS 1.3 only from default, only PSK key exchange mode" |
| 675 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 676 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 677 | scripts/config.py unset MBEDTLS_ECDH_C |
| 678 | scripts/config.py unset MBEDTLS_DHM_C |
| 679 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 680 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 681 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 682 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 683 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 684 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 685 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 686 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 687 | |
| 688 | msg "test_suite_ssl: TLS 1.3 only, only PSK key exchange mode enabled" |
| 689 | cd tests; ./test_suite_ssl; cd .. |
| 690 | |
| 691 | msg "ssl-opt.sh: TLS 1.3 only, only PSK key exchange mode enabled" |
| 692 | tests/ssl-opt.sh |
| 693 | } |
| 694 | |
| 695 | component_test_tls13_only_ephemeral () { |
| 696 | msg "build: TLS 1.3 only from default, only ephemeral key exchange mode" |
| 697 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 698 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 699 | scripts/config.py unset MBEDTLS_SSL_EARLY_DATA |
| 700 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 701 | |
| 702 | msg "test_suite_ssl: TLS 1.3 only, only ephemeral key exchange mode" |
| 703 | cd tests; ./test_suite_ssl; cd .. |
| 704 | |
| 705 | msg "ssl-opt.sh: TLS 1.3 only, only ephemeral key exchange mode" |
| 706 | tests/ssl-opt.sh |
| 707 | } |
| 708 | |
| 709 | component_test_tls13_only_ephemeral_ffdh () { |
| 710 | msg "build: TLS 1.3 only from default, only ephemeral ffdh key exchange mode" |
| 711 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 712 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 713 | scripts/config.py unset MBEDTLS_SSL_EARLY_DATA |
| 714 | scripts/config.py unset MBEDTLS_ECDH_C |
| 715 | |
| 716 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 717 | |
| 718 | msg "test_suite_ssl: TLS 1.3 only, only ephemeral ffdh key exchange mode" |
| 719 | cd tests; ./test_suite_ssl; cd .. |
| 720 | |
| 721 | msg "ssl-opt.sh: TLS 1.3 only, only ephemeral ffdh key exchange mode" |
| 722 | tests/ssl-opt.sh |
| 723 | } |
| 724 | |
| 725 | component_test_tls13_only_psk_ephemeral () { |
| 726 | msg "build: TLS 1.3 only from default, only PSK ephemeral key exchange mode" |
| 727 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 728 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 729 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 730 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 731 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 732 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 733 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 734 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 735 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 736 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 737 | |
| 738 | msg "test_suite_ssl: TLS 1.3 only, only PSK ephemeral key exchange mode" |
| 739 | cd tests; ./test_suite_ssl; cd .. |
| 740 | |
| 741 | msg "ssl-opt.sh: TLS 1.3 only, only PSK ephemeral key exchange mode" |
| 742 | tests/ssl-opt.sh |
| 743 | } |
| 744 | |
| 745 | component_test_tls13_only_psk_ephemeral_ffdh () { |
| 746 | msg "build: TLS 1.3 only from default, only PSK ephemeral ffdh key exchange mode" |
| 747 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 748 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 749 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 750 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 751 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 752 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 753 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 754 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 755 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 756 | scripts/config.py unset MBEDTLS_ECDH_C |
| 757 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 758 | |
| 759 | msg "test_suite_ssl: TLS 1.3 only, only PSK ephemeral ffdh key exchange mode" |
| 760 | cd tests; ./test_suite_ssl; cd .. |
| 761 | |
| 762 | msg "ssl-opt.sh: TLS 1.3 only, only PSK ephemeral ffdh key exchange mode" |
| 763 | tests/ssl-opt.sh |
| 764 | } |
| 765 | |
| 766 | component_test_tls13_only_psk_all () { |
| 767 | msg "build: TLS 1.3 only from default, without ephemeral key exchange mode" |
| 768 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 769 | scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C |
| 770 | scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 771 | scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION |
| 772 | scripts/config.py unset MBEDTLS_ECDSA_C |
| 773 | scripts/config.py unset MBEDTLS_PKCS1_V21 |
| 774 | scripts/config.py unset MBEDTLS_PKCS7_C |
| 775 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 776 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 777 | |
| 778 | msg "test_suite_ssl: TLS 1.3 only, PSK and PSK ephemeral key exchange modes" |
| 779 | cd tests; ./test_suite_ssl; cd .. |
| 780 | |
| 781 | msg "ssl-opt.sh: TLS 1.3 only, PSK and PSK ephemeral key exchange modes" |
| 782 | tests/ssl-opt.sh |
| 783 | } |
| 784 | |
| 785 | component_test_tls13_only_ephemeral_all () { |
| 786 | msg "build: TLS 1.3 only from default, without PSK key exchange mode" |
| 787 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 788 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 789 | make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only.h\"'" |
| 790 | |
| 791 | msg "test_suite_ssl: TLS 1.3 only, ephemeral and PSK ephemeral key exchange modes" |
| 792 | cd tests; ./test_suite_ssl; cd .. |
| 793 | |
| 794 | msg "ssl-opt.sh: TLS 1.3 only, ephemeral and PSK ephemeral key exchange modes" |
| 795 | tests/ssl-opt.sh |
| 796 | } |
| 797 | |
| 798 | component_test_tls13_no_padding () { |
| 799 | msg "build: default config plus early data minus padding" |
| 800 | scripts/config.py set MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 1 |
| 801 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 802 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 803 | make |
| 804 | msg "test: default config plus early data minus padding" |
| 805 | make test |
| 806 | msg "ssl-opt.sh (TLS 1.3 no padding)" |
| 807 | tests/ssl-opt.sh |
| 808 | } |
| 809 | |
| 810 | component_test_tls13_no_compatibility_mode () { |
| 811 | msg "build: default config plus early data minus middlebox compatibility mode" |
| 812 | scripts/config.py unset MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 813 | scripts/config.py set MBEDTLS_SSL_EARLY_DATA |
| 814 | CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 815 | make |
| 816 | msg "test: default config plus early data minus middlebox compatibility mode" |
| 817 | make test |
| 818 | msg "ssl-opt.sh (TLS 1.3 no compatibility mode)" |
| 819 | tests/ssl-opt.sh |
| 820 | } |
| 821 | |
Minos Galanakis | f78447f | 2024-07-26 20:49:51 +0100 | [diff] [blame^] | 822 | component_test_full_minus_session_tickets () { |
Minos Galanakis | 7665a93 | 2024-07-26 15:45:11 +0100 | [diff] [blame] | 823 | msg "build: full config without session tickets" |
| 824 | scripts/config.py full |
| 825 | scripts/config.py unset MBEDTLS_SSL_SESSION_TICKETS |
| 826 | scripts/config.py unset MBEDTLS_SSL_EARLY_DATA |
| 827 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 828 | make |
| 829 | msg "test: full config without session tickets" |
| 830 | make test |
| 831 | msg "ssl-opt.sh (full config without session tickets)" |
| 832 | tests/ssl-opt.sh |
| 833 | } |
| 834 | |
Minos Galanakis | 6aab5b7 | 2024-07-25 14:24:37 +0100 | [diff] [blame] | 835 | |