Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
98 stars 27 forks source link

Update to spsdk 2.0.0 #486

Closed PureTryOut closed 8 months ago

PureTryOut commented 9 months ago

spsdk 2.0.0 has been released on the 13th of October but the current latest pynitrokey release (0.4.43) isn't compatible with it.

nitropy list
Command line tool to interact with Nitrokey devices 0.4.43
:: 'Nitrokey FIDO2' keys
:: 'Nitrokey Start' keys:
:: 'Nitrokey 3' keys
Critical error:
An unhandled exception occurred
        Exception encountered: ImportError("cannot import name 'StatusCode' from 'spsdk.mboot' (/usr/lib/python3.11/site-packages/spsdk/mboot/__init__.py)")

--------------------------------------------------------------------------------
Critical error occurred, exiting now
dvzrv commented 8 months ago

Packaging this project for Arch Linux, I'd be interested in seeing this as well

frogamic commented 8 months ago

Maintaining this package in NixOS, would also like to see this.

daringer commented 8 months ago

couldn't resist so many packager requests - can you please check, if #499 works for you? Especially nk3 update relies most on spsdk.

Tested as thorough as possible, anyways a "remaining-risk disclaimer": This is touching the update process for the lpc55 devices, if this process fails at the wrong time you might end up without a firmware. You would need to open the device to revive it, i.e., boot into bootloader.

frogamic commented 8 months ago

Thanks @daringer! This appears to work for me, tested nk3 list, nk3 status and nk3 test, I will try a firmware update when I get home in a few hours so I can use my spare nk3

frogamic commented 8 months ago

Ah, I noticed you said "update process for the lpc55 devices", my spare nitrokey is an nrf52 based nk3a mini, so not sure if testing it was useful, but it did upgrade successfully

daringer commented 8 months ago

yes, the nk3mini is based on the nrf52 and does not use spsdk for firmware upgrades.

frogamic commented 8 months ago

Ok, I bit the bullet and upgraded my main nk3c nfc, and everything went smoothly.

daringer commented 8 months ago

uh, nice! always happy if I don't mess things up - including our internal testing this is fine to merge - a new release shouldn't be too far away.

Generally: sorry, for the versioning mess, we'll be working on cleaning this up, feel free to drop further packages with "bad" versions for packaging into issues like @eighthave has done in #494 - we'll try include these into the cleanup efforts and hope to release 0.5 and then 1.0 soon-ish(tm)...

oh and thx for all the packaging work :heart: