31639 Commits

Author SHA1 Message Date
David Horstmann
dcc78eee1f Fix typos in make clean target for Windows
Signed-off-by: David Horstmann <david.horstmann@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-29 11:01:10 +02:00
Gilles Peskine
99b57bd35a
Merge pull request #1272 from eleuzi01/forward-1263
Fix 1.3 cli-auth optional reporting of (ext)KeyUsage issues
2024-08-28 19:38:36 +02:00
Gabor Mezei
c15ef93aa5
Replace MBEDTLS_MD_CAN_SHA512 with PSA_WANT_ALG_SHA_512
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-08-28 18:20:25 +02:00
Elena Uziunaite
414e59bcf4 Leave the spaces in psa-transition.md
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-27 19:22:08 +01:00
Elena Uziunaite
34fe4fddfd Fix typo in psa-transition.md
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-27 16:07:09 +01:00
Gilles Peskine
ab0af45d11
Merge pull request #9464 from gilles-peskine-arm/psa-keystore-dynamic-development
dynamically sized key store
2024-08-26 10:47:00 +00:00
Manuel Pégourié-Gonnard
e2119aa591
Merge pull request #1281 from gilles-peskine-arm/merge-development-restricted-20240823
Merge development into -restricted
2024-08-26 12:08:50 +02:00
Gilles Peskine
0a2b6e2945 Merge remote-tracking branch 'development' into development-restricted 2024-08-23 11:14:11 +02:00
Gilles Peskine
805ac15e2d
Merge pull request #9244 from waleed-elmelegy-arm/fix-tls13_parse_client_hello-issue
Fix issue in handling legacy_compression_methods in ssl_tls13_parse_client_hello()
2024-08-22 18:56:27 +00:00
Waleed Elmelegy
344f79bde6 Reduce the wording in changelog entry
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 16:33:17 +00:00
Waleed Elmelegy
65e73c88bd Improve the changelog entry for fixing legacy compression issue
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 16:27:27 +00:00
Waleed Elmelegy
b5df9d8b65 Add chanelog entry for fixing legacy comprssion methods issue
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 16:10:10 +00:00
David Horstmann
5edab7c57d
Merge pull request #1277 from gilles-peskine-arm/memory_allocation_cleanup_psa_crypto_rsa-changelog-development
Changelog entry for the RSA memory leak
2024-08-22 15:44:58 +01:00
Gilles Peskine
4c9fccff5a Simplify and explain the overflow check for maximum slice length
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-22 10:56:19 +02:00
Elena Uziunaite
da27eba669 Tiny fix in ChangeLog pt 2
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-22 09:23:48 +01:00
minosgalanakis
d65f4b83f0
Merge pull request #9485 from sergio-nsk/sergio-nsk/lean_and_mean/1
Fix Mbed-TLS build when WIN32_LEAN_AND_MEAN macro is defined globally
2024-08-22 08:01:07 +00:00
Elena Uziunaite
e0c6f80403 Tiny fix in ChangeLog
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-22 09:00:57 +01:00
Gilles Peskine
98dd0c1f1c Changelog entry for the RSA memory leak
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-21 22:03:16 +02:00
David Horstmann
0b2bd071f8 Add overflow check for maximum key slot length
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-08-21 21:49:17 +02:00
David Horstmann
68a4b7453f Tweak macro check to allow 3 extra key slices
We are technically allowed to use all possible values of key slice index
that will fit into the bit width we have allocated, so allow all values.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-08-21 21:49:16 +02:00
David Horstmann
fdcc47c426 Fix incorrect comments on slice numbering
The persistent key cache slice is the last slice (not the first as
previously stated). Update the numbering-related comments accordingly.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-08-21 21:49:14 +02:00
Elena Uziunaite
f72a510590 Edit ChangeLog entry
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-21 11:12:34 +01:00
Tom Cosgrove
8b0908aaa7
Merge pull request #1270 from sezrab/memory_allocation_cleanup_psa_crypto_rsa-development
Fix: Memory allocation cleanup in internal crypto api functions
2024-08-19 15:50:37 +01:00
Elena Uziunaite
16f0e18e41 Update ChangeLog
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-19 12:12:34 +01:00
Janos Follath
ddc080073c
Merge pull request #9462 from waleed-elmelegy-arm/add-psa_key_agreement
Add psa_key_agreement() API
2024-08-19 08:05:15 +00:00
Elena Uziunaite
f48bfb00bd Add test cases for extKeyUsage
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-16 17:24:44 +01:00
Elena Uziunaite
6a04b168b2 Rationalize extKeyUsage tests
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-16 17:24:34 +01:00
Manuel Pégourié-Gonnard
aeda1fd0a8 Use P_CLI when O_CLI's status is not reliable
Generally speaking, in this group of test we use O_SRV when testing our
client's behaviour, and O_CLI when testing our server's behaviour. I
don't think that's essential, but why not.

Well, for these two tests there's a reason why not: O_CLI often exits 0,
seemingly not minding that the server aborted the handshake with a fatal
alert, but sometimes it exits 1. (I've observed 0 on my machine, on two
runs of OpenCI and Internal CI, and 1 in some test in one run of
Internal CI.)

