Nitrokey start Update funktioniert nicht

Ich kann mein Nitrokey Start wieder nicht updaten. Der Stick steckt noch in USB und blinkt.
Hier Log.

1085      DEBUG       root print: Nitrokey Start firmware update tool
1087      DEBUG       root Start session 2020-08-16 09:44:22.463844
1090      DEBUG       root print: Platform: Linux-4.19.0-10-amd64-x86_64-with-debian-10.5
1090      DEBUG       root print: System: Linux, is_linux: True
1090      DEBUG       root print: Python: 3.7.3
1090      DEBUG       root print: Saving run log to: /tmp/nitropy.log.yb2eyjfi
1090      DEBUG       root Arguments: regnual= 'None', gnuk= 'None', default_password= 'False', password= '<hidden>', wait_e= '20', keyno= '0', verbose= '0', yes= 'False', skip_bootloader= 'False', green_led= 'False'
4887      DEBUG       root print: Firmware data to be used:
4894      DEBUG urllib3.connectionpool Starting new HTTPS connection (1): api.github.com:443
5387      DEBUG urllib3.connectionpool https://api.github.com:443 "GET /repos/Nitrokey/nitrokey-start-firmware/releases HTTP/1.1" 200 None
5400      DEBUG urllib3.connectionpool Starting new HTTPS connection (1): raw.githubusercontent.com:443
6057      DEBUG urllib3.connectionpool https://raw.githubusercontent.com:443 "GET /Nitrokey/nitrokey-start-firmware/gnuk1.2-regnual-fix/prebuilt/RTM.10/regnual.bin HTTP/1.1" 200 4504
6066      DEBUG urllib3.connectionpool Starting new HTTPS connection (1): raw.githubusercontent.com:443
6325      DEBUG urllib3.connectionpool https://raw.githubusercontent.com:443 "GET /Nitrokey/nitrokey-start-firmware/gnuk1.2-regnual-fix/prebuilt/checksums.sha512 HTTP/1.1" 200 3859
6330      DEBUG       root True b'RTM.10/regnual.bin'/ RTM.10/regnual.bin b'65ac82a1'
6331      DEBUG       root print: - FirmwareType.REGNUAL: 4504, hash: ...b'65ac82a1' valid (from ...built/RTM.10/regnual.bin)
6334      DEBUG urllib3.connectionpool Starting new HTTPS connection (1): raw.githubusercontent.com:443
6601      DEBUG urllib3.connectionpool https://raw.githubusercontent.com:443 "GET /Nitrokey/nitrokey-start-firmware/gnuk1.2-regnual-fix/prebuilt/RTM.10/gnuk.bin HTTP/1.1" 200 131072
6915      DEBUG       root True b'RTM.10/gnuk.bin'/ RTM.10/gnuk.bin b'f85da8f7'
6915      DEBUG       root print: - FirmwareType.GNUK: 131072, hash: ...b'f85da8f7' valid (from ...prebuilt/RTM.10/gnuk.bin)
7111      DEBUG       root print: Currently connected device strings:
7122      DEBUG       root Initial device strings: [{'name': '', 'Vendor': 'Nitrokey', 'Product': 'Nitrokey Start', 'Serial': 'FSIJ-1.2.15-43112746', 'Revision': 'RTM.9', 'Config': 'NITROKEY_START:dfu=no:debug=no:pinpad=no:certdo=yes:factory_reset=yes', 'Sys': '3.0', 'Board': None}]
7123      DEBUG       root print: Please note:
7123      DEBUG       root print: - Latest firmware available is: RTM.10 (published: 2020-06-04T12:34:14Z),
 provided firmware: None
