Commit Graph

47 Commits

Author SHA1 Message Date
Pol Henarejos
6625678c30 Rename CCID_ codes to PICOKEY_
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-11-05 18:21:24 +01:00
Pol Henarejos
5399149b9d Increase number of hosted apps to 8.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-11-05 18:03:00 +01:00
Pol Henarejos
27a685b931 Fix usb initialization for emulation.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-11-05 09:42:27 +01:00
Pol Henarejos
0638409ff8 Refactor PHY to support more flexible and scalable architecture.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-11-05 00:29:13 +01:00
Benoît Allard
7a0b67f3cb led: Rename 'blink' to 'mode' 2024-09-25 21:46:33 +02:00
Pol Henarejos
108cfec47c Enable OTP to store a permanent secret key.
It can be used by HSM or Fido to protect the keys and use it as MKEK.
2024-09-11 23:16:23 +02:00
Pol Henarejos
ea6303de81 Add new led module to use colors whenever is possible.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-09-03 18:07:37 +02:00
Pol Henarejos
20099b61e8 Fix ESP32 GPIO led no.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-09-02 17:28:18 +02:00
Pol Henarejos
9f65a2cfa0 Fix BOOT press with RP2350.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-09-02 09:48:04 +02:00
Pol Henarejos
2d6545f191 Add support to RP2350.
RP2350 does not support RTC, so we use AON timer instead.
2024-08-28 16:42:46 +02:00
Pol Henarejos
7a88a2b8e7 Improved multicore synchronization. Now they exchange signals and protect areas atomically.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-23 19:24:18 +02:00
Pol Henarejos
65fea84df1 Fix warnings.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-23 13:17:10 +02:00
Pol Henarejos
fa6292118d Major refactor of USB CCID and USB HID interfaces. All interfaces are rewritten.
With this new scheme we ensure that:
- memcpy's are reduced.
- no race conditions are performed.
- critical areas are protected.
- callbacks are executed immediately.
- write's are executed after the positive report is received.
- no usb middle interface anymore.
- CCID and HID are totally independent.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-23 10:02:19 +02:00
Pol Henarejos
38f0e2cc3a select_app now invokes U2F or FIDO depending on the message.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-20 14:29:11 +02:00
Pol Henarejos
c1571c02f8 Increase vStack depending on the number of interfaces.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-20 12:43:01 +02:00
Pol Henarejos
b3dbee5cd6 Increase vStack of core0 of ESP32.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-18 23:43:54 +02:00
Pol Henarejos
246ed5cf19 Fix when setting options and taking VIDPID values.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-06-21 22:07:28 +02:00
Pol Henarejos
218441a45a Added support for enable/disable Web CCID on the fly.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-06-19 23:28:55 +02:00
Pol Henarejos
a0e55ebfae Fix tusb initialization.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-06-19 22:30:07 +02:00
Pol Henarejos
ade730ffb5 Introducing EF_PHY to store PHY (VIDPID and LED no.).
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-16 23:22:11 +02:00
Pol Henarejos
b6b53010cc Fix build for emulated interface.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-16 00:03:43 +02:00
Pol Henarejos
8d86a8c56b Add procedure to compute unique ID at startup.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-15 23:44:51 +02:00
Pol Henarejos
06fd241f49 Second round to make it work for ESP32S3.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-08 16:47:16 +02:00
Pol Henarejos
49f05e9e13 Now it builds the image.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-05 17:57:56 +02:00
Pol Henarejos
023039deb2 Attempting to add support to esp32s3.
Will it work? Who knows...

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-04 21:01:55 +02: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
81fcd2ced7 Go back 1 second wait
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-10-31 17:33:34 +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
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
10a9511358 Added support for LED in Pico W.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-09-18 10:12:32 +02:00
Pol Henarejos
f636085dbf Fix potential freeze.
For unknown reason, button cannot be checked if USB is active, as it is stalled.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-03-31 00:40:37 +02:00
Pol Henarejos
3947b59881 Add fix for emulation conditional build.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-03-30 01:04:11 +02:00
Pol Henarejos
c11d403f12 Added support for OTP interface.
This interface enables a HID Keyboard interface to send keystrokes to host. Also, it enables bidirectional flow through set/get report with 8-bytes chunked frames of 70 bytes.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-03-28 23:32:43 +02:00
Pol Henarejos
c6d08ae139 Fix conditional build for WS2812.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-03-26 20:15:38 +02:00
Pol Henarejos
15569ab419 Update code style.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-03-04 14:10:46 +01:00
Pol Henarejos
455bc17a74 Added support for Waveshare RP2040 zero.
It uses the WS2812 led for blinking like normal Pico or Tiny2040.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-03-01 23:32:42 +01:00
Pol Henarejos
31f899416c Using new style.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-15 00:14:10 +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
07c15e0a3c Lets try
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-01-30 15:39:22 +01:00
Pol Henarejos
8f68e9f8a3 Some tricks
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-01-30 13:30:11 +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
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
f123108c3e Added variable to cancel button press.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-23 18:07:38 +02:00
Pol Henarejos
d2e54b04db Adding variable button timeout.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 19:22:44 +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
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