Commit Graph

131 Commits

Author SHA1 Message Date
Gilles Peskine
f0a9721c18 Use GitHub-compatible table formatting
Also fix a stray `.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-26 10:31:32 +01:00
Gilles Peskine
662deb38d6
Merge pull request #3547 from ronald-cron-arm/psa-openless
Openless PSA crypto APIs implementation
2020-11-20 18:48:33 +01:00
Gilles Peskine
406a5da4ab
Merge pull request #3697 from gilles-peskine-arm/psa-conditional-inclusion-c-project
PSA C configuration: more concrete information
2020-11-19 13:28:10 +01:00
Gilles Peskine
43818f8614 Copyediting
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-19 11:24:11 +01:00
Gilles Peskine
d8c27ccab0 Fix copypasta; minor wording improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-16 21:44:23 +01:00
Gilles Peskine
bb483f6af8 Improve explanations around config_psa.h
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-16 14:35:12 +01:00
Gilles Peskine
198024cd02 Note that application code needs PSA_WANT_xxx too
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-16 12:04:40 +01:00
Gilles Peskine
1b1f3fb96d Minor clarifications
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-16 12:02:01 +01:00
Gilles Peskine
9e069070de Fix typos
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-16 10:26:01 +01:00
Gilles Peskine
993c249242 Add a section explaining the uses of PSA_WANT_xxx
PSA_WANT_xxx is useful regardless of how the symbols are defined:
explicitly (with MBEDTLS_PSA_CRYPTO_CONFIG) or implicitly (without
MBEDTLS_PSA_CRYPTO_CONFIG).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-13 22:45:13 +01:00
Gilles Peskine
b2679984d9 Note that crypto_sizes.h needs config_psa.h as well
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-13 22:37:19 +01:00
Ronald Cron
cf56a0a320 psa: Move from key handle to key identifier
Move all the PSA crypto APIs using key handles
to use key identifiers but psa_key_open() and
psa_key_close(). This is done without modifying
any test as key handles and key identifiers are
now the same.

Update the library modules using PSA crypto APIs
to get rid of key handles.

Programs and unit tests are updated to not use
key handles in subsequent commits, not in this
one.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2020-11-10 16:00:41 +01:00
Gilles Peskine
7b5e6b9dcc Typos and clarifications
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-04 18:30:01 +01:00
Torstein Nesse
d9246559ca Update changelog entry, format specification, and correct test vectors
Signed-off-by: Torstein Nesse <torstein.nesse@silabs.com>
2020-10-21 11:17:09 +02:00
Gilles Peskine
48584b589f Editorial fixes
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-10-13 19:07:02 +02:00
Gilles Peskine
55687646c8 PSA_WANT_xxx needs to be defined in the old-style config mechanism
Without MBEDTLS_PSA_CRYPTO_CONFIG, PSA_WANT_xxx needs to be defined,
for the sake of code that calls the PSA API (TLS code, tests, sample
apps).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-10-12 23:23:52 +02:00
Torstein Nesse
162a1104be Changes PSA key storage format to include key bits
* Stores bits in psa_persistent_key_storage_format.
* psa_load_persistent_key_into_slot still imports plaintext keys which
  ensures that the bits value gets set.
* Updates key specification to match new implementation.
* Expands persistent store and load tests with to check for bits
  attribute.
* Removes bits storage from psa_se_key_data_storage_t.

Signed-off-by: Torstein Nesse <torstein.nesse@silabs.com>
2020-10-07 10:54:24 +02:00
Gilles Peskine
95434380e1 Detailed architecture of symbol definitions and header inclusion
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-09-21 20:08:51 +02:00
Gilles Peskine
5cb54f7b27
Merge pull request #3542 from gilles-peskine-arm/psa-unified-driver-specs-20200807
PSA unified driver specification: minor updates
2020-09-18 22:53:46 +02:00
Janos Follath
2a25904f45
Merge pull request #3568 from hanno-arm/tls13_experimental_key_schedule_1
TLS 1.3: Add HKDF-based key derivation functionality
2020-09-16 11:40:06 +01:00
Gilles Peskine
dc57c25e30
Merge pull request #3527 from ronald-cron-arm/key-extended-id
PSA key identifiers rework
2020-09-15 16:06:06 +02:00
Hanno Becker
b11c3097a5 Update state of TLS 1.3 functionality in architecture document
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-08 10:28:29 +01:00
Gilles Peskine
34b07e7f25 Add a subsection with driver interface terminology
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-09-07 10:28:38 +02:00
Gilles Peskine
6cf4ab8f2f Fix formatting glitch
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-09-07 09:43:16 +02:00
Ronald Cron
71016a9ea7 psa: Rename psa_key_file_id_t to mbedtls_svc_key_id_t
With PSA crypto v1.0.0, a volatile key identifier may
contain a owner identifier but no file is associated
to it. Thus rename the type psa_key_file_id_t to
mbedtls_svc_key_id_t to avoid a direct link with a
file when a key identifier involves an owner
identifier.

The new type name is prefixed by mbedtls to highlight
that the type is specific to Mbed TLS implementation
and not defined in the PSA Cryptography API
specification.

The svc in the type name stands for service as this
is the key identifier type from the point of view of
the service providing the Cryptography services.
The service can be completely provided by the present
library or partially in case of a multi-client service.

As a consequence rename as well:
. MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER to
  MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
. PSA_KEY_ID_INIT to MBEDTLS_SVC_KEY_ID_INIT
. PSA_KEY_FILE_GET_KEY_ID to MBEDTLS_SVC_KEY_ID_GET_KEY_ID
. psa_key_file_id_make to mbedtls_svc_key_id_make

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2020-09-02 14:27:07 +02:00
Gilles Peskine
2e4062ce17 First go at describing how this can be implemented
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-31 15:41:54 +02:00
Gilles Peskine
54a0ad2012 Note the limitation that you can't exclude multipart support
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-31 15:41:29 +02:00
Gilles Peskine
dbd2e3c43f Nicer time stamp format
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-31 15:41:10 +02:00
Gilles Peskine
b51f96a7bf Pure C configuration of PSA crypto mechanisms
Proposed specification for conditional inclusion of cryptographic
mechanism through the PSA API in Mbed TLS.

The inclusion of a mechanism is based on a declaration of boolean
symbols by the application. There is a symbol for each key type or
parametrized key type constructor, and for each algorithm or
parametrized algorithm constructor.

This is work in progress, presented for a first design discussion.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-31 14:45:51 +02:00
Gilles Peskine
ef9874d11a Update terminology
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-19 21:55:27 +02:00
Gilles Peskine
5298f684bd Fix hyperlinks
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-19 21:53:59 +02:00
Gilles Peskine
2e843aeb3e Update some open questions
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-19 21:43:59 +02:00
Gilles Peskine
0dfd10d2a2 Copyediting
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-19 21:41:27 +02:00
Gilles Peskine
daf017c8a2 Allow algorithm policy wildcards as algorithm specifications
I'd intended this all along but never made it explicit.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-07 23:40:53 +02:00
Gilles Peskine
d89cd742eb Specify that transparent drivers are considered in order
There is little point in leaving the order in which drivers are
considered unspecified. This gives flexibility to the implementation
for a process that is generally performed at build time, not in a
constrained environment. Having a well-defined order is especially
useful with fallback.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-07 23:37:55 +02:00
Gilles Peskine
91cbf56d4c Specify what happens if multiple capabilities apply
It's ok if they map to the same function names and an error otherwise.

It's an error to have multiple opaque drivers for the same location.

If multiple transparent drivers apply, which one applies is unspecified.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-07 23:30:16 +02:00
Gilles Peskine
c7cf13356c Define the semantics of capabilities
The existing description of the syntax of capabilities also describes
the semantics of each property, but the semantics of the capability as
a whole is not immediately clear. Add a subsection that explains
precisely when a capability is applicable.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-07 23:24:00 +02:00
Gilles Peskine
1bc9c4c8c8 Make entry points mandatory in capabilities
Inferring entry points from algorithms is nice in that it makes
capability specifications shorter and less redundant, but that's not
really important. It also makes capabilities more fragile: if the core
starts supporting new mechanisms based on the same algorithm (for
example, adding hash-and-sign when only sign-the-hash existed before),
a driver only supporting the old mechanisms would fail at build time.
So make entry points mandatory.

This has the benefit of making the semantics of capabilities easier to
describe.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-07 22:47:15 +02:00
Gilles Peskine
924e273b06 Change "functions" property to "entry_points"
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-07 13:53:16 +02:00
Gilles Peskine
c259213a01 More editorial corrections
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-07 13:52:43 +02:00
Gilles Peskine
15319454e6 Reword the explanation of fallback
Add the rationale which I'd accidentally omitted.

No intended meaning change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-06 22:49:54 +02:00
Gilles Peskine
85b3e13cd0 Introduce "acme" as the prefix each time it's used
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-06 22:20:33 +02:00
Gilles Peskine
daf9d82b75 Correct usage of key_derivation_output_key
Add the mention of key_derivation_output_key in the section about the
key derivation entry point family.

Rename "derive_key" to "key_derivation_output_key". At this point,
there's no reason to deviate from the naming convention.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-06 22:20:33 +02:00
Gilles Peskine
a58d225d62 Add deep links to the API specification in a few places
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-06 22:20:33 +02:00
Gilles Peskine
d4e6927614 Change "function" to "entry point" in more places
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-06 22:20:33 +02:00
Gilles Peskine
53ba94c968 Clarify how the headers are used
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-06 22:20:33 +02:00
Gilles Peskine
e72e4de070 Clarify what the headers do
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-06 22:20:33 +02:00
Gilles Peskine
7a1e4f926a Minor wording improvements
Clarify some sentences. There is no change in intended meaning.

Fix typos. Change British spelling to American spelling.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-06 22:20:32 +02:00
danh-arm
0ca6d38bc3
Merge pull request #3493 from gilles-peskine-arm/psa-unified-driver-specs
PSA unified driver specification
2020-08-06 16:10:17 +01:00
Gilles Peskine
404e1dbd5a Clarify updates to the persistent state in storage
Rename psa_crypto_driver_update_persistent_state to
psa_crypto_driver_commit_persistent_state.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-05 22:37:29 +02:00