trussed-dev / trussed

Modern Cryptographic Firmware
https://trussed.dev
Apache License 2.0
405 stars 26 forks source link

Put unused syscalls behind features #143

Closed robin-nitrokey closed 9 months ago

robin-nitrokey commented 9 months ago

CounterClient and CryptoClient::attest are not currently used by the solo2 or nk3 firmwares, but due to the indirect dispatch of Trussed requests, they cannot be optimized out by the linker. This patch introduces feature flags for these syscalls that are enabled by default.

sosthene-nitrokey commented 9 months ago

Tests need the feature flags too

robin-nitrokey commented 9 months ago

I’ve added the feature flags to the default features and also explicitly added the counter-client requirement to the counter test.

robin-nitrokey commented 9 months ago

Argh, I think adding it to the default features is a problem for us: We would have to modify every dependency using Trussed to not select the default features. I don’t see a good way to solve this in upstream. Should we use a fork for the moment?

sosthene-nitrokey commented 9 months ago

I don't see a better solution