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