-
Notifications
You must be signed in to change notification settings - Fork 71
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 support for psa_generate_random
operation for MbedCrypto provider
#208
Add support for psa_generate_random
operation for MbedCrypto provider
#208
Conversation
8b782d3
to
6499343
Compare
Thanks for adding this! It will need new versions on |
Sounds good to me! 💯 |
2922af1
to
d49f50c
Compare
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.
All look good to me except for the peer credential authenticator 😄
return; | ||
} | ||
|
||
// Less than one in ~35 billion chance of collision. Should be good enough for our testing. |
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.
This is PR bingo, who will be the winner PR making that test fail 😮 ?
@@ -0,0 +1,45 @@ | |||
// Copyright 2019 Contributors to the Parsec project. |
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.
Should we commit that file in this PR? Are you trying to sneakily make it in 👀 ?
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.
Haha, oops. Removed. 😄
d49f50c
to
ae414f6
Compare
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.
🥂
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.
Thanks! 💯
src/providers/mod.rs
Outdated
/// Execute a GenerateRandom operation. | ||
fn psa_generate_random( | ||
&self, | ||
_app_name: ApplicationName, |
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.
I'd argue against requesting an app_name
. The operation can then be performed even for non-authenticated users, I think that should be alright!
}), | ||
Err(error) => { | ||
let error = ResponseStatus::from(error); | ||
format_error!("Generate random status: ", error); |
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.
format_error!("Generate random status: ", error); | |
format_error!("Generate random status", error); |
The format_error!
macro adds the :
for you, but maybe I should change that since everyone seems tempted to use it as the normal error!
pub(super) fn psa_generate_random_internal( | ||
&self, | ||
_app_name: ApplicationName, | ||
op: psa_generate_random::Operation, | ||
) -> Result<psa_generate_random::Result> { |
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.
Now that I look at it, you could just put this one straight in the psa_generate_random
method, there isn't that much code to warrant an _internal
one, but feel free to keep it here
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.
I think I'll leave this -- it looks like most of the operations have an *_internal
method. If you have strong opinions here feel free to reply and I'll change. 😄
ca95108
to
9a25f8f
Compare
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.
Looks good!
1ff71d0
to
ab9c964
Compare
Signed-off-by: Joe Ellis <joe.ellis@arm.com>
ab9c964
to
6550709
Compare
This patch adds support for the
psa_generate_random
operation for the MbedCrypto provider. Once again, I am expecting this to fail CI because it's dependent on the other patches. 😄