-
Notifications
You must be signed in to change notification settings - Fork 20
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 sevctl measurement build
#68
Conversation
d2ae085
to
6061d98
Compare
6061d98
to
8a97317
Compare
8a97317
to
919e57d
Compare
sevctl measurement build
sevctl measurement build
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.
LGTM.
Assembles the measurement from the follow options --api-major INT --api-minor INT --policy INT --build-id INT --nonce BASE64 --tik FILENAME --launch-digest BASE64 And spits out a base 64 string Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Same with --nonce Signed-off-by: Cole Robinson <crobinso@redhat.com>
If specified, we dump binary content to the specified file, rather than base64 to stdout Signed-off-by: Cole Robinson <crobinso@redhat.com>
--firmware can be specified independently. --kernel --initrd --cmdline expect OVMF firmware and must be specified as a trio
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Allow passing in base64 representation of the full output of the LAUNCH_MEASURE firmware command, like returned by qemu `query-sev-launch-measure` and/or `virsh domlaunchsecinfo` This saves users the pain of peeling the nonce out of that base64 value Signed-off-by: Cole Robinson <crobinso@redhat.com>
The LAUNCH_MEASURE firmware call returns measurement+nonce. Arguably this is two values, but qemu and libvirt treat this blob as opaque and return it straight to the user. Because of this, it's kind of ambiguous what `measurement` should refer to here: the entire blob, or the value with the nonce removed. `sevtool calc_measurement` returns the latter, but I expect most tools will want to use qemu and/or libvirt. Change the measurement output to return the measurement+nonce format. If this is the wrong choice, we can add an --output-format option later. Signed-off-by: Cole Robinson <crobinso@redhat.com>
Would need some changes on sev crate side to plug existing code in here Signed-off-by: Cole Robinson <crobinso@redhat.com>
919e57d
to
8fc125f
Compare
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Return the Result object gives us better default error output. Example: $ sevctl vmsa build ... --firmware idontexist Before: Error: error loading firmware blob entries in OVMF After: Error: error loading firmware blob entries in OVMF Caused by: 0: error reading from firmware path file 1: No such file or directory (os error 2) Signed-off-by: Cole Robinson <crobinso@redhat.com>
These will be used in an upcoming patch Signed-off-by: Cole Robinson <crobinso@redhat.com>
Build header and payload binary files, for use with qemu's sev-inject-launch-secret / virsh domsetlaunchsecstate Secrets are injected with one or more --secret UUID:FILENAME options Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
8fc125f
to
79eaf6d
Compare
@tylerfanelli I added |
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 Cole. I've just left 2 comments, however they are not immediate problems. Let me know what you think, and we can merge.
446f2e1
to
79eaf6d
Compare
This adds
sevctl measurement build
for spitting out a measurement+nonce blob, like we get from qemu and libvirt for a running VM.Patches tell the story. One note is that this doesn't use
sev
crate existing Session bits to build the measurement. Thesev
crate will need some tweaks for us to use it here. And in the end it would only save maybe 7-8 lines of code.