Open macpijan opened 1 year ago
Thank you for the input! I’ll try to give you some answers off the top of my head. We’ll have to take a closer look at some of these later.
Regarding RAM usage: In the future we want to have the different features (Trussed apps) configurable at run time so that each user can choose which feature she wants to activate or deactivate. This should give more flexibility to provide Fobnail sufficient RAM.
@robin-nitrokey Thanks for a quick response. We need to communicate with other applications to signal attestation state, so that those applications, e.g. fido-authenticator knows whether platform is trusted and allows only a trusted platform to log-in (if so was configured by the user).
I see. This is not possible at the moment but should be easy to implement as an extension – either with a generic extension providing a global state, or with a Fobnail extension (probably the better approach).
Implementing the standard crypto traits could be achieved with helper structs. Thinking about it a bit more, I’m not really sure how to approach it. If it only wraps the software implementation, there is no big benefit over using them directly. If it should integrate custom backends, it would be much harder to implement.
Regarding the HW crypto, do you have a plan which hardware to use? SE050?
Introduction and reasoning
From very high perspective, Fobnail project aims to develop software/firmware, which can run on some sort of device (likely USB device), which can be plugged in to the computer and perform local attestation of it's state (i.e.: detect whether the certain parts of the system has not been tampered with). Once this is in place, we may imagine more complex use-case scenarios, such us unsealing some secrets only when the system's state is considered trustworthy.
As Fobnail token (reference platform for the Fobnail application) was based on the nRF52840 dongle, and that it would be desirable to run this on some small device in general, it feels natural to consider integration of the Fobnail application as part of the security USB key, such as the NitroKey.
Some more technical details can be found in the documentation, such as:
Questions regarding the current state of the NitroKey firmware
As we consider integration of the Fobnail application on top of the NitroKey firmware, we figured out it would be optimal to ask here (where the firmware creators, and experts in this area are present) some specific questions that could help us to evaluate the feasibility of such effort.
How much RAM/flash is left unused on the device, when running the current NitroKey? We've had problems with stack usage on NRF52840, which could be a challenge to integrate Fobnail in the Nitrokey firmware, considering that even more features would be present at the same time.
What protocols does NitroKey use to communicate with applications running on PC? What applications are used for communication? Are those applications specific to Nitrokey or do they follow external standards? If you would point us to the most up-to-date source of information, that would be very helpful. Fobnail currently uses Fobnail API to communication with the host, and some form of host application is required. It could potentially be integrated into the existing solutions, or it coulds stick as a separate application.
Questions regarding the potential integration with NitroKey firmware
Currently, Fobnail uses CoAP over IP for communication with host. CoAP API is described in Fobnail API documentation. A possible integration scenario would be to use CTAPHID of NitroKey firmware as a transport layer for CoAP (using vendor commands). Can you see any limitations (or other problems), that could make it not viable?
Any general recommendations on how we could integrate Fobnail with NitroKey firmware? Should it be integrated as a library into one of the existing applications, or work as a separate application, communicating over IPC with other applications?
Fobnail uses custom blink codes for signaling error/success status, as described in the documentation, Do you see any potential problem with integrating these into the NitroKey firmware? Of course, the exact LED codes are not set in stone, and can be potentially adjusted, for the purpose of compliance with existing ones, or other requirements.
Trussed
Since Trussed is greatly used by NitroKey firmware, and Trussed experts are also present here, we decided to discuss it here as well, to keep it in one place. Please not that the specific questions/requests/issues has been raised in the Trussed repository and linked there as well.
What is your opinion about using the
alloc
crate? Fobnail application currently requires liballoc in some places. From here we may guess, that it is not welcome.Could Trussed implement interfaces from RustCrypto? We’d like to have interfaces from the digest, cipher, signature, and rand_core so that the Fobnail code could be more easily ported to non-Trussed platforms.
We've encountered two main limitations regarding flash storage (Trussed API, and LittleFS in general):
As part of the Fobnail application, we have have developed certificate store manager. We have failed to use the one from Trussed, but it could potentially get merged somehow. The missing features were:
Some other Trussed issues we have reported in the past, but may not be critical for the purpose of integration: