187 Commits
Author SHA1 Message Date
Sammy ETUR 450fd96381 piv: implement ECDH key agreement (tag 0x85)
Add tag 0x85 parsing and ECDH shared secret computation for P-256 and
P-384 curves using mbedtls_ecdh APIs. The peer's uncompressed public key
is read from tag 0x85, the card's private key is loaded, and the shared
secret is returned in tag 0x82 within a 0x7C dynamic authentication
template, per NIST SP 800-73-4.

Unsupported algorithms (e.g. X25519, RSA) return SW_INCORRECT_P1P2."
2026-03-03 02:53:58 +01:00
Pol Henarejos 924b4831b1 Upgrade to v4.4
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2026-01-28 01:02:42 +01:00
Pol Henarejos 6af4cef91b Use new layout
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2026-01-22 12:14:27 +01:00
Pol Henarejos 551334a447 Clear dek on error.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2026-01-22 12:14:12 +01:00
Pol Henarejos 822038aba2 Upgrade to v4.2
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2026-01-05 19:53:41 +01:00
Pol Henarejos 353471c599 Revert "Move EDDSA to another branch."
This reverts commit b1421e176b.
2025-12-11 19:36:39 +01:00
Pol Henarejos b1421e176b Move EDDSA to another branch.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-12-09 16:07:34 +01:00
Pol Henarejos 2a14c771cb Move is_gpg flag for fido2.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-12-07 20:35:08 +01:00
Pol Henarejos 90e77f7c61 Yubico and GnuPG interpretate the standard in different ways. While Yubico follows strictly the spec and expects the TAG encapsulating the output of GET_DATA, GnuPG expects consecutive DO in the response.
A possible workaround is to detect whether sub-DO are called (GnuPG) or management AID is called (Yubico).

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-12-05 19:11:21 +01:00
Pol Henarejos 45d174b8bf Upgrade to v4.0
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-12-01 17:03:43 +01:00
Pol Henarejos 9742991deb Add version definitions.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-11-30 18:39:10 +01:00
Pol Henarejos 331f4f1c4e 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:24:47 +01:00
Pol Henarejos 41ae81067c Merge remote-tracking branch 'origin/main' 2025-07-09 09:39:05 +02:00
Pol Henarejos 9c878cc5b6 Fix PIV default keys indication.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-07-08 14:13:23 +02:00
Pol Henarejos 31ac28c7de Fix touch policy on mgmt key change.
Fixes #38.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-07-08 13:51:24 +02:00
Pol Henarejos a713eb4e03 Fix ESP32 build.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-06-22 20:22:38 +02:00
Pol Henarejos b62573a6bd Fix data checks.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-05-24 14:55:23 +02:00
Pol Henarejos 58a9d9cf97 Fix reset retry when OTP is enabled.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-05-24 14:55:23 +02:00
Pol Henarejos bc9681e7b0 Add support for EdDSA with Ed448 curve.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-05-24 14:55:23 +02:00
Pol Henarejos f34cdac00b Rename cmd_version to cmd_version_openpgp
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-05-24 14:50:17 +02:00
Pol Henarejos f9c1178f4d Move PRODUCT def to a separate file.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-05-24 14:49:48 +02:00
Pol Henarejos 68ac692de6 Rename scan_files to scan_files_openpgp
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-05-24 14:25:21 +02:00
Pol Henarejos 4480e29ecc Rename wait_button_pressed to wait_button_pressed_fid.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-05-24 14:22:37 +02:00
Pol Henarejos fccc48de43 Fix change PIN when no PIN was introduced before.
Fixes #32

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-05-12 11:16:18 +02:00
Pol Henarejos 6dbc8f8f56 Upgrade to v3.6
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2025-04-10 18:48:27 +02:00