You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds another layer of testing opportunities, by introducing a
`TestChannel` that can be pre-filled with expected requests and
associated responses it should give.
I have used this to test `user_verification(..)` in various states of
complexity, and discovered a few bugs along the way.
Notable changes to make this possible:
- `PinUvAuthProtocol`s get a deterministic private key, to 'predict'
crypto results (for testing only!)
- Some (the ones I needed) Ctap2-response structs got a
`#[cfg_attr(test, derive(SerializeIndexed))]` to serialize them to CBOR,
before sending it back as if it were a real message from a device. This
should be easy to extend to other response structs, once they are
needed.
- Removed a second, subsequent `GetInfo`-call, by simply reusing the
result of the first call in `user_verification(..)`
- Fixed some corner cases in `user_verification(..)`, mostly around the
"shared secret only"-scenarios
- Renamed `ClientPinOnlyForSharedSecret` to `OnlyForSharedSecret` as
this is not bound to `ClientPin` anymore
- Added loads of tests. Still not exhaustive, though. More should be
written around full ceremony scenarios (I'll open tickets for some of
those, once this lands).
0 commit comments