Fix #319: CTAP2.0 bug in preflighting, which can omit credential data #320
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix bug in preflighting, where CTAP2.0 devices can omit the credential data if the allow_list is of length one. Without this fix, those answer get ignored and the device discarded as being not useable.
Adding a bunch of prefligh-tests. For this, I had to extend the mock device to be able to skip the low-level byte-by-byte comparison of incoming and outgoing data, and instead use CTAP requests and responses directly, for higher-level business-logic testing.
Now, we can add what requests we expect, and what responses the mock device should give.
For this, CTAP-responses have to be marked with their own marker trait, so that we can collect all different responses as
dyn std::any::Any
in a singleVec
. For that, responses have to be marked'static
(required byAny
), but since all of our Responses are'static
, this is currently not a problem.And a new TestDevice-trait has been added, which is a no-op implementation in release-mode, but gives us the ability to skip the low-level serialization of requests. Only the mock-device actually implements something.
It is currently decided upon creation of the device (using the two
new*()
-functions), if it should skip the serialization or not.