Commit graph

824 commits

Author SHA1 Message Date
Gilles Peskine
951cf39b3f Corrections and clarifications around asymmetric key formats
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-30 14:01:20 +01:00
Gilles Peskine
4d234f1ede Editorial corrections
Fix typos, copypasta, and other minor clarifications.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-30 13:59:49 +01:00
Gilles Peskine
396a2a3dcb Explain interruptible operations
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-30 11:02:06 +01:00
Gilles Peskine
d96aa1b5cd Say who to contact
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-29 21:13:02 +01:00
Gilles Peskine
dfe6707fc7 Fix typos and make minor style improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-29 21:12:39 +01:00
Gilles Peskine
d372da6201 Expand on the removal of RNG boilerplate
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-28 18:03:53 +01:00
Gilles Peskine
601d3a0bd7 Add links to newly added functions
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-28 18:03:16 +01:00
Gilles Peskine
5403cb340a typos
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-28 18:03:03 +01:00
Gilles Peskine
677285a299 Clarify "functions that facilitate the transition"
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-28 16:45:50 +01:00
Dave Rodgman
16799db69a update headers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-02 19:47:20 +00:00
Tom Cosgrove
6dcb63bc6d Fix broken link to psa-driver-example-and-guide in psa-driver-wrappers-codegen-migration-guide.md
Fixes #8453

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-10-31 15:39:25 +00:00
Manuel Pégourié-Gonnard
4823d2c94e Extend design discussion
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-10-26 12:56:39 +02:00
Janos Follath
a365efc6f1 Threading design: fix internal links
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-26 10:22:55 +01:00
Manuel Pégourié-Gonnard
6b3643117b Document chosen goals and priorities for 3.x
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-10-26 11:02:17 +02:00
Manuel Pégourié-Gonnard
3bcda449c0 Things forgotten in the previous commit
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-10-26 10:03:49 +02:00
Janos Follath
54bd71b40f Update operation threading strategy
The library does not need to provide protection, leave it to the crypto
service.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-23 10:30:50 +01:00
Janos Follath
e604269a59 Threading Design: emphasise performance requirement
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-23 10:16:58 +01:00
Janos Follath
23f7e41633
Threading design: improve language
Co-authored-by: Paul Elliott <62069445+paul-elliott-arm@users.noreply.github.com>
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-23 10:11:18 +01:00
Janos Follath
49d467c37d Threading design: update and clarify 3.6 plan
- Separation of attr and slot state is added
- Driver support is cut back

Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-20 15:41:40 +01:00
Janos Follath
de0e3e352d Threading design: Update empty slot tracking
Using a dedicated field allows clean separatin between key attributes
and slot state. This allows us to use the same mechanics for attributes
and key content. Which in turn means lower code size and easier
maintenance.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-20 15:12:42 +01:00
Janos Follath
52586895f7 Clarify threading design document structure
Separate design analysis from plans and make the distinction clear
between what is implemented, what is planned to be implemented soon,
what is planned to be implemented in the future, and what is ideas that
are rejected.

