From c41c9172be013d6f10b9e1d7286fcb021805d5a5 Mon Sep 17 00:00:00 2001 From: Tyler Fanelli Date: Mon, 7 Aug 2023 20:23:41 -0400 Subject: [PATCH] Bump minor version to 0.4.3 Signed-off-by: Tyler Fanelli --- Cargo.lock | 37 +++++++++++++++++++++++++++---------- Cargo.toml | 4 ++-- src/main.rs | 37 ++++++++++++++++++------------------- src/measurement.rs | 4 ++-- src/ok.rs | 17 +++++++++-------- src/secret.rs | 9 +++++---- src/session.rs | 17 +++++++++-------- src/vmsa/build.rs | 5 +++-- src/vmsa/mod.rs | 15 ++++++++------- src/vmsa/show.rs | 5 +++-- src/vmsa/update.rs | 5 +++-- 11 files changed, 89 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3c8232..f27328e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -181,22 +181,23 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "dirs" -version = "4.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -386,6 +387,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "http" version = "0.2.9" @@ -709,6 +716,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "percent-encoding" version = "2.3.0" @@ -927,9 +940,9 @@ dependencies = [ [[package]] name = "serde-big-array" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3323f09a748af288c3dc2474ea6803ee81f118321775bffa3ac8f7e65c5e90e7" +checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" dependencies = [ "serde", ] @@ -979,15 +992,16 @@ dependencies = [ [[package]] name = "sev" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c8ec2a5131be61bba9ffad92aead45bd27805c9701d265b7196d4914299b98" +checksum = "7fd749a01c88a51ac718b59fe571177b31e478dfe059267977042477a0531224" dependencies = [ "bincode", "bitfield 0.13.2", "bitflags", "codicon", "dirs", + "hex", "iocuddle", "kvm-ioctls", "openssl", @@ -1000,7 +1014,7 @@ dependencies = [ [[package]] name = "sevctl" -version = "0.4.1" +version = "0.4.3" dependencies = [ "anyhow", "base64 0.13.1", @@ -1289,6 +1303,9 @@ name = "uuid" version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +dependencies = [ + "serde", +] [[package]] name = "vcpkg" diff --git a/Cargo.toml b/Cargo.toml index 91c8a02..243bea6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sevctl" -version = "0.4.2" +version = "0.4.3" authors = ["The Enarx/VirTEE Project Developers"] edition = "2018" license = "Apache-2.0" @@ -22,7 +22,7 @@ is-it-maintained-issue-resolution = { repository = "virtee/sevctl" } is-it-maintained-open-issues = { repository = "virtee/sevctl" } [dependencies] -sev = { version = "1.1.0", features = ["openssl"] } +sev = { version = "1.2.0", default-features = false, features = ["sev", "openssl"] } serde = { version = "1.0", features = ["derive"] } # serde_json is just for the example, not required in general serde_json = "1.0" diff --git a/src/main.rs b/src/main.rs index e10a528..49a7d13 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,26 +8,24 @@ mod secret; mod session; mod vmsa; -use anyhow::{Context, Result}; - -use structopt::StructOpt; - -use codicon::*; +use crate::vmsa::*; -use ::sev::certs::*; -use ::sev::firmware::host::{ - types::{PlatformStatusFlags, Status}, - Firmware, +use std::{ + fs::File, + io::{self, Cursor}, + path::PathBuf, + process::exit, + time::Duration, }; -use ::sev::Generation; - -use std::fs::File; -use std::io::{self, Cursor}; -use std::path::PathBuf; -use std::process::exit; -use std::time::Duration; -use crate::vmsa::*; +use ::sev::{ + certs::sev::*, + firmware::host::{Firmware, PlatformStatusFlags, Status}, + Generation, +}; +use anyhow::{Context, Result}; +use codicon::*; +use structopt::StructOpt; const VERSION: &str = env!("CARGO_PKG_VERSION"); const AUTHORS: &str = env!("CARGO_PKG_AUTHORS"); @@ -364,9 +362,10 @@ mod export { mod verify { use super::*; + + use std::{convert::TryInto, fmt::Display}; + use colorful::*; - use std::convert::TryInto; - use std::fmt::Display; pub fn cmd( quiet: bool, diff --git a/src/measurement.rs b/src/measurement.rs index 7eda5b0..0a13969 100644 --- a/src/measurement.rs +++ b/src/measurement.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 +use super::*; + use std::path::{Path, PathBuf}; use structopt::StructOpt; -use anyhow::Context; - #[derive(StructOpt)] pub enum MeasurementCmd { Build(BuildArgs), diff --git a/src/ok.rs b/src/ok.rs index 61fc878..e5f513d 100644 --- a/src/ok.rs +++ b/src/ok.rs @@ -1,17 +1,18 @@ // SPDX-License-Identifier: Apache-2.0 use super::*; -use colorful::*; -use std::arch::x86_64; -use std::fmt; -use std::fs; -use std::mem::transmute; -use std::mem::MaybeUninit; -use std::os::unix::io::AsRawFd; -use std::str::from_utf8; + +use std::{ + arch::x86_64, + fmt, fs, + mem::{transmute, MaybeUninit}, + os::unix::io::AsRawFd, + str::from_utf8, +}; use anyhow::anyhow; use bitfield::bitfield; +use colorful::*; use msru::{Accessor, Msr}; bitfield! { diff --git a/src/secret.rs b/src/secret.rs index d676046..0647de4 100644 --- a/src/secret.rs +++ b/src/secret.rs @@ -1,12 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -use std::convert::TryFrom; -use structopt::StructOpt; - -use anyhow::Context; +use super::*; use crate::measurement; +use std::convert::TryFrom; + +use structopt::StructOpt; + struct SecretPair { uuid: uuid::Uuid, secret: Vec, diff --git a/src/session.rs b/src/session.rs index 753f8ad..4d3b8f1 100644 --- a/src/session.rs +++ b/src/session.rs @@ -1,15 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 -use anyhow::Context; +use super::*; -use std::convert::{From, TryFrom}; -use std::fs; -use std::mem::size_of; -use std::path::PathBuf; -use std::slice::from_raw_parts; +use std::{ + convert::{From, TryFrom}, + fs, + mem::size_of, + path::PathBuf, + slice::from_raw_parts, +}; -use ::sev::certs::sev::Certificate; -use ::sev::{launch::sev, session}; +use ::sev::{certs::sev::sev::Certificate, launch::sev, session}; use codicon::{Decoder, Encoder}; diff --git a/src/vmsa/build.rs b/src/vmsa/build.rs index 31d05a1..bb34691 100644 --- a/src/vmsa/build.rs +++ b/src/vmsa/build.rs @@ -1,9 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 +use super::*; + use crate::{BuildUpdateCmdArgs, Ovmf, UserspaceVmm}; -use anyhow::Context; -use sev::vmsa::*; +use ::sev::vmsa::*; pub fn cmd(args: BuildUpdateCmdArgs) -> super::Result<()> { let mut vmsa = Vmsa::default(); diff --git a/src/vmsa/mod.rs b/src/vmsa/mod.rs index 9798c93..e1b27da 100644 --- a/src/vmsa/mod.rs +++ b/src/vmsa/mod.rs @@ -10,13 +10,14 @@ pub mod update; use super::*; -use std::collections::HashMap; -use std::convert::TryInto; -use std::fmt; -use std::fmt::Write; -use std::fs; -use std::str::FromStr; -use std::string::{ParseError, String}; +use std::{ + collections::HashMap, + convert::TryInto, + fmt::{self, Write}, + fs, + str::FromStr, + string::{ParseError, String}, +}; use uuid::{uuid, Uuid}; diff --git a/src/vmsa/show.rs b/src/vmsa/show.rs index 671212f..cff8dc4 100644 --- a/src/vmsa/show.rs +++ b/src/vmsa/show.rs @@ -1,9 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 +use super::*; + use crate::VmsaShowCmdArgs; -use anyhow::Context; -use sev::vmsa::*; +use ::sev::vmsa::*; pub fn cmd(args: VmsaShowCmdArgs) -> super::Result<()> { let vmsa = Vmsa::from_file(&args.filename).context("error reading VMSA from file")?; diff --git a/src/vmsa/update.rs b/src/vmsa/update.rs index bd666f2..9c320b3 100644 --- a/src/vmsa/update.rs +++ b/src/vmsa/update.rs @@ -1,9 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 +use super::*; + use crate::{BuildUpdateCmdArgs, Ovmf, UserspaceVmm}; -use anyhow::Context; -use sev::vmsa::*; +use ::sev::vmsa::*; pub fn cmd(args: BuildUpdateCmdArgs) -> super::Result<()> { let mut vmsa = Vmsa::from_file(&args.filename).context("error reading VMSA from file")?;