7123      DEBUG       root print: - All data will be removed from the device
7123      DEBUG       root print: - Do not interrupt the update process, or the device will not run properly
7123      DEBUG       root print: - Whole process should not take more than 1 minute
11494     DEBUG       root print: Entered: "yes"
11494     DEBUG       root Continue? "yes"
14558     DEBUG       root print: *** Starting bootloader upload procedure
14709     DEBUG       root  1 0
14725     DEBUG       root print: *** Connected to the device
14857     DEBUG       root print: *** Running update. Do NOT remove the device from the USB slot, until further notice.
14857     DEBUG       root print: Downloading flash upgrade program...
14857     DEBUG gnuk_token print: start 20002a00
14858     DEBUG gnuk_token print: end   20003b00
14858     DEBUG       root print: Progress: 0%
14858     DEBUG       root print: Progress: 0.0%
14858     DEBUG gnuk_token print: # 20002a00: 42 : 256
14860     DEBUG gnuk_token print: # 20002b00: 43 : 256
14862     DEBUG       root print: Progress: 11.76%
14862     DEBUG gnuk_token print: # 20002c00: 44 : 256
14864     DEBUG gnuk_token print: # 20002d00: 45 : 256
14866     DEBUG       root print: Progress: 23.53%
14866     DEBUG gnuk_token print: # 20002e00: 46 : 256
14868     DEBUG gnuk_token print: # 20002f00: 47 : 256
14870     DEBUG       root print: Progress: 35.29%
14870     DEBUG gnuk_token print: # 20003000: 48 : 256
14872     DEBUG       root print: Progress: 41.18%
14872     DEBUG gnuk_token print: # 20003100: 49 : 256
14874     DEBUG gnuk_token print: # 20003200: 50 : 256
14876     DEBUG       root print: Progress: 52.94%
14876     DEBUG gnuk_token print: # 20003300: 51 : 256
14878     DEBUG gnuk_token print: # 20003400: 52 : 256
14880     DEBUG       root print: Progress: 64.71%
14880     DEBUG gnuk_token print: # 20003500: 53 : 256
14882     DEBUG       root print: Progress: 70.59%
14882     DEBUG gnuk_token print: # 20003600: 54 : 256
14884     DEBUG gnuk_token print: # 20003700: 55 : 256
14886     DEBUG       root print: Progress: 82.35%
14886     DEBUG gnuk_token print: # 20003800: 56 : 256
14888     DEBUG gnuk_token print: # 20003900: 57 : 256
14890     DEBUG       root print: Progress: 94.12%
14890     DEBUG gnuk_token print: # 20003a00: 58 : 256
14892     DEBUG gnuk_token print: # 20003b00: 59 : 156
14894     DEBUG       root print: Run flash upgrade program...
14896     DEBUG       root print: *** Found unexpected error: [Errno 19] No such device (it may have been disconnected)
14897     DEBUG       root print: *** Could not proceed with the update. Please execute one or all of the following and try again:
- reinsert device to the USB slot;
- run factory-reset on the device;
- close other applications, that possibly could use it (e.g. scdaemon, pcscd).
14897     DEBUG      dmesg Finishing
14897     DEBUG      dmesg Finished

kann es vielleicht daran liegen?
### Preparation on client

* Make sure ~/.gnupg/gpg.conf contains 'use-agent'
* Add ssh support to gnupg-agent by adding 'enable-ssh-support' to ~/.gnupg/gpg-agent.conf
If the file does not exist yet, you can just create it.
* Add the following code somewhere into your ~/.bashrc (for fish shell, look [here](https://support.nitrokey.com/t/ssh-auth-with-fish-instead-of-bash/2206))

unset SSH_AGENT_PID if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" fi

* Simply restart your system or try `pkill gpg-agent` and open a new commandline to make sure everything is set
* In case of problems, please try `gpg2 --card-status` on first usage to make sure the gpg-agent gets started

Hallo,

Es sieht so aus, als hätte das Gerät während der Aktualisierung aus unbekannten Gründen nicht verbunden werden können, so dass der Aktualisierungsvorgang nicht abgeschlossen werden konnte und das Gerät möglicherweise nicht mehr erreichbar ist. Wenn es seitdem nicht unter Strom gehalten wurde, wird es wahrscheinlich nicht mehr funktionieren. Es tut mir leid.

Nachdem Sie bestätigt haben, dass die Aktualisierung nicht noch einmal durchgeführt werden konnte und das Gerät nicht im dmesg-Systemprotokoll erscheint, wenden Sie sich bitte an shop@nitrokey.com, um Ihr Gerät auszutauschen. Bitte verweisen Sie auf diese Diskussion und dass der Aktualisierungsvorgang fehlgeschlagen ist.

Mit freundlichen Grüßen,
Szczepan

PS Diese Meldung wurde automatisch übersetzt. Wir entschuldigen uns für die
Unannehmlichkeiten.

cc @jan

Hallo,
es muss aber ein Grund geben dass es nicht funktioniert. Das ist schon das dritte Stick hintereinander. Das Problem hatte ich schon hier: Nitrokey Start - benötigte Linux-Pakete für Fimwareupdate
Ich benutze jetzt anderen Rechner mit Debian 10 Gnome.
Ich könnte wetten, wenn ich jetzt wieder neuen bekomme, dass es wieder passiert.
Wir müssen eine Lösung finden.

Ich verstehe, das war mir nicht bewusst. Das tut mir wirklich leid.
Seit Ihrem letzten Fall haben wir den Aktualisierungsprozess verbessert und einige Erfolgsberichte von Benutzern erhalten. Ich weiß nicht, warum dies bei Ihnen auftritt (und ich verstehe, dass Sie jetzt ein anderes Betriebssystem haben). Ich werde morgen versuchen, das Problem in einer ähnlichen Umgebung wie der Ihren zu reproduzieren.

Ticket ausstellen: https://github.com/Nitrokey/nitrokey-start-firmware/issues/51

Ich habe auch die gleichen Schritte probiert, aber ohne Erfolg.
./upgrade_by_passwd.py -f ../prebuilt/RTM.7/{regnual.bin,gnuk.bin} -b
Nur mit RTM.10.
Mein Rechner lief bis heute mit dem Stick (hat noch geblinckt), bloß hat sich PC heute Nacht gefroren und ich konnte nichts mehr machen, nur rebooten. Stick funktioniert daher nicht mehr.

Debian wurde frisch installiert. SSH-Unterstützung im gpg-agent aktiviert.

echo enable-ssh-support >> $HOME/.gnupg/gpg-agent.conf
nano $HOME/.bashrc

unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
   export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi

danach

gpgconf --kill gpg-agent

Sonst habe ich in der Konfiguration des Debians nichts großartiges geändert.

Vielen Dank für die Aktualisierung.

Ich glaube nicht, dass wir von hier aus viel tun können, es sei denn, das Gerät ist im Betriebssystem sichtbar, z.B. mit dem Befehl lsusb. Der Update-Befehl, den Sie mit upgrade_by_passwd ausgeführt haben, war der richtige Aufruf, aber das Gerät ist wahrscheinlich dunkel geworden, wenn es bei Ihnen nicht funktioniert hat.

Ich glaube, das Problem liegt in der Update-Prozedur, die nicht der langsamen Systemerkennung des Geräts Rechnung trug, sondern sofort fehlschlug. Das sollte korrigiert werden.
Konfigurationsänderungen im GnuPG sollten den Update-Prozess nicht beeinträchtigen; andernfalls handelt es sich um einen Fehler.

Wenn ich noch einen NK Start bekomme, wie soll ich dann am besten vorgehen? So dass wir das Problem lösen können.
upgrade_by_passwd habe ich ausgeführt nachdem nitropy start update fehl schlug und NK Start Rotleuchte noch blinkte. Hat aber trotzdem update error angezeigt.
Sie können auf englisch antworten. Die automatische Übersetzung ist manchmal verwirrend. Englisch kann ich mehr oder weniger verstehen aber nicht schreiben.

Hi!

Sorry, I imagine auto-translation could add more confusion.
What I plan is to have another look on the update process, simulate your case (if not reproduced) and add protections for it not happening again. By design it should be completely hassle-free and not requiring any debugging user side. While we have tested it extensively earlier, perhaps more OS configurations should be added too.

Hi,
kann ich Stick noch mit STM32 wieder zum Laufen bringen oder ist NK Start komplett unbrauchbar?

Hi!
It will work again once re-flashed with a STM32 debug adapter. The data on the device were removed during the update procedure. It can be easily done user side. The only inconvenience is a broken case (it is hard to open it without damaging).

Hi,
gibt es eine Anleitung dafür wie ich es mit STM32 flashen kann? Mein Arbeitskollege hat STM32.
Case habe ich ganz leicht aufgemacht.

Sure! Please take a look at:

More information:

ich werde die Tage probieren und dann melde ich mich noch mal.

Hi,
habe ein STMicroelectronics STM32 STLink bekommen.
Löten ist kein Problem.
Soll ich die Seite (https://github.com/snowcap-electronics/OpenOCD) git clone machen und dann Install Befehle ausführen?
Oder offiziellen OpenOCD Paket über apt install openocd installieren und dann Befehle von snowcap? Soll dabei ST-link mit PC schon verbunden sein?

Hi!

You can use either OpenOCD package native to your OS [1], or STM’s STM32_Programmer_CLI tool from the STM32CubeProgrammer package. No need to build the OpenOCD by hand.

STM32 programmer:

FW=firmware.bin
# erase
STM32_Programmer_CLI -c port=SWD -halt -e all --readunprotect
# flash
STM32_Programmer_CLI -c port=SWD -halt  -d ${FW} -rst
# STM32 programmer cannot set read protection; alternatively can be set with 
# running the update through bootloader, or using OpenOCD

OpenOCD:

FW=firmware.bin
# erase
openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg  -c "init" -c "reset halt" -c "stm32f1x mass_erase 0" -c "exit"
# flash
openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c "init" -c "reset halt" -c "stm32f1x unlock 0"  -c "reset halt"  -c "flash write_image erase ${FW}" -c "reset run" -c "exit"
# set read-protection 
openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg  -c "init" -c "reset halt" -c "stm32f1x lock 0" -c "reset run" -c "exit"

Latest firmware (only gnuk.hex is needed - please use it for flashing):

[1] (the patches from the mentioned fork are merged already to the main branch, will update the guide)

Danke schön. Das hat sehr gut funktioniert.

Wieso kann ich Admin PIN nicht ändern? Egal was ich eingebe kommt Fehler.
Error changing the PIN: Conditions of use not satisfied

Habe Admin PIN geändert - das soll 14 Zeichen sein. Wie groß soll normaler PIN sein? Nur Zahlen oder auch Buchstaben?

Hi!
Please take a look at the documentation (https://nitrokey.com/start):

I believe you have not imported/generated any keys on the device yet, which is required to change the PIN. The content of the PIN (are chars from letters, digits, specials etc.) is not checked on the device - only the length is verified.

Hi,
vielleicht in Dokumentation reinschreiben, dass beide PIN’s (Admin und User) mindestens 14 Zeichen lang sind.
Wie lang soll reset code sein?

In der Dokumentation 2. Punkt mit Gpg4win ist aber für Windows :slight_smile:

1 Like