Commit graph

26147 commits

Author SHA1 Message Date
Manuel Pégourié-Gonnard
45e009aa97
Merge pull request #7814 from valeriosetti/issue7746
PK: refactor wrappers in the USE_PSA case
2023-07-03 09:32:31 +02:00
Valerio Setti
f7cd419ade pk: ignore opaque EC keys in pk_setup when they are not supported
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 18:11:29 +02:00
Valerio Setti
35d1dacd82 pk_wrap: fix: always clear buffer holding private key in eckey_check_pair_psa
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 18:04:16 +02:00
Gabor Mezei
f4aab6f666
Add comments and remove unneeded defines
For `check_names.py` it is enough to appear a macro definition in
a comment to validate it.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-06-30 16:54:55 +02:00
Valerio Setti
38913c16b0 pk_wrap: do not support opaque EC keys when !PK_HAVE_ECC_KEYS
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 16:18:33 +02:00
Tom Cosgrove
c4a760c538
Merge pull request #7849 from davidhorstmann-arm/fix-string-to-names-retcode
Fix false success return code in `mbedtls_x509_string_to_names()`
2023-06-30 14:28:29 +01:00
Andrzej Kurek
78ecf41f22 Change spaces to a tab in a makefile recipe
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-06-30 08:42:05 -04:00
Andrzej Kurek
03478d2b90
Merge branch 'development' into issue/7816/add-commands-for-files-in-parse_input
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-06-30 14:38:05 +02:00
Dave Rodgman
c23d2222ea
Merge pull request #7728 from waleed-elmelegy-arm/crypt_and_hash-decrypt-fix
Fix crypt_and_hash decrypt issue when used with stream cipher
2023-06-30 11:42:35 +01:00
Dave Rodgman
a2c1a387e4
Merge pull request #7630 from daverodgman/prefer-intrinsics
Prefer intrinsics over asm for AES-NI
2023-06-30 11:39:38 +01:00
Dave Rodgman
2d07a72b35
Merge pull request #7821 from davidhorstmann-arm/simplify-test-dn-formatting
Simplify directory name comparison in AuthorityKeyIdentifier tests
2023-06-30 11:38:03 +01:00
Dave Rodgman
38939f705a
Merge pull request #7822 from gilles-peskine-arm/code-style-since
code_style.py --since
2023-06-30 11:37:02 +01:00
Gabor Mezei
c810707980
Add check for the ecp module variants
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-06-30 11:39:21 +02:00
Gabor Mezei
9b6b5a06d5
Enable testing the cloned ecp module
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-06-30 11:39:20 +02:00
Gabor Mezei
1df4c6435f
Enable build of the new ecp_new.c file
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-06-30 11:39:20 +02:00
Gabor Mezei
a306d20766
Clone the ecp.c file as ecp_new.c
Add macro guard for each file defaults to enable the ecp.c file content.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-06-30 11:38:55 +02:00
Valerio Setti
eabfef3d1b generate_psa_tests: fix docstring for tweak_key_pair_dependency function
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 11:09:43 +02:00
Valerio Setti
06dfba7fd9 config_psa: enabled EC key derivation support when ECP_C is enabled
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
0c42c435f1 generate_psa_tests: optimize code for key pair dependencies generation
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
c0d2f8417a test: replace all KEY_TYPE_ECC_KEY_PAIR with proper symbols
Note: the DERIVE option is intentionally skipped from the acceleration
list because this feature is still not supported.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
27c501a10c lib/test: replace BASIC_IMPORT_EXPORT internal symbol with BASIC,IMPORT,EXPORT
Also the python script for automatic test generation is fixed accordingly

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
86587abde4 psa: fix guards for EC key derivation
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
072bded588 test: use proper key pair symbols in accelerated list for EC curve test
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
7bbd98fad0 generate_psa_tests: minor fixes
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
dd24f29105 psa: fix wrong naming for ECC derive symbols in code
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
ae064433be configs: adapt to new symbols
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
24c64e8b34 generate_psa_tests: improve script to handle all generated files
For now RSA key pairs' dependencies are kept to LEGACY, but this
is going to be updated in #7772.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
4c0174de2e psa: replace remaining ECC_KEY_PAIR_LEGACY symbols with proper ones
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
656f5ff23e generate_psa_tests: remove GENPRIME from dependencies of RSA key pair
This is automatically included by the new RSA_KEY_PAIR_GENERATE
symbol.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
76882fc632 generate_psa_tests: improve code for key pairs dependency generation
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
5d58a55e06 generate_psa_tests: fix comments
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
5ac2689bc2 test: reset proper guards for ECJPAKE tests
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
5dad7051b4 psa_crypto_ecp: fix wrong comment in #endif
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:22 +02:00
Valerio Setti
ac6b0d1fd8 test: rename function testing EC key generation in driver_wrappers
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
2a63460248 psa: fix guards for EC key derivation
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
f6587be09a test: remove useless accelerator intialization + minor restyling
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
a983655526 test: use better naming for new components
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
6a9d0ee373 library/test: replace LEGACY symbol with BASIC_IMPORT_EXPORT
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
73fc082fcd config_psa: introduce new internal KEY_PAIR symbol for BASIC+IMPORT+EXPORT
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
5ca80e7de0 test: properly handle new KEY_PAIR_yyy symbols in PSA generated test
This includes:

- removal of temporary patches recently introdued in PR 7641
- proper replacing of legacy KEY_PAIR symbols with either
  KEY_PAIR_IMPORT or KEY_PAIR_GENERATE depending on the test

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
f09977023b test: replace ECC_KEY_PAIR_LEGACY with GENERATE
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
bfeaf5b4f6 library: replace ECC_KEY_PAIR_LEGACY with GENERATE
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
c2a4fb7754 test: replace ECC_KEY_PAIR_LEGACY with DERIVE
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:16:21 +02:00
Valerio Setti
8ffdb5df7d library: replace ECC_KEY_PAIR_LEGACY with DERIVE
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:12:19 +02:00
Valerio Setti
249b18a286 test: add new component to test with all KEY_PAIRs enabled but one
- this component should work also for RSA and DH keys, not only for
  EC
- of course the acceleated counterpart is hanlded properly

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-06-30 10:12:19 +02:00
Manuel Pégourié-Gonnard
3f2448b75e
Merge pull request #7802 from AndrzejKurek/go-go-der-certs
Use DER format for x509 SAN tests
2023-06-30 09:36:08 +02:00
Gilles Peskine
053022fe24 Reduce the size of mbedtls_mpi
Reduce the size of mbedtls_mpi from 3 words to 2 on most architectures.

This also reduces the code size significantly in bignum.o and ecp_curves.o,
with negligible variations in other modules.

This removes the ability to set MBEDTLS_MPI_MAX_LIMBS to a value >=65536,
but we don't support customizing this value anyway (it's always 10000).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-29 19:33:44 +02:00
Gilles Peskine
0ca2a1f51b
Merge pull request #7646 from gilles-peskine-arm/psa-driver-transaction-testing-spec
Storage resilience with stateful secure elements: design document
2023-06-29 18:25:52 +02:00
Pengyu Lv
18730ddbcf fix fragile way to refer to server1.req.sha256
The original varible $< is fragile especially
when there are multiple rules for the same
target.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-30 00:23:13 +08:00
Dave Rodgman
1a4936ab86 Remove options not known to older gcc
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 14:07:50 +01:00