(The distinction between the last two categories doesn't have to be
clear, we can't and shouldn't plan that far ahead.)

Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-20 14:26:57 +01:00
Janos Follath
19192a5158 Clarify reentrancy requirements for drivers
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-20 13:16:48 +01:00
Janos Follath
d7a39ae21e Add plan for 3.6 to threading design
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-17 14:34:26 +01:00
Janos Follath
574100bb0d Add clarifications to thread safety design
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-17 12:50:28 +01:00
Janos Follath
811a954383 Add reentrancy section to thread safety design
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-17 12:50:21 +01:00
Manuel Pégourié-Gonnard
f1878d8974 Update to only serve GCM and CCM
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-10-12 11:19:00 +02:00
Janos Follath
28b4da954b Add PSA threading design
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-10 15:15:55 +01:00
Manuel Pégourié-Gonnard
301d2a29a7 Update to MD light section
Mostly to reflect this has been implemented, and remove references to
temporary remains from the previous strategy (hash_info, legacy_or_psa)
which would probably be more confusing than helpful at this point.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-10-10 10:04:07 +02:00
Manuel Pégourié-Gonnard
2daee0410e Update list of modules using hashes
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-10-10 10:04:07 +02:00
Manuel Pégourié-Gonnard
ca18b7747e Update definition of Cipher light
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-10-10 10:04:07 +02:00
Manuel Pégourié-Gonnard
839d3580bd Update details of modules using cipher operations
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-10-10 09:22:59 +02:00
Gilles Peskine
32743619a2
Merge pull request #8114 from yanesca/threading_requirements_update
Refine thread safety requirements
2023-10-09 11:22:59 +00:00
Manuel Pégourié-Gonnard
8c40f3dfad Formatting fixes
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-28 11:06:09 +02:00
Manuel Pégourié-Gonnard
140c08e325 Minor clarifications.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-28 11:02:37 +02:00
Manuel Pégourié-Gonnard
89ae266e5a Update docs/driver-only-builds.md
Latest changes:
- logic about the relationship between curves, key types and algs (8075)
- building without bignum is no longer "coming soon", it's there :)

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-28 08:53:05 +02:00
Manuel Pégourié-Gonnard
dfa42b34ab Improve documentation about driver-only p256-m.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-28 08:53:05 +02:00
Manuel Pégourié-Gonnard
789000b2be Update list of p256-m entry points
There was a bit of a race condition between #8041 which introduced the
new entry points, and #8203 which documented the list of entry points.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-28 08:51:51 +02:00
Dave Rodgman
0fc86b2ddf
Merge pull request #8075 from valeriosetti/issue8016
driver-only ECC: curve acceleration macros
2023-09-27 14:39:02 +00:00
Manuel Pégourié-Gonnard
f7dc6cfef1 Document limitation on "mixed" builds
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-27 10:34:52 +02:00
Xiaokang Qian
db3035b8bc Fix a typo in psa-crypto-implementation-structure.md
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2023-09-26 09:09:20 +00:00
Xiaokang Qian
76e55a20dd Change the documenti about psa_crypto_driver_wrappers.c{h}
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2023-09-26 09:09:20 +00:00
Xiaokang Qian
1198e43644 Change the description of auto-generated driver dispatch files
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2023-09-26 09:09:20 +00:00
Xiaokang Qian
845693c513 Change comments to psa_crypto_driver_wrappers.h
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2023-09-26 09:09:20 +00:00
Manuel Pégourié-Gonnard
030f11b0b1 Type fixes and wording improvements
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-24 09:48:47 +02:00
Manuel Pégourié-Gonnard
1f61b7b8ea Document driver-only hashes
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-24 09:48:46 +02:00
Gilles Peskine
efaee9a299 Give a production-sounding name to the p256m option
Now that p256-m is officially a production feature and not just an example,
give it a more suitable name.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-20 20:49:47 +02:00
Gilles Peskine
452beb9076
Merge pull request #8203 from gilles-peskine-arm/p256-m-production
Declare p256-m as ready for production
2023-09-20 09:36:05 +00:00
Paul Elliott
3d0bffb257 Improve statement in driver-only-builds.md
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-09-13 15:15:37 +01:00
Gilles Peskine
6f784dff49 Reflect the fact p256-m has been integrated into Mbed TLS
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-13 15:32:30 +02:00
Valerio Setti
7373a6644d driver-only-builds.md: fix text
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-09-04 16:16:11 +02:00
Janos Follath
b4527fbd82 Add clarifications to the threading requirements
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-08-31 14:01:24 +01:00
Janos Follath
b6954730f0
Fix typo
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-08-31 13:54:21 +01:00
Janos Follath
35633dd977 Add threading non-requirement
State explicitly the non-requirement that it's ok for psa_destroy_key to
block waiting for a driver.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-08-31 08:31:19 +01:00
Janos Follath
15d9ec29be Improve thread safety presentation
- Use unique section titles so that there are unique anchors
- Make list style consistent between similar sections

Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-08-31 08:22:21 +01:00
Janos Follath
0385c2815c Tighten thread safety requirements
We shouldn't violate the requirement that the key identifier can be
reused. In practice, a key manager may destroy a key that's in use by
another process, and the privileged world containing the key manager and
the crypto service should not be perturbed by an unprivileged process.

