Commit graph

239 commits

Author SHA1 Message Date
Hanno Becker
7594c68049 Document status of MPS upstreaming
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Gilles Peskine
2c5d9e6a32 No configuration symbols for FFDH
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-02-09 21:40:41 +01:00
Gilles Peskine
7df7d1eb57 ECC: add rationale
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-02-09 21:40:29 +01:00
Gilles Peskine
c74712f12d Fix an example that didn't follow the given pattern
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-02-09 21:40:02 +01:00
Gilles Peskine
59c6347810 Remove the time stamp
Time stamps are useful when the document gets shared around, but they
tend to lead to merge conflicts.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-02-09 21:39:13 +01:00
Ronald Cron
d9763466b7 Expand and improve psa-crypto-implementation-structure.md
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2021-02-02 11:49:14 +01:00
Ronald Cron
31520b4b1c Fix psa-crypto-implementation-structure.md
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2021-02-02 11:38:50 +01:00
Ronald Cron
0dbbf1e27f psa: Add architecture document
Add architecture document explaining how this
PR aim to restructure the PSA implementation (only
part of it) and why.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2021-02-02 11:29:07 +01:00
Ronald Cron
ac80be111b
Merge pull request #3878 from gilles-peskine-arm/psa-builtin-keys-via-slot-number-spec
New entry point get_builtin_key for opaque drivers (PSA spec)
2021-01-29 10:43:15 +01:00
Ronald Cron
318515b384
Merge pull request #3984 from gabor-mezei-arm/3268_update_macros_for_ouput_buffer_size_renames
Rename existing support macros for output buffer sizes for PSA Crypto API 1.0.0
2021-01-29 09:31:59 +01:00
Ronald Cron
a120146afe
Merge pull request #3962 from gilles-peskine-arm/psa-storage-format-test-strategy
Keystore format stability test strategy
2021-01-25 16:44:23 +01:00
Gilles Peskine
055be83413 Fix typo
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-01-25 11:36:24 +01:00
gabor-mezei-arm
cbcec21684
Rename output buffer size macros
Rename existing support macros for output buffer sizes for PSA Crypto API 1.0.0

Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
2021-01-21 13:17:25 +01:00
Gilles Peskine
84ae1eefb4 Minor clarification
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-01-20 20:20:10 +01:00
Gilles Peskine
3d67365ef7 Add a key_buffer_length output to "get_builtin_key"
While builtin keys will often have a fixed-size context, this is not
necessarily the case, so the "get_builtin_key" entry point needs to
return the size of the actual key context.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-01-20 20:19:14 +01:00
Gilles Peskine
ff457506d3 Remind the reader of what is done about old formats
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-01-19 14:25:20 +01:00
Gilles Peskine
697ee190b5 Add a section about non-default lifetimes
Alternative locations should be covered. We don't yet support
alternative persistence levels.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-01-18 23:38:21 +01:00
Gilles Peskine
528144f523 Clarify the methods of key storage testing
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-01-18 23:36:18 +01:00
Gilles Peskine
cf62f10d3f Clarify interoperability non-requirement
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-01-05 11:49:18 +01:00
Gilles Peskine
739e08a68d Keystore format stability test strategy
Initial revision.

Save-compare-load approach: the test case data contains attributes of
the object under test and the expected file content. Create the
object, save it, check that the file has the expected content, load
the file and check that the new object has the expected attributes.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-14 18:51:47 +01:00
Ronald Cron
8f05aeb2e3
Merge pull request #3882 from gilles-peskine-arm/psa-random-driver-spec
PSA: Specification for random generation and entropy drivers
2020-12-11 14:07:35 +01:00
Gilles Peskine
348eeebb24 Clarify the intent of the KEEPALIVE flag
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-11 10:52:36 +01:00
Manuel Pégourié-Gonnard
a27a4e2f18
Merge pull request #3929 from gilles-peskine-arm/psa-driver-remove-old-accel
Remove old proposed accelerator interfaces
2020-12-10 11:31:47 +01:00
Gilles Peskine
24cebf6671 Add a section for transparent drivers
No strategy yet, just state some basic requirements.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-08 15:19:04 +01:00
Gilles Peskine
f0e2853d46 Minimal update to mention unified-interface opaque drivers
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-08 15:19:04 +01:00
Gilles Peskine
ae7772d0f3 Clarifications around reseed_entropy_size
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:48:39 +01:00
Gilles Peskine
43100e3fcb Add section on combining get_entropy with add_entropy
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:48:29 +01:00
Gilles Peskine
32e584c38a Copyediting and minor clarifications
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:48:29 +01:00
Gilles Peskine
3ff79066b1 Note an interrogation about integer value representation
Especially 0 values may need special treatment since they can't be
used as an array size.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:48:29 +01:00
Gilles Peskine
6a530e8d26 Random driver: make initial_entropy_size mandatory
If a random driver has a built-in entropy source and doesn't need an
external entropy source, make the driver author declare this
explicitly, rather than it being a less secure default.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:48:22 +01:00
Gilles Peskine
ee914f34fa Minor clarifications
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:48:14 +01:00
Gilles Peskine
609394c1cf Open question: can there be multiple RNG instances?
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:48:06 +01:00
Gilles Peskine
8d5092c11f get_random: no output on error
The get_random entry point was allowed to return partial data on both
PSA_SUCCESS and PSA_ERROR_INSUFFICIENT_ENTROPY, but there was no
meaningful difference between the two. Keep it simple: PSA_SUCCESS is
success but can be partial, and PSA_ERROR_INSUFFICIENT_ENTROPY is an
error with no output.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:47:56 +01:00
Gilles Peskine
1ef6ad48d1 Note that I'm not completly sure about the get_entropy flags
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:47:45 +01:00
Gilles Peskine
3eb65fbba6 Open question: should add_entropy take an estimated_entropy_bits parameter?
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:47:45 +01:00
Gilles Peskine
b89b4b9025 get_entropy: recommendations on conditioning and entropy estimates
Explicitly recommend that the driver accounts for environmental
conditions that can affect the amount of entropy.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:47:36 +01:00
Gilles Peskine
05ab2646a3 get_entropy: recommendations on the output_size
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:47:36 +01:00
Gilles Peskine
a14326f054 Make add_entropy optional
A random generation driver does not need to support entropy injection.
This will limit it to platforms where the RNG peripheral is the sole
entropy source and without an RNG seed saved into persistent storage.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:47:27 +01:00
Gilles Peskine
390c5a2c6f It is not meaningful for reseed_entropy_size to be 0
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:47:19 +01:00
Gilles Peskine
0e3b7ced4c Don't require a call to add_entropy when 0 bytes are needed
If an RNG peripheral includes an entropy source, it would presumably
declare "initial_entropy_size" and "reseed_entropy_size" to be 0. In
this case, don't require the core to call "add_entropy".

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:47:10 +01:00
Gilles Peskine
5263e1ecdd Transparent drivers can have get_entropy as well
The `get_entropy` entry point can be provided by multiple transparent
drivers, and the core will call all of them. But apart from that,
`get_entropy` doesn't involve an opaque key or a location, so it can
be in a transparent driver.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:46:58 +01:00
Gilles Peskine
e80978a260 Specification for random generation and entropy drivers
Transparent drivers may provide a DRBG interface through "add_entropy"
and "get_random" entry points. This interface may also be used with a
non-deterministic generator, for chips that include a TRNG.

