6118 Commits

Author SHA1 Message Date
Waleed Elmelegy
525e355563 Change pkcs5 test dependencies from MBEDTLS_SHA1_C to MBEDTLS_MD_CAN_SHA1
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-09-04 18:20:32 +01:00
Waleed Elmelegy
d2a03cb6b8 Fix mbedtls_pkcs5_pbes test function failure
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-09-04 18:01:42 +01:00
Waleed Elmelegy
dcad168acf Improve mbedtls_pkcs5_pbes2_ext function test data
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-09-04 17:56:39 +01:00
Waleed Elmelegy
d4e57c3623 Fix unused parameters warnings when MBEDTLS_CIPHER_PADDING_PKCS7 is disabled
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-09-04 17:50:18 +01:00
Waleed Elmelegy
23ae41626c Fix heap overflow issue in pkcs5_pbes2 testing functions
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-09-04 17:47:09 +01:00
Waleed Elmelegy
b66cb65410 Add new mbedtls_pkcs5_pbe2_ext function
Add new mbedtls_pkcs5_pbe2_ext function to replace old
function with possible security issues.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-09-04 17:46:26 +01:00
Waleed Elmelegy
a55ffe5f37 Remove test helper functions not backported
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-08-08 17:07:04 +01:00
Waleed Elmelegy
3229cf9507 Replace MBEDTLS_MD_CAN_SHA1 config with old MBEDTLS_SHA1_C config
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-08-08 16:58:16 +01:00
Waleed Elmelegy
a230735d2f Fix CI errors related pkcs5_pbe changes
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-08-08 15:36:49 +01:00
Waleed Elmelegy
412629c815 Improve & test legacy mbedtls_pkcs5_pbe2
* Prevent pkcs5_pbe2 encryption when PKCS7 padding has been
  disabled since this not part of the specs.
* Allow decryption when PKCS7 padding is disabled for legacy
  reasons, However, invalid padding is not checked.
* Add tests to check these scenarios. Test data has been
  reused but with changing padding data in last block to
  check for valid/invalid padding.
* Document new behaviour, known limitations and possible
  security concerns.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2023-08-08 15:36:05 +01:00
Gowtham Suresh Kumar
21f2b7a64b tests/test_suite_ecp: Fix ECP group compare test
ECP group compare function should not check the value of T. We only need
to assert the value of T after the ECP group copy function is called.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-07-12 13:59:18 +01:00
Gilles Peskine
76a54ff1a8
Merge pull request #7901 from tgonzalezorlandoarm/tg/7879-backport
Backport 2.28: tests/test_suite_pem: Augment DES test cases with AES: PEM
2023-07-10 18:27:55 +02:00
Dave Rodgman
814a14a994
Merge pull request #7897 from tgonzalezorlandoarm/7136-backport
Backport 2.28: Record the outcome of each test case in compat.sh
2023-07-10 12:08:41 +01:00
Tomás González
991c49f812 tests/test_suite_pem: Augment DES test cases with AES: PEM
A few negative test cases in test_suite_pem.data rely on DES
(“invalid iv”, “malformed”). DES is deprecated.
Construct similar test cases using AES.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-07-10 11:38:30 +01:00
Yanray Wang
5659981cf8 ssl-opt.sh: support to parse --outcome-file
Adjust where to set absolute path for MBEDTLS_TEST_OUTCOME_FILE
as it's supposed to set its absolute path after all possible
value assignment.

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-07-10 09:38:24 +01:00
Dave Rodgman
b18d45f042
Merge pull request #7483 from gilles-peskine-arm/mbedtls_x509_crt_parse_path-qemu-bug-2.28
Backport 2.28: More mbedtls_x509_crt_parse_path() tests, and note qemu-user bug when 32-bit code run on 64-bit host
2023-07-07 19:15:46 +01:00
Dave Rodgman
f8f4c6053a
Merge branch 'mbedtls-2.28' into mbedtls_x509_crt_parse_path-qemu-bug-2.28
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-07 15:15:47 +01:00
Yanray Wang
44ba969acb compat.sh: add support to record outcome of test cases
If the environment variable MBEDTLS_TEST_OUTCOME_FILE is set,
the test outcome file records each test case in a single line
with the format of

 PLATFORM;CONFIGURATION;compat;TEST CASE DESCRIPTION;RESULT;[CAUSE]

- CONFIGURATION comes from MBEDTLS_TEST_CONFIGURATION to record
  configuration of each test case
