-
Notifications
You must be signed in to change notification settings - Fork 58
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
Implement revocation service from Python code #134
Conversation
Will fix format issues |
2c21930
to
8da03b7
Compare
c9dccd7
to
e3a2016
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.
I think this makes sense, with the caveat that it should get some more sets of eyes as I'm new to Keylime.
The code looks good to me. Would it take much to refactor into a The other thing would be some unit tests, but I am understanding this might not be easy with ZMQ and might be more suited to a functional / integration test. |
@lukehinds That's a good idea. I'll move it out into it's on file and have it utilized in |
Updated |
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.
Please fix the comments I pointed out. There's a few more .expect()
uses.
Updated based on @puiterwijk's review. |
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.
A few more notes remaining, but starting to look decent!
src/revocation.rs
Outdated
"Loading the revocation certificate from {}", | ||
revocation_cert_path | ||
); | ||
match crypto::rsa_import_pubkey(revocation_cert_path.clone()) { |
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.
If rsa_import_pubkey
had accepted an &str
, you wouldn't have needed to .clone()
the path here. That's exactly why that is more idiomatic 😄
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.
Makes sense, thanks! I've updated the others but I'll leave this one be for now since it's in rsa_import_pubkey
.
|
||
// Verify the message and signature with our key | ||
let mut verified = | ||
crypto::rsa_verify(cert_key.clone(), message, signature); |
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.
Is there any chance cert_key
could be given as a reference too (&...
)? That would save us from having to clone()
every time we get a message.
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.
We can make rsa_verify
take a reference but once inside the function it seems like we need to clone for PKey::from_rsa
though I may be wrong. Thoughts?
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.
Bump :-)
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 am good with this now, @puiterwijk if @ashcrow answer satisfies you, we can merge this
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.
Sure. Let's merge it like this and improve later.
5e91178
to
6bd2da8
Compare
Rebased |
Will rebase shortly |
Rebased! |
Bump |
hey @puiterwijk this needs approval from you as well (changes requested) |
@puiterwijk ,please ack if the review request is resolved, so we can merge this. I am sure we will revisit the code again once then parts are rigged together. |
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.
Sorry for forgetting to hit the Approve button. Thanks for the PR!
Bah! Needs another rebase! |
Signed-off-by: Steve Milner <[email protected]>
Signed-off-by: Steve Milner <[email protected]>
Verify remote messages against signatures via rsa_verify Signed-off-by: Steve Milner <[email protected]>
206e16e
to
af64084
Compare
hey @ashcrow , keen to approve this for you. It seems all we have now are some redundant clones (see CI 'Fedora tests'). If you could make another quick commit I would like to merge this and start rigging up the revocation actions. |
Closes: keylime#92 Signed-off-by: Steve Milner <[email protected]>
Signed-off-by: Steve Milner <[email protected]>
Signed-off-by: Steve Milner <[email protected]>
Looks like this resolves #92 (hopefully this comment will link it) |
Adds:
rsa_verify
functionrun_revocation_service
implementationNote: Callback is not implemented here.
See: #92