-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement HMAC secret extension (#83)
This is working, but I'll mark it as WIP for now, as we may want to incorporate extensions-related issues in here as well. Noteworthy things here: - `Ctap2PinUvAuthProtocol` got a new function to create a boxed `PinUvAuthProtocol`-object out of a given protocol version, as handing around the boxed dyn-trait object is quite annoying. - I extended what will be saved in the channel wrt to auth_token-stuff, as we need the shared_secret, the key_agreement and the used protocol version in order to be able to process the HMAC input AND output. At least, with this, I could de-duplicate `get_uv_auth_token()`. However, there is also potentially a problem here, as we currently always create a shared_secret, which we shouldn't do in the CTAP 2.0 case, see also mozilla/authenticator-rs#341 - Extension input exists in two versions: `HMACGetSecretInput` as given by the user via `GetAssertionResponseExtensions`. This is remapped to `CalculatedHMACGetSecretInput` and `Ctap2GetAssertionRequestExtensions`, respectively. `CalculatedHMACGetSecretInput` holds both the user-input and the info we will send to the device (as we need to cache the user-input somewhere, to calculate the actual hmac-secret input when we have established a shared_secret). - `HMACGetSecretOutput` works similarly in reverse, but I currently don't rewrap to a new struct. The resulting output will contain the encrypted message from the device and the decrypted info. The encrypted message is marked private, though. Maybe we can work out a more generic way here, to close some of the open `[Extensions]`-issues.
- Loading branch information
1 parent
bbbc26c
commit 60d6f5b
Showing
11 changed files
with
314 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.