solokeys / solo2-cli

Solo 2 library and CLI in Rust
https://docs.rs/solo2
Apache License 2.0
170 stars 31 forks source link

example commands crash #52

Closed loveshack closed 2 years ago

loveshack commented 2 years ago

I tried these with 0.1.1 on Debian 11

$ solo2 app admin uuid
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: TryFromSliceError(())', src/apps/admin.rs:48:55
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
$ solo2 app ndef capabilities
thread 'main' panicked at 'explicit panic', src/transport/ctap.rs:90:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
loveshack commented 2 years ago

It turns out that this is due to libccid not supporting Solo 2. I'd have hoped the program would be able to report that instead of just panicking. (Although there's a mention of this in the last project update, it wasn't clear it's actually necessary to have updated packages, or what to do about it.)

I've raised https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006614 to try to get support added to Debian 11, at least. It references two packages I built, one a backport from ccid 1.5, and another which patches 1.4.34 to support Solo 2 and Nitrokey 3. Either of those work for me to the extent I've tested. There are also Debian 10, Ubuntu 18.04, and Ubuntu 20.04 builds (untested). If you install the 1.4.34-1~solo2+1 version on Debian 11 you'll need to pin it to avoid it being overwritten on updates; I obviously don't know enough about Debian versioning.

However, the easiest, and presumably most general, way to provide the support is to copy the built configuration file from ccid 1.5, or the patched version, into /etc/libccid_Info.plist, or wherever it lives in other distributions. (That file was mentioned, but I didn't understand what it was about.) Here's a copy of the minimally-patched version. libccid_Info.plist.gz

nickray commented 2 years ago

Yeah this is a sucky combination of Debian's "security fixes only" and CCID's "allowlisted device only"... Oh well.

cavokz commented 2 years ago

Here is the Debian bug report, for reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006614

AndrewKvalheim commented 1 year ago

Oh well

This could at least show a more informative message than a bare panic!().