trussed-dev / trussed

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

Add OptionalBackend wrapper #158

Closed robin-nitrokey closed 5 months ago

robin-nitrokey commented 5 months ago

Backends can be activated at runtime depending on the configuration or execution environment. This patch adds an OptionalBackend wrapper that implements Backend and ExtensionImpl but returns a RequestNotAvailable error if the inner backend is not set.