Opaque driver may provide a "get_entropy" entry point.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:46:42 +01:00
Gilles Peskine
1fc4c8d11b Let get_builtin_key be called to retrieve the key's attributes
Allow the core to call the "get_builtin_key" entry point to retrieve
the attributes of a built-in key. This is useful to implement
psa_get_key_attributes(), and also when the key data buffer's size
depends on the key type and size.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 18:41:50 +01:00
Gilles Peskine
a6454d2820 Minor clarifications
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 17:01:52 +01:00
Gilles Peskine
48d71f2aa4 New entry point get_builtin_key for opaque drivers
Allow opaque drivers to expose keys that were not created through the
PSA API.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 17:01:37 +01:00
Gilles Peskine
51977355dc Remove the time stamp
Having a time stamp identifying each revision of the document is
useful, but it's also a pain because it creates a conflict whenever
there are multiple pending changes at the same time. The gain isn't
worth the pain, so I'm removing the time stamp.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 17:01:17 +01:00
Gilles Peskine
db6b03b4f2 Remove old-style accelerator and entropy driver interfaces
The driver interfaces described in crypto_accel_driver.h and
crypto_entropy_driver.h are no longer being worked on. We do not
intend to finish the design of these interfaces or to implement them
in Mbed TLS. They have been superseded by the unified driver
interface (docs/proposed/psa-driver-interface.md), which is being
actively worked on both to finalize the specification and to implement
it in Mbed TLS.

The partially implemented dynamic secure element interface is staying
for now.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-30 17:37:14 +01:00
Gilles Peskine
e533ff7bb7
Merge pull request #3695 from gilles-peskine-arm/psa-unified-driver-specs-20200918
PSA unified driver specification: key validation and transparent key import
2020-11-30 15:54:45 +01:00
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
4228671d0f Copyediting
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-24 13:11:31 +01:00
Gilles Peskine
99e52f6313 Clarifications around key import
Rework the section describing key import, in particular to clarify key
size determination and checking. There is no intended semantic change.

Note an open question around support for implementation-specific
import formats.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-24 13:11:31 +01:00
Gilles Peskine
28b3a946e9 Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-24 13:08:30 +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
Gilles Peskine
ce3ec6ffd6 Unify the sections on key creation
Now that transparent drivers have an "import_key" entry point, the key
creation interfaces for transparent drivers and opaque drivers are
very similar. Unify the sections that describe their behavior,
including key validation and key size determination.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-10-27 18:31:50 +01:00
Gilles Peskine
12760595e7 Replace validate_key by import_key
When importing a transparent key, the key needs to be not only
validated, but also possibly converted, if it is not already in the
canonical representation. So change the validate_key entry point to an
import_key entry point.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-10-26 18:07: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
e4cbb2bb73 Minor clarifications
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-10-12 23:39:18 +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
233f91d5c1 Add bits output to validate_key and import_key
When importing a key, the code that parses the input needs to
determine the key size ("bits" attribute). This is specific to import
since other key creation methods require the caller to supply a size.
Therefore, add an extra output parameter `bits` to the "import_key"
entry point for opaque drivers. Likewise, add a `bits` output
parameter to the "validate_key" entry point for transparent drivers.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-10-02 18:00:00 +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
a8fc171418 Add validate_key entry point
Validate transparent keys when they are imported.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-09-21 13:54:00 +02:00
Gilles Peskine
27e69b59a5 Fix prototypes of opaque key creation entry points
The output length parameter was missing.

Reported by Steven Cooreman.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-09-19 00:35:27 +02:00
Gilles Peskine
22270b5048 Fix copypasta punctuation in some function prototypes
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-09-19 00:35:07 +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