So, use our client instead, which exits non-zero consistently.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:24:26 +01:00
Manuel Pégourié-Gonnard
19d6d3421c Rationalize keyUsage testing, round 2
- cli-auth 1.2 was missing a test with an irrelevant bit set in addition
to the relevant bit (which was added for 1.3 previously)
- use consistent naming for fail (hard/soft)

Note: currently there are no "fail (soft)" cases for 1.3 authentication
of server by client, as server auth is mandatory in 1.3 (this will
change in 3.6.1).

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:24:16 +01:00
Manuel Pégourié-Gonnard
92a391e0fe Always print detailed cert errors in test programs
Previously the client was only printing them on handshake success, and
the server was printing them on success and some but not all failures.

This makes ssl-opt.sh more consistent as we can always check for the
presence of the expected message in the output, regardless of whether
the failure is hard or soft.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:24:05 +01:00
Manuel Pégourié-Gonnard
4956e32538 Fix 1.3 failure to update flags for (ext)KeyUsage
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:23:47 +01:00
Manuel Pégourié-Gonnard
5a4c8f0ba0 Rationalize ssl-opt tests for keyUsage
- consistent naming with explicit version
- in each section, have a positive case with just the needed bit set,
and one with an irrelevant bit set in addition (cli 1.3 only had the
former, and cli-auth 1.3 only the later)
- when auth_mode optional is supported failing cases should come in
pairs: soft+hard, this wasn't the case for cli-auth 1.3. (Note: cli 1.3
currently does not support auth_mode optional.)
- failing cases should check that the correct flag is printed and the
expected alert is sent.

The last (two) points have uncovered a bug in 1.3 code:
- In fail (hard) cases the correct alert isn't send, but a more generic
one instead.
- In fail (soft) cases the issue with the certificate is not reported,
actually the certificate is reported as valid.

Both share the same root cause: the flags are not updated properly when
checking the keyUsage extension. This will be addressed in future
commits.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:23:40 +01:00
Manuel Pégourié-Gonnard
8e70c2bcd9 Test cert alert KEY_USAGE -> UNSUPPORTED_CERT
In terms of line coverage, this was covered, except we never checked the
behaviour was as intended.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:23:31 +01:00
Sam Berry
2547cd3535 Free allocated memory where methods were returning
without freeing

Signed-off-by: Sam Berry <sam.berry@arm.com>
2024-08-16 16:38:34 +01:00
Waleed Elmelegy
e25cb1bcda Fix formatting issue in psa_key_agreement() documentation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-16 14:37:46 +01:00
Waleed Elmelegy
d1562407c3 Fix possible issues in testing and implementation of psa_key_agreement()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-16 14:37:46 +01:00
Waleed Elmelegy
8faeee24ae Improve documentation of psa_key_agreement()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-16 14:37:46 +01:00
Waleed Elmelegy
cb0ed88df1 Add change log entry for adding psa_key_agreement() API
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-16 14:37:46 +01:00
Waleed Elmelegy
bdf2c98a27 Add psa_key_agreement() API
Add psa_key_agreement() API and basic testing.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-16 14:36:47 +01:00
Janos Follath
659f9e78fd
Merge pull request #9441 from paul-elliott-arm/add_docs_iop_key_generation
Add documentation for interruptible ECC key generation
2024-08-16 08:34:24 +00:00
Janos Follath
9e088847ae Clarify IOP key generation restriction
Public keys can't be generated.

Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 13:51:05 +01:00
Janos Follath
9f48917b88 Improve IOP documentation
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 13:51:05 +01:00
Janos Follath
7311600fd5 Constrain interruptible key generation to key-pairs
Erroring on a symmetric-key type would actually be an extra line of
code.

In theory we could try to save that one line of code, but it is
premature optimisation at this point. Also, this is a predominantly
asymmetric crypto feature, it is less confusing/more user friendly if we
don't allow symmetric keys here.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 13:51:05 +01:00
Janos Follath
211ebb51da Don't return success on a stub
We shouldn't return PSA_SUCCESS from a function that isn't implemented.
PSA_ERROR_NOT_SUPPORTED seems like the most appropriate return status
for a function that isn't implemented.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 13:51:05 +01:00
Paul Elliott
2dc5fa3a19 Add generated files for new iop key generation funcs
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-15 13:51:05 +01:00
Paul Elliott
0c1aa4af38 Add psa_generate_key_iop_abort() documentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-15 13:51:04 +01:00
Paul Elliott
08afb00a9b Add psa_generate_key_iop_complete() documentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-15 13:51:04 +01:00
Paul Elliott
6044f3e444 Add psa_generate_key_iop_setup() documentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-15 13:51:04 +01:00
Paul Elliott
f712452a0e Add psa_generate_key_iop_get_num_ops() docs
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-15 13:51:04 +01:00
Paul Elliott
9e143a73ea Add psa_generate_key_iop_t structs and docs
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 13:50:52 +01:00