Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We already have feature flags for some clients and syscalls that are not used in the Nitrokey 3 firmware. This PR introduces feature flags for all client traits and also puts the request and reply types behind these feature flags. In detail:
trussed-core
andtrussed
as well as anall-clients
feature fortrussed
. Applications are encouraged to depend ontrussed-core
and only activate the features they need.PollClient
. The types used in these structs are always available to keep things simple and as they can be easily optimized out by the compiler or linker.CryptoClient::attest
into a separateAttestClient
(or maybeAttestationClient
?). Putting trait methods behind a feature flag is problematic because it means that the feature is non-additive. As we already have the client trait mechanism to separate feature sets and make them optional, we can also use it for attestation.Client
enum with anALL
constant. This makes it possible for backends to use const assertions to ensure that all required features are activated. I don’t think we will use this much, but I added it for completeness. This will be more important for mechanisms and is a much nicer solution than what we discussed before (Improve mechanism features #159).