-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support DeviceCert model as well as the AliasCert model #83
Conversation
The slot_id{} check is outdated, we don't seem to ever create the file so let's remove it. Signed-off-by: Alistair Francis <[email protected]>
Move the current certificates under the alias directory and also support device certificates. Signed-off-by: Alistair Francis <[email protected]>
Signed-off-by: Alistair Francis <[email protected]>
6978819
to
e6bc4f0
Compare
Signed-off-by: Alistair Francis <[email protected]>
e6bc4f0
to
b008282
Compare
} else if certificate_model == "device" { | ||
CertModel::Device | ||
} else { | ||
panic!("Unsupported certificate model"); |
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.
the else can be removed, since certificate_model
default to "alias". That part should be unreachable.
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 need the else
otherwise Rust throws us
error[E0317]: `if` may be missing an `else` clause
--> src/main.rs:408:20
|
408 | } else if certificate_model == "device" {
| ____________________^
409 | | CertModel::Device
| | ----------------- found here
410 | | };
| |_____________^ expected `CertModel`, found `()`
|
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
Plus it protects us if we support more models in the future
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, were you able to test this over the sockets?
Yeah, it works with both Alias and Device certificates |
We currently only support AliasCert modes.
This PR implements DeviceCert support, with AliasCert still the default. This makes the requester more dynamic and adds the option
--certificate-model device
to responders to specify the DeviceCert model.