Nitrokey / nitrokey-pro-firmware

Firmware for the Nitrokey Pro device
GNU General Public License v3.0
117 stars 21 forks source link

Nitrokey Pro firmware upgrade from 0.9 -> 0.14 impossible from nitropy? #95

Open tlaurion opened 2 years ago

tlaurion commented 2 years ago

Edit:

Conclusion: Nitrokey Pro v2 can be upgraded from nitropy (software based firmware upgrades) if dongle is at least having firmware 0.11+

For <0.11: user will need to go the currently documented routes under firmware upgrade guide with external programmer.

SWD programmer can be a RPI :) https://nosmd.com/raspberrypi-swdprogrammer/#rpiprogrammer-target


Hello there.

A user reported a Nitrokey Pro delivery delayed of 6 weeks. He decided to not trust received dongle and reflash it with newer firmware through dfu external programmer, which at the time was 0.14 RC4, which had GPIO mapping inversed, which led to issue https://github.com/osresearch/heads/issues/1170 being opened.The user bought programmer and went the manual way since it was unclear that a software method was available.

I was able to upgrade with that tool from Nitrokey's firmware:

But for some reason, attempting to upgrade 0.9 was not possible. I got firware version from heads through hotp_verification info

0.10 and 0.11 firmware version behaves the following way:

0n 0.9 connected dongle:

Questions needing answers:


Some unrelated issues here:

szszszsz commented 2 years ago

Hi!

  1. The firmware update feature is available only since v0.11, meaning the Nitrokey Pro v0.10 devices and older cannot be updated by solely software means as well. Additionally one can see that the size of the binary increases between these two by about 20 kB, which is taken by the bootloader code.
  2. About this specific issue 1170, the firmware reported in the very first screenshot was v0.13, however v0.14RC4 should contain the updated firmware string already (as specified in the repository), hence I suspect the user was really using v0.14RC1 at the time (if not v0.13) and not having the correct LED behavior yet. Perhaps some misunderstanding?
  3. We are finishing the work on the firmware update tool, specifically MS Windows support, and plan to publish it.
  4. As far as I remember Librem Keys have own Udev rules, with own distribution path. Naturally they might not contain update mode IDs yet, since the tool was not considered to be ready.
  5. I have passed further the docs check request. Edit: the closest I could find right now is here:

Edit:

  1. Just for completeness, in case the same hardware is used by Librem Key, and if they happen to have v0.11+ firmware, these could be easily updated right now to the one used by Nitrokey Pro if needed, until the proper branded Librem Key firmware is released.
tlaurion commented 2 years ago

Thanks! You're right, only 0.11+ were upgraded, 0.10 device is a Librem Key. Edited OP.

Right as well for user report, was 0.13.

I would correct flashing references to clarify this as well. 0.11 software upgradeable would help redirection support. Also note that RPI can be used as flasher and should also be referenced (why have multiple flashers if RPI can be used and is handy for multiple purposes for a lot of users.)

tlaurion commented 2 years ago

Note on current instructions.

Debian-11 based appvm under Qubes OS.

@szszszsz that was my successful experience upgrading 0.11 dongles to 0.14, hope this finds a way into the documentation somehow.

Notes:

tlaurion commented 2 years ago

@szszszsz

Hello there,

Physical flashing documentation specifies roughly https://github.com/Nitrokey/nitrokey-pro-firmware#flashing

"This approach requires soldering wires to the contact pads or to use an adapter with pogo pins and some kind of mounting (recommended)."

Any picture or more specifics to share?

szszszsz commented 2 years ago

@tlaurion Hi! I do not think we ended up with the proper mounting for the development, but will pass the question further and get back if there would be anything of use. We do have pogo pins on a header for the production purposes, though its not public. You can see it in action here:

About the actual soldering via contact pads for the SWD connection, the details are just below:

szszszsz commented 2 years ago

@tlaurion Attaching image of the pogo pin adapter below (centered on the actual pins connecting to the PCB): image