With respect to blocking, again, a key manager should not be blocked
indefinitely by an unprivileged application.

These are desirable properties even in the short term.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-08-30 16:44:04 +01:00
Janos Follath
7ec993d804 Refine thread safety requirements
Split and refine short term requirements for key deletion.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-08-23 16:04:48 +01:00
Valerio Setti
d31b28485b driver-only-builds: update EC and FFDH sections
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-08-17 12:36:40 +02:00
Manuel Pégourié-Gonnard
36cd3f9f8e Add tentative definition of Cipher light
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-08-11 10:06:42 +02:00
Manuel Pégourié-Gonnard
948137be59 Add details on use of ciphers from other modules
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-08-10 16:58:30 +02:00
Gilles Peskine
33291ba35f
Merge pull request #5538 from gilles-peskine-arm/psa-thread_safety-doc
PSA thread safety requirements
2023-08-10 16:21:55 +02:00
Manuel Pégourié-Gonnard
0b6d021069 Adjust presence of warning/link.
- the codegen migration document is already a migration document, so
doesn't need the extra warning about work in progress;
- the driver interface can use a link to the more practical guide too.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-08-08 09:37:11 +02:00
Gilles Peskine
9aa93c8e78 Added a note about new primitives for secure destruction
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-07 16:32:09 +02:00
Gilles Peskine
584bf985f5 Elaborate on psa_destroy_key requirements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-07 16:29:19 +02:00
Manuel Pégourié-Gonnard
de24ba6cfd Add link to examples in relevant places
Some documents about driver describe a state of things that is ahead of
the reality. They already contain a warning about it, but no way to know
that the current reality is; add a pointer to a document that describes
it.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-08-07 11:36:14 +02:00
Manuel Pégourié-Gonnard
b61484947a Fix error in the guide to drivers
There is no export_key entry point for transparent drivers.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-08-07 11:32:51 +02:00
Gilles Peskine
d3a797710a psa_is_key_slot_occupied: change to using the key identifier
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-02 18:36:06 +02:00
Valerio Setti
ab02d391cb test: use only rev-parse for getting the current branch
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-07-31 16:47:07 +02:00
Valerio Setti
ccb0344969 test: add GIT alternative commands for older GIT versions
The Docker container used for the CI has Git version 2.7.4 which
does not support the "git branch --show-current" command since this
was added in version 2.22.
Therefore this commit adds an alternative version for old Git versions.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-07-31 15:07:49 +02:00
Manuel Pégourié-Gonnard
1c739ec277
Merge pull request #7900 from mpg/doc-driver-only
ECPf wrap-up
2023-07-26 10:25:54 +02:00
Manuel Pégourié-Gonnard
fb22c27f1d Misc wording fixes and improvements
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-07-18 10:40:56 +02:00
Manuel Pégourié-Gonnard
1937cf8143 Improve wording & fix a typo
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-07-11 11:14:15 +02:00
Manuel Pégourié-Gonnard
c97775162e Fix inaccurate information about FFDH
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-07-11 11:11:20 +02:00
Dave Rodgman
e183ecef3d
Merge pull request #7136 from yanrayw/5692-record-compatsh-test-cases
Record the outcome of each test case in compat.sh
2023-07-10 12:08:32 +01:00
Manuel Pégourié-Gonnard
7a82e27a10 Add documentation on driver-only ECC
Just one part left for later.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-07-07 17:09:14 +02:00
Manuel Pégourié-Gonnard
6d5f4946e6 Add docs/driver-only-builds.md
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-07-07 17:09:14 +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
Gilles Peskine
909cf5a3ec Show how to extract curve information from an ecp_keypair
It's not pretty.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-20 23:38:39 +02:00
Gilles Peskine
603f0fca6e The ECP curve name is the one from TLS, not one we made up
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-20 23:38:21 +02:00
Manuel Pégourié-Gonnard
417ce2c574 Rename _USE to _BASIC
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-06-16 10:36:44 +02:00
Gilles Peskine
379ff8754d Cover ecp.h
Also correct some statements about rsa/ecp/pk check functions.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-15 21:15:21 +02:00
Gilles Peskine
f75e65d90b Rename PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_USE to ..._BASIC
per https://github.com/Mbed-TLS/mbedtls/issues/7439#issuecomment-1592673401
and https://github.com/Mbed-TLS/mbedtls/pull/7774#discussion_r1230658660

