76 Commits

Author SHA1 Message Date
Gilles Peskine
de2316b8ea Add ignore list entries for TLS tests that are not executed
For each ignore list entry, link to a GitHub issue for its resolution,
except for ssl-opt Valgrind tests which we never intend to run on the CI.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
edc8f35ed3 Remove obsolete requirements on middlebox compatibility mode: manual
MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE is no longer required, except in test
cases that are specifically about it. This commit removes the requirement on
all test cases except those whose description contains "middlebox".

Exclude tls13-compat.sh which is automatically generated and will be handled
in a separate commit.

```
perl -0777 -i -pe '
    # With -0777, we act on the whole file.
    # s[REGEXP][EXPR]gm replaces every occurrence of REGEXP by EXPR.
    # The regexp matches "requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE",
    # followed by zero or more non-empty lines, followed by a line starting
    # with "run_test" and not containing "middlebox".
    # The replacement is everything matched except the first line.
    s[^requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE\n((?:.+\n)*run_test (?!.*middlebox))]
     [$1]gm' tests/ssl-opt.sh tests/opt-testcases/tls13-kex-modes.sh tests/opt-testcases/tls13-misc.sh
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-24 18:59:30 +02:00
Gilles Peskine
0f2d839521 Remove mid-stanza blank lines
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-24 18:58:49 +02:00
Gilles Peskine
7b02c1f3b6 Avoid multiline requires_all_configs_xxx
For better searchability and readability, call requires_config_enabled or
requires_config_disabled for each option, instead of calling
requires_all_configs_enabled or requires_all_configs_disabled with a long
list of options.

```
perl -0777 -i -pe '
    # With -0777, we act on the whole file.
    # s[REGEXP][CODE]egm replaces every occurrence of REGEXP by the result
    # of running CODE.
    # The regexp matches "requires_all_configs_enabled" or
    # "requires_all_configs_disabled" followed by a list of words ending
    # with a line break. The words can be separated by a sequence of
    # spaces and optionally a backslash-newline.
    s[^requires_all_configs_(enabled|disabled) *((?:(?: \w+) *(?:\\\n)? *)+)\n][
      $state = $1;
      # Extract all the words from the list of words (/(\w+)/g). For each word,
      # For each word, construct a line "requires_config_XXXabled WORD".
      # The replacement text is the concatenation of these lines.
      join("", map {"requires_config_$state $_\n"} $2 =~ /(\w+)/g)
     ]egm' tests/ssl-opt.sh tests/opt-testcases/*.sh
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-24 18:58:47 +02:00
Gilles Peskine
1d6a9505ee opt-testcases/*.sh are not executable
The *.sh files in opt-testcases cannot be executed directly: they can only
be sourced by ssl-opt.sh. So don't make them executable and don't give them
a shebang line.

Also make sure that the first paragraph of each file is a short description.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-24 18:56:24 +02:00
David Horstmann
dcf18dd876 Update paths pointing to tests/data_files
These now point to framework/data_files instead.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-07-05 15:49:03 +01:00
Ronald Cron
ceae4f85ea ssl-opt.sh: Add tests where tickets are ignored
Add tests where we explicitely check that
tickets are ignored on client side when
the support is not enabled.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-27 09:37:37 +01:00
Norbert Fabritius
4f1c9278cc ssl-opt.sh: Add missing MBEDTLS_SSL_SESSION_TICKETS dependencies
Signed-off-by: Norbert Fabritius <norbert.fabritius@esrlabs.com>
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-27 09:37:37 +01:00
Ronald Cron
dd2dc1578a ssl-opt.sh: Add m->m resumption and early data tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-15 10:21:40 +01:00
Ronald Cron
e739892cf8 ssl-opt.sh: Rework m->m resumption tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-15 10:21:35 +01:00
Ronald Cron
3cf41457ee ssl-opt.sh: Move m->m resumption tests
Move m->m resumption tests just
before resumption and early data tests
against GnuTLS and OpenSSL.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-15 09:41:03 +01:00
Ronald Cron
820199a2ef ssl-opt.sh: Rework O->m placeholder test
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:04:07 +01:00
Ronald Cron
1ccd7a72c8 ssp-opt.sh: Expand G->m resumption and early data tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:04:07 +01:00
Ronald Cron
854df135ab ssl-opt.sh: Group TLS 1.3 resumption and early data G->m tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:04:07 +01:00
Ronald Cron
00fa13bf78 ssl-opt.sh: Rework m->O resumption and early data tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:04:07 +01:00
Ronald Cron
47d4a52483 ssl-opt.sh: Remove m->O early data test based on external PSK
Eventually we do not support early data with
external PSK thus no point to do a positive
test on that basis.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:04:07 +01:00
Ronald Cron
05210086c0 ssl-opt.sh: Expand m->G resumption and early data tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:04:07 +01:00
Ronald Cron
c893779bb5 ssl-opt.sh: Remove redundant early data test
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:04:07 +01:00
Ronald Cron
c8d604d0a1 ssl-opt.sh: Group TLS 1.3 resumption and early data m->G tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:04:07 +01:00
Ronald Cron
f1ad73f6ca ssl-opt.sh: Group TLS 1.3 resumption and early data compat tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:04:05 +01:00
Ronald Cron
74191a56e8 ssl_server2: Split early data enablement from max_early_data_size setting
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-14 20:00:42 +01:00
Ronald Cron
e14770fc42 ssl-opt.sh: Fix early data test option
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:57:36 +01:00
Ronald Cron
1f63fe4d74 tls13: srv: Fix resume flag in case of cancelled PSK
If we prefer ephemeral key exchange mode over
the pure PSK one, make sure the resume flag is
disabled as eventually we are not going to
resume a session even if we aimed to at some
point.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
cf284565c5 tls13: srv: Determine best key exchange mode for a PSK
Determine best key exchange for for ticket based and
external PSKs.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Xiaokang Qian
30bb7ce9a2 Add test case for early data writing
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-02-07 08:06:46 +01:00
Ronald Cron
54a3829453 ssl_client2: Simplify early_data option
No need to define specific early data,
the idea is rather to just send the
usual request data as early data
instead of standard application data.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-02-07 08:06:46 +01:00
Jerry Yu
064dd2b870 Adjust check order
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2024-02-02 17:31:20 +01:00
Jerry Yu
579bd4d46b Update early data test
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-02-01 16:40:47 +01:00
Gilles Peskine
a211bb7f01
Merge pull request #8596 from xkqian/tls13_early_data_input_file
Change early data flag to input file
2023-12-11 21:14:57 +00:00
Xiaokang Qian
aedfc0932b Revert to ae952174a7 and addressing some comments
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2023-12-08 10:43:24 +00:00
Xiaokang Qian
dce183f2e2 Remove the duplicate cases and add early_data_file option
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2023-12-07 09:22:38 +00:00
Xiaokang Qian
864c62a906 Add one test case with early_data_file
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2023-12-07 06:11:38 +00:00
Xiaokang Qian
dd8a7f8acf Revert the early data test case
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2023-12-07 03:58:05 +00:00
Jerry Yu
750e06743f remove misbehavior tests and code
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-12-06 18:22:15 +08:00
Jerry Yu
ea96ac3da9 fix various issues
- get ticket_flags with function.
- improve output message and check it.
- improve `ssl_server2` help message

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-12-06 18:17:37 +08:00
Jerry Yu
391c943340 Add tests for ticket early data permission bit
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-12-06 18:16:48 +08:00
Ronald Cron
40f3f1c36f
Merge pull request #7058 from yuhaoth/pr/tls13-early-data-parsing-0-rtt-data
TLS 1.3 EarlyData SRV: Parsing 0-RTT data
2023-12-06 06:47:32 +00:00
Xiaokang Qian
70fbdcf904 Change early data flag to input file
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2023-12-05 05:50:08 +00:00
Jerry Yu
0e9eafff13 Update tests to the code status
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-22 16:48:39 +08:00
Yanray Wang
951b3cb400 tls13-misc: cli: check parser of max_early_data_size ext
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-11-22 10:33:11 +08:00
Jerry Yu
60e997205d replace check string
The output has been changed

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-21 09:59:25 +08:00
Tom Cosgrove
53199b1c0a
Merge pull request #6720 from yuhaoth/pr/tls13-early-data-receive-0_rtt-and-eoed
TLS 1.3: EarlyData SRV: Write early data extension  in EncryptedExtension
2023-11-07 13:59:13 +00:00
Tom Cosgrove
4122c16abd
Merge pull request #6945 from lpy4105/issue/6935/ticket_flags-kex-mode-determination
TLS 1.3: SRV: Check ticket_flags on kex mode determination when resumption
2023-11-07 09:26:21 +00:00
Jerry Yu
7ef9fd8989 fix various issues
- Debug message
- Improve comments

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-07 14:31:37 +08:00
Pengyu Lv
4ebf86e780 tls13-misc: Do not check kex mode for some cases
Ephemeral is preferred over pure PSK, the change is
to make CI happy.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-11-07 10:14:32 +08:00
Dave Rodgman
16799db69a update headers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-02 19:47:20 +00:00
Jerry Yu
454dda3e25 fix various issues
- improve output message
- Remove unnecessary checks
- Simplify test command

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-01 10:28:43 +08:00
Jerry Yu
2db16b7b16 disable tests when ecp is not available
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-10-27 10:59:20 +08:00
Jerry Yu
0edafa9449 Add test case for writing early data in EE
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-10-27 10:58:06 +08:00
Jerry Yu
53a332d970 fix various issues
- rename file name from `early_data.txt` to `tls13_early_data.txt`
- fix typo issue
- remove redundant parameter

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-10-23 13:52:56 +08:00