823 Commits

Author SHA1 Message Date
Tobias Wiese
a94e52cb9e nfc_linux: Don't close stdin if fido_nl_new fails
The call to nfc_free is not needed because when calloc fails ctx will be
NULL and nfc_free will do nothing, when fido_nl_new() fails ctx->nl will
be null and does not need to be freed.
Additionally ctx->fd is 0 (due to calloc zero-initializing ctx) and
should not be closed.
Therefore I replaced this with a free call to just undo the (potential)
allocation by calloc.

Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
2025-12-19 08:46:52 +01:00
Ludvig Michaelsson
b23d41ba41 u2f: enforce a minimum transaction timeout of 20 ms
If we send an APDU without enough time to also read the response, the
next `fido_dev_*()` call may fail spuriously due to there being data
left to read on the bus. To prevent this to the best of our abilities,
enforce a minimum remaining timeout for each `fido_{tx,rx}()` pair.
The exception to this rule is the selection algorithms which are left
the application is responsible for pacing in a sensible manner (the
transaction happens across multiple function calls).

If an application finds itself in a broken state, it can recover by
requesting a new channel ID via closing and re-opening the `fido_dev_t`.

This resolves #917.
2025-12-17 14:06:21 +01:00
Ludvig Michaelsson
62ce5dc108 credman: add support for the third party payment flag 2025-12-08 09:50:01 +01:00
Ludvig Michaelsson
4c7dd494c8 assert: support the thirdPartyPayment extension 2025-12-08 09:50:01 +01:00
Ludvig Michaelsson
87b6f34a22 cred: support the thirdPartyPayment extension 2025-12-08 09:50:00 +01:00
Ludvig Michaelsson
2549b165f8 ecdh: const-qualify hkdf_sha256() arguments
This drops OpenSSL 1.1 support.
2025-12-08 09:13:20 +01:00
Ludvig Michaelsson
bafc045def extern: drop redundant argument name 2025-12-08 08:42:26 +01:00
Ludvig Michaelsson
6fb1be87c0 misc: drop trailing whitespace 2025-12-08 08:42:23 +01:00
Ludvig Michaelsson
9f3e3a40ad winhello: support 64 byte hmac-salt 2025-11-05 11:36:45 +01:00
Ludvig Michaelsson
f60855b055 winhello: add pack_hmac_salt() helper function 2025-11-05 08:54:41 +01:00
Ludvig Michaelsson
fb71161544 winhello: support hmac-secret-mc 2025-11-04 16:12:56 +01:00
Ludvig Michaelsson
218ea7282c winhello: refactor helper functions for unpacking hmac-secret 2025-11-04 16:12:56 +01:00
Ludvig Michaelsson
788feb88d3 winhello: pass options to pack_cred_ext()
We'll need to modify the outer structure for hmac-secret-mc.
2025-11-04 16:12:52 +01:00
Ludvig Michaelsson
6b73969827 misc: update webauthn.h
As retrieved from microsoft/webauthn@0ef86c2fe3.
2025-11-04 09:24:57 +01:00
Ludvig Michaelsson
45f62368f4 cred: support the hmac-secret-mc extension 2025-10-31 09:29:58 +01:00
Ludvig Michaelsson
d84a7bd67c cbor: add key parameter to cbor_encode_hmac_secret_param() 2025-10-31 09:29:58 +01:00
Ludvig Michaelsson
4b4d13714e cbor: move definition of cbor_encode_hmac_secret_param()
No functional change.
2025-10-31 09:29:57 +01:00
Ludvig Michaelsson
6a75083610 cred: move fido_do_ecdh() up to top level call
We'll need this both for improved PUAT handling and `hmac-secret-mc`.
While here, move early error handling up as well.
2025-10-31 09:29:57 +01:00
Ludvig Michaelsson
f81ef5787c cred: split extension inputs and outputs
Just like assert, we'll need a separate struct for extension inputs
versus outputs. While here, move the credBlob attribute into the new
extension inputs.
2025-10-31 09:06:25 +01:00
Ludvig Michaelsson
46dca4f0ee info: add fido_cbor_info_encstate_{len,ptr}() 2025-10-29 12:30:43 +01:00
Ludvig Michaelsson
d8d0b67e79 info: add fido_cbor_info_maxpinlen() 2025-10-29 09:10:29 +01:00
Ludvig Michaelsson
4f3ca9134d info: add fido_cbor_info_pin_policy_url_{ptr,len}() 2025-10-29 09:10:24 +01:00
Ludvig Michaelsson
118963dfad info: adjust error handling for consistency 2025-10-28 16:54:13 +01:00
Ludvig Michaelsson
dec7d0939f info: add fido_cbor_info_pin_policy() 2025-10-28 15:45:51 +01:00
Ludvig Michaelsson
62335f2d64 info: add fido_cbor_info_reset_transports_{len,ptr}() 2025-10-28 13:22:06 +01:00