Firmware update Nitrokey 3

Hello,

i tried to update the firmware of my Nitrokey 3 following the instructions in Firmware-Aktualisierung — Nitrokey Documentation. I downloaded the *.sb2 image and then tried to execute the command nitropy nk3 update <SB2_IMAGE>.

I got the following result "Nitrokey tool for Nitrokey FIDO2, Nitrokey Start, Nitrokey 3 & NetHSM
Usage: nitropy nk3 [OPTIONS] COMMAND [ARGS]…
Try ‘nitropy nk3 --help’ for help.

Error: No such command ‘update’."

Help indeed does not show the update command. Any idea, what went wrong?

Regards,

Volker

That’s most likely, because you are not using the most current version of nitropy. You can update it using pip or uninstalling + reinstalling it.
However, personally I didn’t get it to work on my MX Linux machines. There I geht the error
ModuleNotFoundError: No module named 'cryptography.hazmat._types'.
With the older version of nitropy I did not encouter this problem.
On an old computer running manjaro I finally got the newest nitropy version running and could successfully perform the update.

Thank you! Indeed after some de-/re-install attempts I managed to reach the error message you described. It is a good suggestion to try it on another computer, although I was wondering, whether the error you described may also be related to an outdated udev file. The error is not described in troubleshooting, but I will give it a try anyway.

Glad that you got one step further. Pleas let me know if you can somehow solve the error we encounter.

Also I would be interested to hear from the nitrokey team on which platform they use the script and if there are any hints how to handle the described error.

Hi @f0x @VHIL !
I think one of the Python packages is outdated on your installation. We will check what version is required and correct that in the next release (we probably miss the minimal version requirement for it in the pynitrokey package specification). In the meantime perhaps following would make it work:

python3 -m pip install -U --user cryptography

This is my current version installed:

$ python3 -m pip freeze | grep cryptography
cryptography==36.0.1

We will take another look at the documentation regarding updating as well.

Hello szszszsz,

that eventually helped. I additionally re-installed the pynitrokey afterwards. The firmware is updated. Thank you!

Regards,

VHIL

Maybe to add my experiences also for others. After the update the nextcloud/nextbox adds the NK3 as additional key for identification. Before the update nextcloud simply did not recognise the key. However, after logging out and in, the key is not recognized for identification. I tried it in Chrome.

1 Like

hey, thanks for the reply. Installing the latest version of cryptography did the trick for me. As @VHIL I had to reinstall the whole nitropy a couple of times afterwards but then it worked.
As the outdated version of cryptography probably concerns most users of debian based distros I guess it would be very helpful to include a hint about that in the official documentation, as you already mentioned @szszszsz

ps: nice, that you included automatic download into nitropy

1 Like

Hi!
The latest release of pynitrokey (0.4.13) now sets the proper requirement for cryptography dependency.
Command for update:

python3 -m pip install -U --user pynitrokey

@VHIL I will check Nextcloud registration. At the moment we have reports that Google registration is not working as well.

@VHIL
Just tested Nextcloud 22.2.3 on Chromium, Linux, and it worked for me with a clean Nitrokey 3 v1.0.1. Can you share details of your OS name and build?
I will ask my colleague to run tests on Nextbox.

Edit: Nextbox tests with Nitrokey 3 are passing on Linux on our side. Waiting for more details to run additional reproduction tests.

@szszszsz

I tried now chromium on linux (before I used chrome on windows10). Same result. The key is not recognized at all. Nextcloud version 22.2.3 running on a NextBox. Linux is ubuntu (actual) with bungie core (TUX OS).The nitrokey FIDO2 got recognized seamlessly, by the way. Is that sufficient information?

Not a big deal. I see the NK3 anyway as an experiment and I am sure you will get it working after some time incl. de google hickup.

Regards,

Volker

Dear @szszszsz,

a day later, restarting the computer etc. and the NK3 is working. I could add it now just simply with ubuntu/firefox to my nextcloud account. Great! To all others above: Thank you very much, too.

With kind regards,

Volker