Commit graph

23 commits

Author SHA1 Message Date
Pol Henarejos
4919eb980f
Added a major refactoring to include Emulated interface.
It works in combination with virtualsmarcard module (vpcd). It properly installed, it creates a virtual reader that can be interfaced via PCSC+vcpd. At user app level, it has no difference of having a physical smart card.

At this moment, it only works emulating a CCID interface.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-01-09 18:06:21 +01:00
Pol Henarejos
411755dee4
Adding a secondary HID interface that emulates a keyboard.
With it, an app can send a password directly to the host, like it is typed by user.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-30 01:41:49 +01:00
Pol Henarejos
20bd2c8b41
Fix writting read buffer for itf > 0.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-30 01:40:22 +01:00
Pol Henarejos
e5825df5cb
Added capability to add multiple interfaces: HID and CCID at compile time.
Depending on compiling flags, HID and/or CCID may be enabled independently and run simultaneously.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-20 23:41:24 +01:00
Pol Henarejos
0bc13df1a2
Queues are emptied at begining of card thread.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-28 18:54:01 +01:00
Pol Henarejos
8f14db677e
Fix strange bug when usb cannot write.
In this case, the buffer is kept until the next success call.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-29 23:11:49 +02:00
Pol Henarejos
3912775ccb
Fix writting large packets.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-27 12:23:16 +02:00
Pol Henarejos
b70a7474f2
Possibly not necessary, as it returns 0 if there is no available.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-25 23:35:35 +02:00
Pol Henarejos
fa371643a1
Fix writing large usb buffers.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-25 23:23:07 +02:00
Pol Henarejos
7fded7234b
Adding extra buffer to tx.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 22:52:56 +02:00
Pol Henarejos
3092da23ed
card_init_core1() shall be called from every thread launched on core1.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 19:24:07 +02:00
Pol Henarejos
4ab68cc822
HID fixes.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 14:05:39 +02:00
Pol Henarejos
5a4aff7008
Adding KEEP_ALIVE response.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-20 15:31:34 +02:00
Pol Henarejos
8b97791d8f
Reorganizing core0/core1 split.
Now CBOR and APDU (i.e., intensive processing) areas are executed on core1, while core0 is dedicated for hardware tasks (usb, button, led, etc.).
2022-09-20 14:39:59 +02:00
Pol Henarejos
40288a85f1
It's a major reorganization.
In order to add FIDO2 support, we need to reorganize some USB/CCID calls to specific area (named driver).
Thus, pico-hsm-sdk has two drivers:
- CCID driver implements APDU over USB/CCID ISO-7816 standard procedures.
- HID driver implements APDU over HID.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-30 02:00:11 +02:00
Pol Henarejos
8e5d33c4ba
Removing trailing spaces.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-19 01:44:03 +02:00
Pol Henarejos
ef52ae37d3
Reorganizing usb layer. 2022-05-30 12:20:42 +02:00
Pol Henarejos
8bb47e7979
Compilation fixes in debug mode 2022-05-29 03:33:40 +02:00
Pol Henarejos
e0bff38384
Moving again to TinyUSB 2022-05-29 01:52:44 +02:00
Pol Henarejos
152a2fa031
Fix warnings 2022-05-27 20:58:28 +02:00
Pol Henarejos
da871e695e
More and more fixes. 2022-05-27 00:36:44 +02:00
Pol Henarejos
d4b0978d50 More fixes 2022-05-26 14:15:16 +02:00
Pol Henarejos
77ce276b59
First attempt to run away from tinyUSB to our code.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-05-26 00:03:38 +02:00