Commit Graph
35 Commits
Author SHA1 Message Date
Robin Krahl e9dfefd715 tests: Add credential management tests
This patch introduces the authenticator module that provides a
simple high-level interface for testing FIDO2 functionality.  It uses
the module to implement tests for credential management, namely for
listing credentials and for the behavior if the credential limit is
reached or the filesystem is full.
2024-10-23 16:00:16 +02:00
Robin Krahl 09271b68b4 Add tests for attestation formats preference 2024-06-27 12:50:58 +02:00
Robin Krahl 30e2b909ad Implement third-party payment extension 2024-06-27 12:50:57 +02:00
Robin Krahl 4f52ab13ab tests: Add get_assertion test 2024-06-27 10:51:33 +02:00
Robin Krahl ca493254b8 tests: Setup attestation certificate and key 2024-06-24 20:17:44 +02:00
Robin Krahl 07ff03b4ed Accept scoped PIN tokens for EnumerateCredentialsBegin
As described in #80, we currently require PIN tokens without an RP ID
restriction for all credential management operations.  For most
operations, this is correct.

For EnumerateCredentialsBegin, we should also accept a token that
matches the requested RP ID hash.  For DeleteCredential and
UpdateUserInformation, we should also accept a token that matches the
requested credential ID.  As it is not trivial to compare the RP ID hash
or the credential ID against the RP ID set for the PIN token, I did not
handle these cases in the initial implementation.

This led to an incompatibility with libfido2 because it tries to use a
restricted PIN token to enumerate credentials.  With this patch, we
additionally compute the RP ID hash when restricting a PIN token to an
RP ID and use that to validate the PIN token for
EnumerateCredentialsBegin operations.

For DeleteCredential and UpdateUserInformation, we still require tokens
without an RP ID restriction because determining the RP ID from the
credential ID is much harder and this is not known to cause
incompatibility issues.

See also: https://github.com/Nitrokey/fido-authenticator/issues/80
2024-05-23 12:01:39 +02:00
Robin Krahl a2b0280e93 tests: Add basic tests for credential management 2024-05-22 23:39:57 +02:00
Robin Krahl efed1896bc tests: Add Request trait and reply types 2024-05-22 22:55:32 +02:00
Robin Krahl aad05b9573 tests: Handle CTAP2 errors 2024-05-22 11:03:00 +02:00
Robin Krahl 7db98dd731 Setup basic integration tests
This patch adds basic integration tests that use the ctaphid library to
send CTAPHID commands to the authenticator over ctaphid-dispatch.
Unfortunately, usbd-ctaphid does not provide a public interface to its
packet handling code, so we have to copy that code for the time being.
2024-03-21 21:16:42 +01:00