-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add set_secret() and get_secret() for iOS impl. #188
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your definitions of set_secret
and get_secret
are perfect.
But, like the macOS implementation, you should have set_password
call set_secret
like this:
fn set_password(&self, password: &str) -> Result<()> {
self.set_secret(password.as_bytes())
}
and you should have get_password
call get_secret
like this:
fn get_password(&self) -> Result<String> {
let password_bytes = self.get_secret()?;
decode_password(password_bytes.to_vec())
}
Good call @brotskydotcom , thats done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Thank you so much!
I notice you convert to Edit: so if you prefer |
Can you please update README.md to add your name in the contributor's list? |
Well the definition of decode_password is shared across platforms and most of the others have already done the vector conversion. But I still like the optimization you suggest in the iOS case, because password_bytes is already a Vec when it comes back from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one last fix needed.
Whoops. Just noticed one more fix needed to get the example library working on iOS: You need to change line 92 from
to
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks for keeping at it!
Closes #187.