valerio
ba1fd32eda
pk: optimize/reshape public key writing
...
Signed-off-by: valerio <valerio.setti@nordicsemi.no>
2023-06-01 11:06:41 +02:00
valerio
9ea26173d6
pk: uniformmize public key writing functions
...
Signed-off-by: valerio <valerio.setti@nordicsemi.no>
2023-06-01 11:06:40 +02:00
valerio
b727314133
pk: add internal helpers for opaque keys
...
Signed-off-by: valerio <valerio.setti@nordicsemi.no>
2023-06-01 11:06:40 +02:00
valerio
a87601dc11
pk_internal: add support for opaque keys for getting EC curve ID
...
Signed-off-by: valerio <valerio.setti@nordicsemi.no>
2023-06-01 11:06:40 +02:00
Manuel Pégourié-Gonnard
0b68784053
Merge pull request #7577 from mprse/ffdh_drivers
...
FFDH 3b: add driver testing (no TLS 1.3)
2023-06-01 10:26:08 +02:00
Manuel Pégourié-Gonnard
7b1136836c
Merge pull request #7438 from valeriosetti/issue7074
...
Avoid parse/unparse private ECC keys in PK with USE_PSA when !ECP_C
2023-06-01 10:06:45 +02:00
Gilles Peskine
a1b416670e
Merge pull request #7547 from silabs-Kusumit/PBKDF2_input_validation
...
PBKDF2: Input Validation
2023-06-01 10:05:34 +02:00
Przemek Stekiel
28111dbf06
Adapt guards for psa_is_dh_key_size_valid
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2023-05-31 09:30:58 +02:00
Przemek Stekiel
33c91eb5d3
Add driver support for DH import key and export public key
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2023-05-30 15:19:14 +02:00
Przemek Stekiel
055ffed563
Revert "Handle simple copy import/export before driver dispatch"
...
This reverts commit c80e7506a0
.
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2023-05-30 15:19:02 +02:00
Paul Elliott
981d8b6fc7
Merge pull request #7566 from paul-elliott-arm/core_ecp_mod_p448
...
[Bignum] Convert ecp_mod_p448 over to using core functions
2023-05-25 17:11:57 +01:00
Valerio Setti
449803abff
pkwrite: remove unnecessary code duplication
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-25 09:37:05 +02:00
Gilles Peskine
835be986e0
Merge pull request #7631 from tom-daubney-arm/remove_surplus_loop_condition_issue_7529
...
Remove extraneous check in for loop condition
2023-05-24 20:24:28 +02:00
Kusumit Ghoderao
91f99f52c4
Change output length parameter in pbkdf2_hmac_set_password
...
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 22:21:48 +05:30
Kusumit Ghoderao
d7a3f8065f
Restructure set salt function
...
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 22:19:47 +05:30
Paul Elliott
7050662a48
Correct comment header block
...
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-05-24 17:31:57 +01:00
Valerio Setti
a541e0108b
pkparse: avoid creating extra copy of the private key
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-24 16:02:36 +02:00
Valerio Setti
d0405093d9
tls: use pk_get_group_id() instead of directly accessing PK's structure
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-24 16:02:32 +02:00
Valerio Setti
1194ffa82f
pk: minor code fixes/enhancements
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-24 14:00:26 +02:00
Valerio Setti
51aa52eba4
pk: fix key properties when importing private key
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-24 14:00:09 +02:00
Kusumit Ghoderao
aac9a581f8
Fix code style and initialize status
...
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 14:19:17 +05:30
Dave Rodgman
2b22834357
Merge pull request #7644 from tom-daubney-arm/alignment_h_refactoring
...
Refactor reading of multi-byte values using functions in alignment.h
2023-05-24 08:32:52 +01:00
Kusumit Ghoderao
bd6cefb3da
Add HMAC specific function for setting password
...
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 12:36:34 +05:30
Kusumit Ghoderao
b538bb7a02
Restructure pbkdf2_set_salt function
...
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 12:32:14 +05:30
Kusumit Ghoderao
e66a8ad8d6
Define PSA_VENDOR_PBKDF2_MAX_ITERATIONS
...
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 12:30:43 +05:30
Kusumit Ghoderao
52fe517a77
Change pbkdf2 password to array
...
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 12:28:46 +05:30
Thomas Daubney
f9f0ba8211
Use functions in alignment.h to get value
...
Refactor code using get functions from alignment.h to
read values.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2023-05-24 06:24:16 +01:00
Paul Elliott
3b6bf105d1
Fix missed renames from N to X
...
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-05-23 17:51:52 +01:00
Valerio Setti
9efa8c4d14
pk: fix eckey_check_pair_psa
...
The problem was that the private key ID was destroyed even when
MBEDTLS_PK_USE_PSA_EC_DATA was enabled and of course this was
not correct.
At the same time the code has been slighlty reorganized to make
it more readable.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-23 15:12:07 +02:00
Valerio Setti
972077820b
tls/x509: minor enhancement for using the new private key format
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-23 15:12:07 +02:00
Valerio Setti
ae8c628edb
pk: improve sign, check_pair and wrap_as_opaque functions with new format
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-23 15:12:07 +02:00
Valerio Setti
00e8dd15d2
pk: manage parse and write for the new format
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-23 15:12:07 +02:00
Valerio Setti
b536126183
pk: manage allocate and free space when working with PSA private key
...
Allocation does not need to perform any action since the priv_id field
is already present on the pk_context.
Free should destroy the key. Of course this is true only if the key
is not opaque (because in that case it's the user responsibility
to do so).
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-23 15:12:07 +02:00
Valerio Setti
e0e6311b64
pk: change location of Montgomery helpers
...
This is to have them available only where they are really required.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-23 15:12:07 +02:00
Valerio Setti
8a6225062a
pk: move PSA error translation macros to internal header
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-23 15:12:07 +02:00
Manuel Pégourié-Gonnard
9dc9204b77
Merge pull request #7554 from valeriosetti/issue7073-reshape
...
Avoid parse/unparse public ECC keys in PK with USE_PSA when !ECP_C
2023-05-23 15:08:45 +02:00
Valerio Setti
016264b6cb
pk: fix a return value and a typo in comment
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-22 18:40:35 +02:00
Valerio Setti
a7cb845705
pk: add checks for the returned ECC family
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-22 18:39:43 +02:00
Paul Elliott
26070670d6
Merge pull request #7565 from gabor-mezei-arm/7263_split_out_Koblitz_raw_functions
...
[Bignum] Split out _raw Koblitz reduction functions
2023-05-22 16:03:17 +01:00
Thomas Daubney
850a0797ca
Remove extraneous check in for loop condition
...
Issue 7529 uncovered an unrequired check in a for loop
condition in ssl_tls.c. This commit removes said check.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2023-05-22 12:05:03 +01:00
Valerio Setti
f57007dd1e
pk: fixing and improving comments
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-19 13:54:39 +02:00
Dave Rodgman
68ef1d6ee6
Remove DIY SIZE_MAX definitions
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-18 20:49:03 +01:00
Paul Elliott
9a11f8a122
Merge pull request #7573 from tom-cosgrove-arm/add-psa_want_alg_some_pake
...
Only include psa_pake_setup() and friends if some PAKE algorithms are required
2023-05-18 09:59:52 +01:00
Paul Elliott
aa266f29e6
Merge pull request #7602 from mprse/AuthorityKeyId_leak_fix
...
Fix for memory leak while parsing AuthorityKeyId ext
2023-05-18 09:57:56 +01:00
Dave Rodgman
e4cbab6945
Merge pull request #7607 from daverodgman/pr6511
2023-05-17 19:11:56 +01:00
Paul Elliott
8203f2d89f
Merge pull request #7535 from minosgalanakis/ecp/7264_enable_core_shift_l
...
[Bignum] Adjust mbedtls_mpi_core_shift_l to use the core function
2023-05-17 18:45:44 +01:00
Valerio Setti
c1541cb3c7
pk: minor fixes (guards and a wrong assignment)
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 19:23:02 +02:00
Gabor Mezei
d56e6e008b
Add input parameter length check for the Koblitz reduction
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-05-17 17:51:19 +02:00
Gabor Mezei
fa3f74145b
Add documentation
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-05-17 17:35:47 +02:00
Valerio Setti
483738ed67
tests: fixes for using the new public key raw format
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 15:38:39 +02:00