Commit graph

72 commits

Author SHA1 Message Date
Pol Henarejos
8f907b25ba
Relicense project under the GNU Affero General Public License v3 (AGPLv3)
and add the Enterprise / Commercial licensing option.

Main changes:
- Replace GPLv3 headers with AGPLv3 headers in source files.
- Update LICENSE file to the full AGPLv3 text.
- Add ENTERPRISE.md describing the dual-licensing model:
  * Community Edition: AGPLv3 (strong copyleft, including network use).
  * Enterprise / Commercial Edition: proprietary license for production /
    multi-user / OEM use without the obligation to disclose derivative code.
- Update README with a new "License and Commercial Use" section pointing to
  ENTERPRISE.md and clarifying how companies can obtain a commercial license.

Why this change:
- AGPLv3 ensures that modified versions offered as a service or deployed
  in production environments must provide corresponding source code.
- The Enterprise / Commercial edition provides organizations with an
  alternative proprietary license that allows internal, large-scale, or OEM
  use (bulk provisioning, policy enforcement, inventory / revocation,
  custom attestation, signed builds) without AGPL disclosure obligations.

This commit formally marks the first release that is dual-licensed:
AGPLv3 for the Community Edition and a proprietary commercial license
for Enterprise customers.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-10-26 20:06:16 +01:00
Pol Henarejos
233e6594c6
Add casts to fix warnings.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-10-12 18:52:07 +02:00
Pol Henarejos
d63ed56e0e
Fix phy_data idVendor/idProduct when not set.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-09-28 20:28:28 +02:00
Pol Henarejos
70c0c1bf81
Fix conditional build for non-pico platforms.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-09-23 16:59:59 +02:00
Pol Henarejos
cff3f8f677
Fix interface conditional builds.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-09-23 16:56:34 +02:00
Pol Henarejos
0b49fe4e1b
Fix build for non-pico boards.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-09-22 23:52:47 +02:00
Pol Henarejos
4edc506759
Fix build for non-pico boards.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-09-22 23:35:46 +02:00
Pol Henarejos
5f79a8c8ed
Fix ESP32 dynamic USB interfaces.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-03-24 09:22:25 +01:00
Pol Henarejos
a08abaed0f
Enable each USB interface independently depending on PHY parameters.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-03-22 23:25:31 +01:00
Pol Henarejos
f1b1382300
USB descriptors are now created dynamically.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-03-21 15:30:50 +01:00
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
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
Pol Henarejos
a816b6f747
Added PHY options to control the brigthness of the LED and its dimming.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-09-27 20:55:49 +02:00
Benoît Allard
7a0b67f3cb led: Rename 'blink' to 'mode' 2024-09-25 21:46:33 +02:00
Pol Henarejos
e8b060abb3
Call reset multicore before launching the thread.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-30 00:33:31 +02:00
Pol Henarejos
c2eda3ca53
Fix USB/CCID writes when APDU is longer than 64 bytes.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-26 22:41:46 +02:00
Pol Henarejos
ac2a6c1052
Init low flash in core1 in emulation mode.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-25 00:11:10 +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
7c76a71f33
Fix emulation build.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-19 13:18:03 +02:00
Pol Henarejos
0f24d17456
thread management is now in usb stuff. It ensures to launch an apdu/cbor thread depending on the processed packet.
It also includes a usb_rx_more to advance the rx pointer. It is useful to multiplex usb packets.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-08-19 00:02:15 +02:00
Pol Henarejos
f4ad8e1af2
Fix idVendor, idProduct allocation for Pico Patcher.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-07-15 14:41:08 +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
59597a0a68
Merge branch 'esp32' 2024-06-19 22:01:46 +02:00
Pol Henarejos
d458250887
Add PHY options and PHY_WCID.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-06-19 22:00:55 +02:00
Pol Henarejos
af20b4f894
Merge branch 'main' into esp32
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-28 19:26:08 +02:00
Pol Henarejos
fc5f4299cc
Fix emulation build.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-17 11:56:54 +02:00
Pol Henarejos
cf1e076453
Introducing EF_PHY to store PHY (VIDPID and LED no.).
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-17 11:40:01 +02:00
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
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
6f7ab69a9d
Added support for dynamic USB_VID / USB_PID.
It can be changed on runtime without rebuilding or patching.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-16 00:04:23 +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
7def35f87c
Remove carriage return \r for better debug.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-10 18:16:38 +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
e055d4cfc9
Added support for WebCCID.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-03-13 17:24:20 +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
899a7ed609
Move some functions from HID to fido callbacks.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-06 13:01:10 +01:00
Pol Henarejos
0663c694ef
Move timers.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-10-31 17:33:47 +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
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
86613453ae
Sending timeout command.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-03-03 00:48:42 +01: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
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
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