-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Type of change ``` - [ ] Bug fix - [x] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ``` ## Objective This PR adds our fork of `passkey-rs` to bitwarden to implement the previously stubbed out API. With it come some changes: - Swapped most parts of the stubbed implementations to use `passkey-rs` instead - Some API callbacks were changed to take decrypted items, the clients would need these decrypted to show the user anyway, and we can skip a few rounds of decrypting/encrypting this way. Note that the FIDO2 credentials private keys are never exposed decrypted to the clients. - Added a separate `Fido2CredentialNewView`, the only difference being that it doesn't contain the private key. This is used to send to the clients in the cipher select callback. Everywhere else we send back the encrypted field but at this point we don't have a key to encrypt the field yet. We could send a dummy value but that seems error prone. - Changed `CheckUserOptions` to be a struct instead of an enum. This was a mistake from the previous PR. - Moved a lot of types that were previously distributed among a few files into a specific `types.rs` file. Also implemented conversion between these types and `passkey` types using `From`/`TryFrom` when possible. There are still some open questions: - Some of the callbacks from `passkey-rs` force us to return `StatusCode` or `Ctap2Error`, how do we want to handle these? At the moment I'm just logging the error and returing a constant value. Do we need specific error values for certain errors to be spec compliant? - The conversion from `Passkey` to `Fido2CredentialView` has a few hardcoded values, is that expected? - I left a few `// TODO(Fido2):` comments around to mention some other small questions I have --------- Co-authored-by: Andreas Coroiu <[email protected]>
- Loading branch information
1 parent
f1e6a33
commit ea93ac5
Showing
18 changed files
with
1,406 additions
and
614 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.