Commit Graph

34 Commits

Author SHA1 Message Date
Pol Henarejos
ed848d005f Fix curious bug when FIDO+OpenPGP+CCID connection is used in some circumstances.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-11-15 21:12:47 +01:00
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
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
d66d1c85b9 Add missing header.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-06-22 19:52:36 +02:00
Pol Henarejos
eb75ad4efa Add app_exists() to check if an AID is loaded. 2025-05-25 19:07:20 +02: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
e70552a298 Move debug to dedicated header
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-09-11 23:15:09 +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
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
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
29837e5691 Fix Pico build.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-01-02 20:43:15 +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
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
dbfb89f959 Add plaintext debug payload.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-10-11 12:12:41 +02: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
31e66007d3 Fix embeding res_APDU.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-03 17:24:45 +01:00
Pol Henarejos
7293683906 Using correct packed form.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-01-13 18:53:56 +01:00
Pol Henarejos
5d2dd5aa75 Compilation fixes
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-01-13 18:48:40 +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
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
286858c907 Compact debug.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-27 22:07:15 +02:00
Pol Henarejos
e1914556ec Fix debug_data
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 09:59:02 +02:00
Pol Henarejos
287be74921 Adding macro for easy debug.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 09:29:43 +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
a6506e6c95 Adding missing headers.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-02 19:08:33 +02:00
Pol Henarejos
214ec2b9ae Adding support for U2F_MSG 2022-09-02 18:02:31 +02:00
Pol Henarejos
13983bdd68 Fix compiling with disabled debug apdu. 2022-08-30 16:57:12 +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