State that EXPORT implies BASIC.

Also fix missing `WANT_` parts.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-15 18:39:14 +02:00
Gilles Peskine
5bd4f17e4e Cover ECDH and DHM
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-15 18:33:30 +02:00
Gilles Peskine
b33d0ac532 Mention self-tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-15 18:33:15 +02:00
Manuel Pégourié-Gonnard
1cae90bf50 Update PSA_WANT spec for new KEY_PAIR scheme
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-06-14 12:19:13 +02:00
Gilles Peskine
c7b53f3ab7 Mention mbedtls_psa_get_random
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-13 21:31:53 +02:00
Gilles Peskine
34a201774e More about whether to have the driver key id in the transaction list
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-13 21:11:43 +02:00
Gilles Peskine
009c06b973 Discuss the cost of a get_key_attributes entry point
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-13 21:11:43 +02:00
Gilles Peskine
5ad8ca2a5f Legacy-to-PSA transition guide
Covers most modules, but missing most of ecp, ecdh and dhm.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-13 19:52:31 +02:00
Gilles Peskine
265ce7c1da
Merge pull request #5451 from gilles-peskine-arm/psa-driver-kdf-spec
PSA drivers: specification for key derivation
2023-06-06 11:37:28 +02:00
Gilles Peskine
f4ba0013e2 Clarify when key derivation entry points are mandatory/permitted
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-05 14:24:14 +02:00
Gilles Peskine
8dd1e623e1 Copyediting
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-05 14:14:41 +02:00
Gilles Peskine
7df8ba6a10 Rework the description of key derivation output/verify key
Some of the fallback mechanisms between the entry points were not described
corrrectly.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-02 18:16:02 +02:00
Gilles Peskine
dcaf104eef Note that we may want to rename derive_key
... if we think of a better name

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-02 18:02:41 +02:00
Gilles Peskine
f96a18edc7 Probably resolve concern about the input size for derive_key
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-02 18:02:15 +02:00
Gilles Peskine
1414bc34b9 Minor copyediting
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-06-02 17:54:32 +02:00
Gilles Peskine
24f52296f1 Key agreement needs an attribute structure for our key
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-05-31 00:44:04 +02:00
Gilles Peskine
e52bff994c Note possible issue with derive_key: who should choose the input length?
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-05-31 00:43:29 +02:00
Gilles Peskine
b319ed69c4 State explicitly that cooked key derivation uses the export format
This is the case for all key creation in a secure element, but state it
explicitly where relevant.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-05-31 00:42:45 +02:00
Gilles Peskine
f787879a14 Clarify sequencing of long inputs
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-05-31 00:42:29 +02:00
Gilles Peskine
d2fe1d5498 Rationale on key derivation inputs and buffer ownership
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-05-31 00:42:17 +02:00