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