- PLATFORM is either set by users or calculated from test
  platform
- RESULT is one of PASS, FAIL or SKIP. If test case fails,
  srv_out/cli_out follows as FAILURE CAUSE.

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-07-07 12:23:08 +01:00
Yanray Wang
0f386b7372 compat.sh: call record_fail if test case fails
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-07-07 11:34:54 +01:00
David Horstmann
6762231e4b Use CONFIG_H variable rather than config file name
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-07-05 14:35:25 +01:00
David Horstmann
175afbdfe8 all.sh component to test cmake custom config file
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-07-05 14:35:25 +01:00
Dave Rodgman
08efc3d768
Merge pull request #7854 from daverodgman/fix-unused-aes-2.28
Fix AES dependencies - build TF-M config cleanly - backport 2.28
2023-07-03 16:48:39 +01:00
Dave Rodgman
bf99828d7b Nicer formatting
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:14:41 +01:00
Dave Rodgman
173227d41e Test combinations of macros for aes.o
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:14:34 +01:00
David Horstmann
5c019e0f65 Add regression testcase for string_to_names()
Test against a string with no '=' or ',' in it, which previously caused
mbedtls_x509_string_to_names() to return 0.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-06-27 17:34:58 +01:00
Gilles Peskine
63b50b56cd
Merge pull request #7753 from lpy4105/backport-2.28/issue/renew_cert_2024-01-01
Backport 2.28: Updating crt/crl files due to expiry before 2024-01-01
2023-06-21 12:29:12 +02:00
Demi Marie Obenour
5d7cd012ac x509parse tests: Replace TEST_ASSERT with TEST_EQUAL
The latter gives much more informative errors.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-06-19 11:04:47 -04:00
Valerio Setti
e20ec4f1dd crypto_config_test_driver_extension: treat PUBLIC_KEY the same way as KEY_PAIR
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-19 10:03:29 +02:00
Pengyu Lv
e1136d5eb4 Update test-ca2.crt[.der] and server5.crt[.der]
Update these files to match the data in `library/certs.c`.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-19 10:17:21 +08:00
Pengyu Lv
1fca541a5f Remove redundant PHONY targets
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-14 09:55:51 +08:00
Pengyu Lv
a640339243 Fix long line format
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-14 09:55:51 +08:00
Pengyu Lv
9dbd1df175 Update crl-ec-sha*.pem, crl.pem, crl_cat_*.pem
This commit updates the files manually, the rules
of generating these files will be upload in other
PR.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:51:08 +08:00
Pengyu Lv
8569c876a4 Add rules to generate crl_cat*
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:50:58 +08:00
Pengyu Lv
dc66d3a34c Update server10*.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:49:02 +08:00
Pengyu Lv
f23ecc1941 Update server8*.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:48:31 +08:00
Pengyu Lv
3ff09ec78f Update server7*.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:47:47 +08:00
Pengyu Lv
d5be96c4c7 Update test-int-ca*.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:45:39 +08:00
Pengyu Lv
fe50030b5b Add rules to generate test-int-ca{2,3}.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:45:14 +08:00
Pengyu Lv
bb0fd701ad Update test-ca2_cat-*.crt and test-ca_cat*.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:42:04 +08:00
Pengyu Lv
e106de0ebb Update server6.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:41:11 +08:00
Pengyu Lv
e340675475 Update test-ca[1|2].crt[.der]
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:39:02 +08:00
Pengyu Lv
d8893ccb9b Update server5[-der*|-sha*].crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:38:24 +08:00
Pengyu Lv
381186b853 Add rules to generate test-ca2_cat-*.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:36:32 +08:00
Pengyu Lv
43ad9848db Add rules to generate server10*.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:35:10 +08:00
Pengyu Lv
4217429a46 Add rules to generate server8*.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:30:10 +08:00
Pengyu Lv
30cd6b0964 Add rules to generate server7*.crt
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-13 17:27:20 +08:00
Jerry Yu
324a43b4ac Add rules to generate server6.crt
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-06-13 17:24:11 +08:00
Jerry Yu
fa4ef28c00 Add rules to generate server5-sha*.crt
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-06-13 17:22:45 +08:00
Jerry Yu
c2d694e367 Add server5-der*crt generate command
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-06-13 17:20:01 +08:00
Jerry Yu
111f4353f7 Add rules to generate server5[-badsign].crt
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-06-13 17:08:45 +08:00