Cannot execute gnuk tests #5

Closed
opened 2023-02-03 01:28:52 +08:00 by polhenarejos · 2 comments
polhenarejos commented 2023-02-03 01:28:52 +08:00 (Migrated from github.com)
          > Is it a VID/PID discovery problem?

Most likely. I reverse-engineered the not so well documented dependencies for the Gnuk test repository and initiated the contained tests. They should just use APDUs according to the OpenPGP spec. But I could not get so far.

The conftest.py fixture prepares the environment for each test and it failed somewhere around get_ccid_device().

I deleted the VM where I tested but it was related to [card_reader.py](https://salsa.debian.org/gnuk-team/gnuk/gnuk/-
/blob/master/tests/card_reader.py#L322) and usb.core. The iterator was empty.

I think it is not just the VID:PID (if I remember correclty, I even tested a few) but some USB/CCID quirks are done for specific card reader models.

Originally posted by @rrottmann in https://github.com/polhenarejos/pico-hsm/issues/16#issuecomment-1410993894

> Is it a VID/PID discovery problem? Most likely. I reverse-engineered the not so well documented dependencies for the Gnuk test repository and initiated the contained tests. They should just use APDUs according to the OpenPGP spec. But I could not get so far. The `conftest.py` fixture prepares the environment for each test and it failed somewhere around [`get_ccid_device()`](https://salsa.debian.org/gnuk-team/gnuk/gnuk/-/blob/master/tests/conftest.py#L13). I deleted the VM where I tested but it was related to [`card_reader.py`](https://salsa.debian.org/gnuk-team/gnuk/gnuk/- /blob/master/tests/card_reader.py#L322) and [`usb.core`](https://github.com/walac/pyusb/blob/master/usb/core.py?L1245#L1245). The iterator was empty. I think it is not just the VID:PID (if I remember correclty, I even tested a few) but some USB/CCID quirks are done for specific card reader models. _Originally posted by @rrottmann in https://github.com/polhenarejos/pico-hsm/issues/16#issuecomment-1410993894_
polhenarejos commented 2023-02-03 05:29:51 +08:00 (Migrated from github.com)

I cannot run it in Mac since it complains about permissions.

Anyway, I think the best approach is to port these tests to pyscard, which implements all ccid stack, and interface only with apdu.

I cannot run it in Mac since it complains about permissions. Anyway, I think the best approach is to port these tests to `pyscard`, which implements all ccid stack, and interface only with apdu.
polhenarejos commented 2023-05-17 06:19:16 +08:00 (Migrated from github.com)

It runs smoothly without problems.

It runs smoothly without problems.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dearsky/pico-openpgp#5