Commit graph

17917 commits

Author SHA1 Message Date
Gilles Peskine
5d99682a8c Add --error-test option to test error detection and reporting
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-08 17:35:19 +02:00
Gilles Peskine
62cf2e8e9f Switch all.sh to bash
This will let us use bash features that are not found in some other sh
implementations, such as DEBUG and ERR traps, "set -o pipefail", etc.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-08 17:35:19 +02:00
Yuto Takano
9c09d5513e Raise max_content_len constraint by one in Connection ID tests
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-08 16:03:44 +01:00
Yuto Takano
bc87b1ddf3 Add content length constraint to tests that use max_frag_len
Includes:
- handshake memory tests
- Connection ID (MFL) tests
- DTLS fragmenting tests

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-08 15:56:33 +01:00
Joe Subbiani
93213f6649 Remove test cases and update power 2 check
The power 2 check now uses a looping bit shift to try match
with the block sizes and will escape the loop when appropriate

The test cases, as pointed out by Gilles, could be harmful in
the future and testing a test case is not generally necessary

Signed-off-by: Joe Subbiani <joe.subbiani@arm.com>
2021-07-08 15:32:52 +01:00
David Horstmann
44f6390c32 Remove redundant hash len check
Remove a check in rsa_rsassa_pkcs1_v15_encode() that
is not needed because the same check is performed
earlier. This check was added in #4707.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2021-07-08 12:46:26 +01:00
Manuel Pégourié-Gonnard
07704c09ce
Merge pull request #4752 from mpg/fix-memleak-in-ssl-test
Fix memory leak on failure path in test code
2021-07-08 12:34:16 +02:00
Paul Elliott
a02003babe Fix divide by zero if macro used with wrong key
If PSA_CIPHER_ENCRYPT_OUTPUT_SIZE was called on a non symmetric key,
then a divide by zero could happen, as PSA_CIPHER_BLOCK_LENGTH will
return 0 for such a key, and PSA_ROUND_UP_TO_MULTIPLE will divide by the
block length.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2021-07-07 17:24:46 +01:00
Gilles Peskine
95d65c773e
Merge pull request #4756 from gilles-peskine-arm/generate_psa_tests-speedup-3.0
Speed up the generation of storage format test cases
2021-07-07 15:27:31 +02:00
Gilles Peskine
45f2a40fa4 Speed up the generation of storage format test cases
Restore the optimization done in
 HEAD^{/Speed up the generation of storage format test cases}
which was lost during refactoring made when adding support for
implicit usage flags.

There are still more than one call to the C compiler, but the extra
calls are only for some key usage test cases.

This is an internal refactoring. This commit does not change the
output of generate_psa_tests.py

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-07 12:47:47 +02:00
Dave Rodgman
f2d1199edc
Merge pull request #846 from ARMmbed/mbedtls-3.0.0_merge_into_release
Mbedtls 3.0.0 merge into release
2021-07-07 11:18:30 +01:00
TRodziewicz
458280e67c Correction to outdated comment
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-07-07 11:33:06 +02:00
Manuel Pégourié-Gonnard
e5306f6c1d Use distinct variables for distinct purposes
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2021-07-07 10:48:26 +02:00
Dave Rodgman
45419c1ee5 Revert "Add auto-generated files"
This reverts commit 3e84187132.
2021-07-06 20:44:59 +01:00
Dave Rodgman
8a3b232f57 Revert "Add additional generated files"
This reverts commit 2a9c783625.
2021-07-06 20:44:54 +01:00
Joe Subbiani
fc46318792 Change test suite duplicate descriptions
tests/scripts/check_test_cases.py located duplicate descriptions
for the negative tests checking that the check fails when a block
size is not a power of 2

Signed-off-by: Joe Subbiani <joe.subbiani@arm.com>
2021-07-06 14:44:20 +01:00
Dave Rodgman
8df2f8e7b9
Merge pull request #842 from ARMmbed/mbedtls-3.0.0rc0-pr
Mbedtls 3.0.0rc0 pr
2021-07-06 13:00:08 +01:00
TRodziewicz
345165c1f7 Reverting deleted macros
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-07-06 13:42:11 +02:00
Manuel Pégourié-Gonnard
71ce4ef981 Fix bug with UDP proxy not forwarding enough
We previously introduced a safety check ensuring that if a datagram had
already been dropped twice, it would no longer be dropped or delayed
after that.

This missed an edge case: if a datagram is dropped once, it can be
delayed any number of times. Since "delay" is not defined in terms of
time (x seconds) but in terms of ordering with respect to other messages
(will be forwarded after the next message is forwarded), depending on
the RNG results this could result in an endless loop where all messages
are delayed until the next, which is itself delayed, etc. and no message
is ever forwarded.

The probability of this happening n times in a row is (1/d)^n, where d
is the value passed as delay=d, so for delay=5 and n=5 it's around 0.03%
which seems small but we still happened on such an occurrence in real
life:

    tests/ssl-opt.sh --seed 1625061502 -f 'DTLS proxy: 3d, min handshake, resumption$'

