Commit Graph

53 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
9b294b9685 Fix build
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-09-30 17:25:55 +02:00
Pol Henarejos
1a1d03ab2f Add compatibility for non-pico boards.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-09-24 01:11:19 +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
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
202d32d13d Fix descriptor description when there are disabled interfaces.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-09-02 01:20:07 +02:00
Pol Henarejos
a324477a8a Fix interface descriptor when HID is disabled.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-05-02 18:28:38 +02:00
Pol Henarejos
3990e7643a Fix EPNUM counting for ESP32. It fixes the problem of not sending KB.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-04-06 18:31:01 +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
f06cb3a96d Fix multiple interfaces in older PCSC versions.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-02-12 13:25:23 +01:00
Pol Henarejos
350f0da763 Fix USB keyboard descriptor.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-01-29 13:21:17 +01:00
Pol Henarejos
a081a2bde6 LibCCID allows propietary class for CCID (ALLOW_PROPIETARY_CLASS in LibCCID). Then both interfaces are loaded but since both belong to same device, only the last is opened.
We change maxSlot value even it breaks the ICCD spec to cause a timeout in LibCCID and deactivate WebCCID interface.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-01-17 20:56:03 +01:00
Pol Henarejos
046bac42e3 Update CCID descriptor to reflect max USB transport size.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-12-24 02:05:07 +01:00
Pol Henarejos
585a6d77e3 Use USB product field in the descriptor.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-12-17 16:27:11 +01:00
Pol Henarejos
cb4e2ba0eb Fixes for ESP32-S3:
- It only supports 4 IN endpoints, so 1 EP must be removed (INT of CCID).
- It only supports 8 strings max.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-12-11 12:14:31 +01:00
Pol Henarejos
5f27c0d75d Fix esp32 build with wcid.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-11-06 17:11:39 +01:00
Pol Henarejos
3dbf969e12 WCID interface is always enabled.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-11-06 17:02:38 +01:00
Pol Henarejos
0edb1f370f Fix HID report descriptors.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-11-05 15:23:34 +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
f8a05f4832 Fix maxPower and dwProtocols (recover T=0).
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-09-12 19:42:49 +02:00
Pol Henarejos
294c1fdf41 Fix USB descriptor in case only HID is enabled.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-09-02 09:46:51 +02:00
Pol Henarejos
5c11db54ae BCD must be 2.0 for compatibility with windows.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-06-27 21:01:22 +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
f0074e5367 CCID and WCID structs not used.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-22 23:35:19 +02:00
Pol Henarejos
0535138211 Only T=1 protocol is supported.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-21 22:52:16 +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
a7be923783 ITF WCID can be compiled separately.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-15 23:44:12 +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
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
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
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
c896741114 Report descriptor shall contain FEATURE report too for Windows compatibility.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-10-28 20:32:31 +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
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
e44fde509b Added support for Interrupt endpoint.
It is only used to inform the host changes on card status (insert or removal). Actually it only notifies the insertion of the virtual card on connect.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-17 19:43:26 +01:00
Pol Henarejos
fc40588547 Fixes for FIDO with Pico SDK 1.5
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-17 11:49:09 +01:00
Pol Henarejos
e47c5412cf Fixes for Pico SDK 1.5
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-16 22:54:30 +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
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
e99757ed52 Fix with size of descriptor in single interface mode.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-20 23:51:14 +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
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