-
Notifications
You must be signed in to change notification settings - Fork 50
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 - [ ] New feature development - [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ``` ## Objective Use Sensitive in MasterKey and bubble up the Sensitive change for all the requests that contain a password or pin. Note that this requires changing the request structs to be taken by value.
- Loading branch information
1 parent
a08143d
commit e0eb659
Showing
29 changed files
with
242 additions
and
167 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ fn test_auth_request() { | |
mod tests { | ||
use std::num::NonZeroU32; | ||
|
||
use bitwarden_crypto::Kdf; | ||
use bitwarden_crypto::{Kdf, SensitiveVec}; | ||
|
||
use super::*; | ||
use crate::mobile::crypto::{AuthRequestMethod, InitUserCryptoMethod, InitUserCryptoRequest}; | ||
|
@@ -132,7 +132,7 @@ mod tests { | |
let mut client = Client::new(None); | ||
|
||
let master_key = bitwarden_crypto::MasterKey::derive( | ||
"asdfasdfasdf".as_bytes(), | ||
&SensitiveVec::test(b"asdfasdfasdf"), | ||
"[email protected]".as_bytes(), | ||
&Kdf::PBKDF2 { | ||
iterations: NonZeroU32::new(600_000).unwrap(), | ||
|
@@ -206,9 +206,12 @@ mod tests { | |
// Initialize an existing client which is unlocked | ||
let mut existing_device = Client::new(None); | ||
|
||
let master_key = | ||
bitwarden_crypto::MasterKey::derive("asdfasdfasdf".as_bytes(), email.as_bytes(), &kdf) | ||
.unwrap(); | ||
let master_key = bitwarden_crypto::MasterKey::derive( | ||
&SensitiveVec::test(b"asdfasdfasdf"), | ||
email.as_bytes(), | ||
&kdf, | ||
) | ||
.unwrap(); | ||
|
||
existing_device | ||
.initialize_user_crypto_master_key(master_key, user_key, private_key.parse().unwrap()) | ||
|
Oops, something went wrong.