results (according to debug statements added for the investigation) in
the ClientHello of the second handshake being dropped once then delayed
5 times, after which the client stops re-trying and the test fails for
no interesting reason.

Make sure this doesn't happen again by putting a cap on the number of
times we fail to forward a given datagram immediately.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2021-07-06 12:39:43 +02:00
Manuel Pégourié-Gonnard
69c10a41c7 Fix memory leak on failure path in test code
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2021-07-06 12:05:23 +02:00
Joe Subbiani
f37bbe53a0 Extend psa_crypto_metadata tests to check for powers of 2
Add a check to ensure the block_size is or is not a power of 2

Add a new parameter to verify the expected pass/fail when a block_size
is or is not a power of 2.

Add new sets of input data to verify these tests

Fixes #4228

Signed-off-by: Joe Subbiani <joe.subbiani@arm.com>
2021-07-06 10:42:54 +01:00
Dave Rodgman
745e3587be Fix Changelog indentation
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-05 18:53:31 +01:00
Dave Rodgman
5b13f60aa3 Fix indentation
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-05 18:09:16 +01:00
TRodziewicz
302ed2bf7d Reverting the TLS 1.3 compatibility
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-07-05 16:55:27 +02:00
Dave Rodgman
16d802ed25 Remove obsolete entry from Changelog
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-05 15:40:35 +01:00
TRodziewicz
5f58dfc9d9 Addition of the changelog file.
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-07-05 16:21:59 +02:00
TRodziewicz
d9be65277d Corrections to the new functions names and error message wording
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-07-05 15:16:00 +02:00
TRodziewicz
053b99b90b Re-introduction of key slot chekcs
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-07-05 12:06:03 +02:00
Yuto Takano
6f6574381e Move repetitive equality check to requires_config_value_equals
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-02 15:37:19 +01:00
Yuto Takano
0248582033 Reword and add explanatory comments for MAX_IM_CA tests
- Reword the comment on config.h to suggest that
  `MAX_INTERMEDIATE_CA` may not exist in the config.
- Add a comment explaining why the tests are more restrictive
  than necessary.

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-02 15:37:19 +01:00
Yuto Takano
b0a1c5b021 Use requires_max_content_len, add check in Renegotiation
- Abstract out repetitive checks for IN and OUT content lens
- Remove unclear comment and redundant echo
- Add content length constraints in Renegotiation with fragment length test

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-02 15:37:19 +01:00
Yuto Takano
2be6f1ac5b Add space between command substitution braces and content
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-02 15:37:19 +01:00
Yuto Takano
73e7dcbdfc Add MAX_IM_CA requirement to int_max+1 chain as well
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-02 15:37:19 +01:00
Yuto Takano
e43556b6bf Remove hard exit with MAX_INTERMEDIATE_CA in ssl-opt.sh
- Replace last remaining dependency on config.py with query_config
- Replace hard exit with `requires_config_value_at_least` and
  `requires_config_value_at_most` to maintain the same effect

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-02 15:37:19 +01:00
Yuto Takano
0509fea3b2 Remove hard exit in ssh-opt.sh, replace with requires functions
- Replace calls to config.py for MAX_IN_LEN and MAX_OUT_LEN with
  `get_config_value_or_default`
- Remove hard exit when MAX_IN/OUT_LEN < 4096, replace with
  `requires_config_value_at_least`

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-02 15:37:19 +01:00
Dave Rodgman
527b82a34c Bump .so version numbers to stay ahead of 2.x
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-02 15:19:38 +01:00
Dave Rodgman
8e5020dead Remove obsolete reference to _ret in migration guide
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-02 12:16:03 +01:00
Dave Rodgman
814b099501 Remove obsolete reference to _ret
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-02 12:11:14 +01:00
Dave Rodgman
83f6a3b02c Remove not-required Changelog entries
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-01 17:28:56 +01:00
Dave Rodgman
0703f694b8 Remove warning of development instability from README
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-01 17:06:26 +01:00
Dave Rodgman
a84a8eb545 Update changelog to cover #4197
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-01 17:01:04 +01:00
Dave Rodgman
0eb215f4a4 Update changelog to cover #4246 and #4158
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-01 17:00:38 +01:00
Dave Rodgman
aa6a9b1725 Update changelog to cover #4488
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-01 17:00:06 +01:00
Dave Rodgman
9bd038907b Update changelog to cover #4517
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-01 16:59:49 +01:00
Dave Rodgman
eaef0b78db Update changelog to cover #4720
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-01 16:59:13 +01:00
Gilles Peskine
1fe01acfc3 Add option to list the generated files and exit
This is useful during the release process, when we want to commit the
generated files.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-01 11:13:29 +02:00
Gilles Peskine
494678a405 The version was moved from version.h to build_info.h
Moved in 04982f7b6b (#4589)

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-01 11:11:30 +02:00
Gilles Peskine
aa4862a5e6 Bump the version number in CMakeLists.txt
Added in d259e347e6 (#4259)

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-01 11:10:29 +02:00
Gilles Peskine
716b973fb7 Stop on errors
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-01 11:10:15 +02:00
Dave Rodgman
2a9c783625 Add additional generated files
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-07-01 09:57:20 +01:00