-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confirm Credential removal with a touch #92
Comments
Wow, I love that diagram. Is it something I can try and fix? I want to contribute to the firmware and this seems to be a good start! I have done embedded security hardware before (Ledger, in C) but am working fulltime in Rust now. |
Sure! This is a one-line change, but it needs to be tested / checked for potential implications. Feel free to take it :-)
Edit: added |
I'll get on it right away! So this means you don't need to flash your NitroKey with the firmware to test it out? |
Great! Edit: alternatively maybe the DevKits would do, but this target was removed recently |
I forgot to mention, that you need USB/IP kernel modules and tools available in your Linux system. I have not tested that with Windows/macOS, but perhaps it would work there too. |
If you want to develop with real hardware, this would be the starting point: https://github.com/Nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md |
I run Linux so it should be fine. If not, I'll be able to install them I'm sure! |
Ah that's kinda sad, I was hoping to add more features to the firmware when I would get more experienced, I assumed that since the firmware was open source it would be possible to flash a custom build in some way or another |
This is not possible for normal Nitrokey 3 devices because they are shipped with secure boot. But if you order a Nitrokey 3 Hacker device from [email protected], you will get the same hardware without secure boot and can run any firmware you want on it. |
I might get back about that later then 👍🏼 |
This patch adds a touch prompt when deleting a credential. While a touch confirmation is not required at the moment, this is unintentional and will be changed in an upcoming firmware release. See: Nitrokey/trussed-secrets-app#92 Fixes: #110
I did get the error about USB/IP. I managed to install the driver and now tests seem to run well, so I can begin make the change |
I seem to have done it! It was really easy in hindsight, I will make a PR now and we'll see from there. The logs were very clear on where a button was supposed to be pressed. Also, this USB/IP thing is very new to me but very pleasant to work like this, it this possible on any Rust based embedded hardware/software project? Like using it on a firmware written in Rust for STM32 or something. |
Here we go: #93 Ironically, this is my first commit signed with a Nitrokey |
Wow, that was quick! :)
This is not related to Rust at all. You just need a driver that wraps the USB packets in IP packets and sends them to the correct socket. Rust’s abstractions make it easy to switch out the real USB driver with the usbip driver, but the same principle works for all languages. |
@peterwilli |
Oh, so you use an abstraction layer in Rust to switch to USB/IP. From what I understand, there's no "emulator" in place that ran the firmware I just tested? |
Exactly. The bigger picture is: We use the Trussed framework for our firmware. This framework provides abstractions that can be used by applications like the secrets app. Then there is a runner that provides implementations for these abstractions and defines the available applications. To run the firmware on hardware, you would use a runner that uses hardware-specific code to implement these abstractions, e. g. accessing the flash chip or the touch button. But for the usbip simulation, we just use the standard library and the file system to implement them and compile to a native binary. The advantage is that it is very easy to test, the downside is that we don’t test the low-level components of the firmware. But for application development, this is typically sufficient. |
Oh, that makes sense, so it's a good Swiss Army knife for development, but for testing out actual hardware elements you'd still need a different way to test on an actual device. |
This patch adds a touch prompt when deleting a credential. While a touch confirmation is not required at the moment, this is unintentional and will be changed in an upcoming firmware release. See: Nitrokey/trussed-secrets-app#92 Fixes: #110
By design all state changes (exception: HOTP counter) should be confirmed by touch. Currently removal of the credential does not have such. To add it.
Connected: Nitrokey/nitrokey-3-firmware#303
trussed-secrets-app/src/authenticator.rs
Lines 436 to 464 in d1b083d
The text was updated successfully, but these errors were encountered: