Commit Graph

36 Commits

Author SHA1 Message Date
Pol Henarejos
019c5929a2 Remove carriage return \r for better debug.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-17 11:21:10 +02:00
Pol Henarejos
c0652ba1f7 Fix chained responses in other interfaces.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-03-21 22:02:01 +01:00
Pol Henarejos
b353beaaf8 Fixed chained response.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-03-20 00:07:00 +01:00
Pol Henarejos
b034a6c2d3 Added support for APDU chaining.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-03-19 18:55:09 +01:00
Pol Henarejos
e055d4cfc9 Added support for WebCCID.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-03-13 17:24:20 +01:00
Pol Henarejos
caddf87c23 Fix Windows emulation build.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-01-09 11:43:47 +01:00
Pol Henarejos
a2bc4b6be9 Fix byte overwrite for long chained RAPDU.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-01-02 01:57:39 +01:00
Pol Henarejos
c9b830baa3 Fix chaining long APDU.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-01-02 01:27:30 +01:00
Pol Henarejos
b663f5bebf Some fixes for emulation.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-01-01 20:56:36 +01:00
Pol Henarejos
a9dc6fd7f8 Added support for building emulation in Windows.
It has not been tested but it should not break any linux build.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-01-01 01:54:49 +01:00
Pol Henarejos
d0dc786f74 Rename project to Pico Keys SDK to avoid confusions with Pico Fido and Pico OpenPGP.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-06 13:32:28 +01:00
Pol Henarejos
3182d1e2e6 Fixed potential crash.
board_button_read() disables interrupts and cannot be parallelized when flash is being used. It is imperative that core1 must not use flash during the board_button_read(). Since it is not feasible to put mutexes in *every* flash memory read/write in core1, it is preferable to wait until core1 finishes command execution.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-10-31 00:40:38 +01:00
Pol Henarejos
4b099c9d1e Call select AID if selected.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-10-12 17:40:49 +02:00
Pol Henarejos
1b5a7496e1 Only accept those applets that load successfully.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-10-11 21:04:45 +02:00
Pol Henarejos
eef2f190f2 New format for applet selection.
AID comparison is performed by the kernel. If it is the same as previously loaded, do nothing. If not found, do nothing. If found and is different, unload old and load the new one.

All other applets shall be migrated to new format.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-10-11 21:02:04 +02:00
Pol Henarejos
81a598f464 Revert "Fixed chained response."
This reverts commit e84258c434.
2023-08-22 17:18:36 +02:00
Pol Henarejos
a36a89cc95 If an applet is not selected, it returns NOT_FOUND on every command.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-08-18 12:25:40 +02:00
Pol Henarejos
e84258c434 Fixed chained response.
Now it returns exactly 256 bytes (including SW).

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-08-16 19:19:50 +02:00
Pol Henarejos
16b4fa6ca3 Emulation is now a higher define which also accepts interfaces.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-23 07:57:35 +01:00
Pol Henarejos
43ef33d60b Switching to new style.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-15 00:10:00 +01:00
Pol Henarejos
12bdcbd1f9 Harmonizing coding style.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-14 23:23:57 +01:00
Pol Henarejos
dcb18a3476 Fix when requesting more data.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-02 22:28:42 +01:00
Pol Henarejos
a9eee861fe Adding support for chained apdu in emulation mode.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-01-17 00:06:17 +01:00
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
c0a540ae2b Fix processing APDU when no app is selected.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-24 01:37:04 +01:00
Pol Henarejos
7deaa990d3 An app can be selected even if there is another selected previously.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-24 00:49:25 +01:00
Pol Henarejos
4682e5821f Selecting an app by AID requires the AID as argument.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-22 19:33:02 +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
c4178fda4b Fix when multiple shutdowns are sent
Thread queues are empty on every start to avoid ancient messages from previous sessions.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-24 20:21:06 +01:00
Pol Henarejos
74210d7af0 Fix chaining more than 2 chunks.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-30 23:41:56 +01:00
Pol Henarejos
c5095dfec6 Only send response apdu if sw != 0.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-27 22:10:47 +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
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
214ec2b9ae Adding support for U2F_MSG 2022-09-02 18:02:31 +02:00
Pol Henarejos
b42e2b5493 Fix processing apdu. 2022-08-30 16:57:01 +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