From 9b7bb70b77cb64904684b6fcab244b20c2a9937a Mon Sep 17 00:00:00 2001 From: NikitaShyrei Date: Wed, 6 Mar 2024 16:36:03 +0100 Subject: [PATCH 01/10] - sgxs changes --- Cargo.lock | 7 +++---- intel-sgx/aesm-client/Cargo.toml | 3 +-- intel-sgx/aesm-client/src/error.rs | 17 +++++++++-------- intel-sgx/aesm-client/src/lib.rs | 4 +--- intel-sgx/sgxs/Cargo.toml | 4 ++-- intel-sgx/sgxs/src/einittoken.rs | 4 +--- intel-sgx/sgxs/src/lib.rs | 4 +--- intel-sgx/sgxs/src/loader.rs | 4 +--- intel-sgx/sgxs/src/sgxs.rs | 13 +++++++------ intel-sgx/sgxs/src/sigstruct.rs | 3 +-- 10 files changed, 27 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 36f65d60..dbde942b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,8 +28,6 @@ name = "aesm-client" version = "0.5.4" dependencies = [ "byteorder 1.3.4", - "failure", - "failure_derive", "lazy_static", "libloading 0.5.2", "protobuf", @@ -38,6 +36,7 @@ dependencies = [ "sgx-isa", "sgxs", "sgxs-loaders", + "thiserror", "unix_socket2", "winapi", ] @@ -3173,15 +3172,15 @@ dependencies = [ name = "sgxs" version = "0.7.4" dependencies = [ + "anyhow", "byteorder 1.3.4", "crypto-hash", - "failure", - "failure_derive", "foreign-types", "openssl", "openssl-sys", "sgx-isa", "sha2 0.8.2", + "thiserror", "time 0.3.26", ] diff --git a/intel-sgx/aesm-client/Cargo.toml b/intel-sgx/aesm-client/Cargo.toml index 0721f3cd..bd92b867 100644 --- a/intel-sgx/aesm-client/Cargo.toml +++ b/intel-sgx/aesm-client/Cargo.toml @@ -33,8 +33,7 @@ sgx-isa = { version = "0.4.0", path = "../sgx-isa"} byteorder = "1.0" # Unlicense/MIT lazy_static = "1" # MIT/Apache-2.0 protobuf = "2.22.1" # MIT/Apache-2.0 -failure = "0.1.1" # MIT/Apache-2.0 -failure_derive = "0.1.1" # MIT/Apache-2.0 +thiserror = "1.0" # MIT/Apache-2.0 [target.'cfg(unix)'.dependencies] # We require a version of unix-socket with the following change: diff --git a/intel-sgx/aesm-client/src/error.rs b/intel-sgx/aesm-client/src/error.rs index a0c92cfb..7a1beb4f 100644 --- a/intel-sgx/aesm-client/src/error.rs +++ b/intel-sgx/aesm-client/src/error.rs @@ -6,6 +6,7 @@ use std::io::Error as IoError; use std::result::Result as StdResult; +use thiserror::Error as ThisError; pub type Result = StdResult; @@ -126,19 +127,19 @@ impl From for AesmError { } } -#[derive(Fail, Debug)] +#[derive(ThisError, Debug)] pub enum Error { - #[fail(display = "aesm error code {:?}", _0)] + #[error("aesm error code {:?}", _0)] AesmCode(AesmError), - #[fail(display = "error communicating with aesm")] - AesmCommunication(#[cause] IoError), - #[fail(display = "missing expected {} payload in response from aesm", _0)] + #[error("error communicating with aesm")] + AesmCommunication(#[source] IoError), + #[error("missing expected {} payload in response from aesm", _0)] AesmBadResponse(String), - #[fail(display = "invalid quote type {}", _0)] + #[error("invalid quote type {}", _0)] InvalidQuoteType(u32), - #[fail(display = "invalid quote size")] + #[error("invalid quote size")] InvalidQuoteSize, - #[fail(display = "invalid token size")] + #[error("invalid token size")] InvalidTokenSize, } diff --git a/intel-sgx/aesm-client/src/lib.rs b/intel-sgx/aesm-client/src/lib.rs index 3881107d..60352f0b 100644 --- a/intel-sgx/aesm-client/src/lib.rs +++ b/intel-sgx/aesm-client/src/lib.rs @@ -15,9 +15,7 @@ #![deny(warnings)] extern crate byteorder; -pub extern crate failure; -#[macro_use] -extern crate failure_derive; +pub extern crate thiserror; #[macro_use] #[cfg(unix)] extern crate lazy_static; diff --git a/intel-sgx/sgxs/Cargo.toml b/intel-sgx/sgxs/Cargo.toml index 3d9e421e..183916cb 100644 --- a/intel-sgx/sgxs/Cargo.toml +++ b/intel-sgx/sgxs/Cargo.toml @@ -19,8 +19,8 @@ sgx-isa = { version = "0.4.0", path = "../sgx-isa" } # External dependencies byteorder = "1.0" # Unlicense/MIT time = { version = "0.3", features = ["formatting", "local-offset", "macros", "std"] } # MIT/Apache-2.0 -failure = "0.1.1" # MIT/Apache-2.0 -failure_derive = "0.1.1" # MIT/Apache-2.0 +thiserror = "1.0" # MIT/Apache-2.0 +anyhow = "1.0" # MIT/Apache-2.0 openssl = { version = "0.10", optional = true } # Apache-2.0 openssl-sys = { version = "0.9.24", optional = true } # Apache-2.0 foreign-types = { version = "0.3", optional = true } # MIT/Apache-2.0 diff --git a/intel-sgx/sgxs/src/einittoken.rs b/intel-sgx/sgxs/src/einittoken.rs index fae21f7f..896ee50f 100644 --- a/intel-sgx/sgxs/src/einittoken.rs +++ b/intel-sgx/sgxs/src/einittoken.rs @@ -7,8 +7,6 @@ use std::fmt; use std::io::{Read, Result as IoResult}; -use failure::Error; - pub use abi::Einittoken; use abi::{Attributes, Sigstruct}; @@ -24,7 +22,7 @@ pub trait EinittokenProvider: fmt::Debug { sigstruct: &Sigstruct, attributes: Attributes, retry: bool, - ) -> Result; + ) -> Result; /// Will this provider exhibit different behavior if `retry` is `true`? fn can_retry(&self) -> bool; diff --git a/intel-sgx/sgxs/src/lib.rs b/intel-sgx/sgxs/src/lib.rs index 050cc1e9..baa87251 100644 --- a/intel-sgx/sgxs/src/lib.rs +++ b/intel-sgx/sgxs/src/lib.rs @@ -9,7 +9,7 @@ html_root_url = "https://edp.fortanix.com/docs/api/")] extern crate byteorder; -extern crate failure; +extern crate thiserror; #[cfg(feature = "crypto-openssl")] extern crate foreign_types; #[cfg(feature = "crypto-openssl")] @@ -20,8 +20,6 @@ extern crate sgx_isa as abi; #[cfg(feature = "sha2")] extern crate sha2; extern crate time; -#[macro_use] -extern crate failure_derive; pub mod crypto; pub mod einittoken; diff --git a/intel-sgx/sgxs/src/loader.rs b/intel-sgx/sgxs/src/loader.rs index 7d07d07e..6f8b09b2 100644 --- a/intel-sgx/sgxs/src/loader.rs +++ b/intel-sgx/sgxs/src/loader.rs @@ -7,8 +7,6 @@ use std::fmt::Debug; use std::os::raw::c_void; -use failure::Error; - use abi::{Attributes, Miscselect, Sigstruct}; use sgxs::SgxsRead; @@ -47,5 +45,5 @@ pub trait Load { sigstruct: &Sigstruct, attributes: Attributes, miscselect: Miscselect, - ) -> Result, Error>; + ) -> Result, anyhow::Error>; } diff --git a/intel-sgx/sgxs/src/sgxs.rs b/intel-sgx/sgxs/src/sgxs.rs index c987178d..590a46a6 100644 --- a/intel-sgx/sgxs/src/sgxs.rs +++ b/intel-sgx/sgxs/src/sgxs.rs @@ -5,23 +5,24 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use abi::*; +use thiserror::Error as ThisError; use std::io::{self, Error as IoError, ErrorKind as IoErrorKind, Read, Result as IoResult, Write}; use std::result::Result as StdResult; -#[derive(Fail, Debug)] +#[derive(ThisError, Debug)] pub enum Error { - #[fail(display = "The stream is not canonical.")] + #[error("The stream is not canonical.")] StreamNotCanonical, - #[fail(display = "An invalid measurement tag {:016x} was encountered.", _0)] + #[error("An invalid measurement tag {:016x} was encountered.", _0)] InvalidMeasTag(u64), - #[fail(display = "The given offset is not a multiple of the page size.")] + #[error("The given offset is not a multiple of the page size.")] InvalidPageOffset, - #[fail(display = "An unsized stream was encountered but a sized stream was expected.")] + #[error("An unsized stream was encountered but a sized stream was expected.")] StreamUnsized, } -pub type Result = StdResult; +pub type Result = StdResult; // Doesn't work because large array: #[derive(Clone,Debug,Default)] pub enum Meas { diff --git a/intel-sgx/sgxs/src/sigstruct.rs b/intel-sgx/sgxs/src/sigstruct.rs index 4d56c4ff..4c17a25a 100644 --- a/intel-sgx/sgxs/src/sigstruct.rs +++ b/intel-sgx/sgxs/src/sigstruct.rs @@ -6,7 +6,6 @@ use std::io::{Read, Result as IoResult, Write}; -use failure::Error; use time::OffsetDateTime; use time::macros::format_description; @@ -29,7 +28,7 @@ impl EnclaveHash { self.hash } - pub fn from_stream(stream: &mut R) -> Result { + pub fn from_stream(stream: &mut R) -> Result { struct WriteToHasher { hasher: H, } From db29630a84426d0e366e78cdc816a9ca3eec8281 Mon Sep 17 00:00:00 2001 From: NikitaShyrei Date: Wed, 6 Mar 2024 18:06:26 +0100 Subject: [PATCH 02/10] - intermidiete --- Cargo.lock | 19 +++--- intel-sgx/aesm-client/Cargo.toml | 1 + intel-sgx/aesm-client/src/lib.rs | 3 +- intel-sgx/dcap-ql/Cargo.toml | 2 +- intel-sgx/dcap-ql/src/lib.rs | 2 +- intel-sgx/dcap-ql/src/quote.rs | 3 +- intel-sgx/dcap-retrieve-pckid/Cargo.toml | 2 +- intel-sgx/dcap-retrieve-pckid/src/lib.rs | 14 ++-- intel-sgx/enclave-runner/Cargo.toml | 4 +- intel-sgx/enclave-runner/src/command.rs | 2 +- intel-sgx/enclave-runner/src/library.rs | 2 +- intel-sgx/enclave-runner/src/loader.rs | 29 +++++---- intel-sgx/enclave-runner/src/usercalls/mod.rs | 6 +- intel-sgx/fortanix-sgx-tools/Cargo.toml | 4 +- .../src/bin/ftxsgx-elf2sgxs.rs | 22 +++---- .../src/bin/ftxsgx-runner-cargo.rs | 18 ++--- .../src/bin/ftxsgx-runner.rs | 4 +- intel-sgx/report-test/Cargo.toml | 2 +- intel-sgx/report-test/src/lib.rs | 9 ++- intel-sgx/sgxs-loaders/Cargo.toml | 4 +- intel-sgx/sgxs-loaders/src/generic.rs | 8 +-- intel-sgx/sgxs-loaders/src/isgx/mod.rs | 33 +++++----- intel-sgx/sgxs-loaders/src/lib.rs | 4 +- .../src/sgx_enclave_common/mod.rs | 65 ++++++++++--------- 24 files changed, 134 insertions(+), 128 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dbde942b..21104840 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,6 +27,7 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" name = "aesm-client" version = "0.5.4" dependencies = [ + "anyhow", "byteorder 1.3.4", "lazy_static", "libloading 0.5.2", @@ -613,9 +614,9 @@ dependencies = [ name = "dcap-ql" version = "0.3.7" dependencies = [ + "anyhow", "byteorder 1.3.4", "dcap-ql-sys", - "failure", "lazy_static", "libc", "mbedtls", @@ -645,8 +646,8 @@ name = "dcap-retrieve-pckid" version = "0.1.3" dependencies = [ "aesm-client", + "anyhow", "dcap-ql", - "failure", "report-test", "sgx-isa", "sgxs-loaders", @@ -823,9 +824,8 @@ dependencies = [ name = "enclave-runner" version = "0.5.2" dependencies = [ + "anyhow", "crossbeam", - "failure", - "failure_derive", "fnv", "fortanix-sgx-abi", "futures 0.3.17", @@ -837,6 +837,7 @@ dependencies = [ "openssl", "sgx-isa", "sgxs", + "thiserror", "tokio", ] @@ -1041,10 +1042,9 @@ name = "fortanix-sgx-tools" version = "0.5.1" dependencies = [ "aesm-client", + "anyhow", "clap", "enclave-runner", - "failure", - "failure_derive", "libc", "nix 0.13.1", "num_cpus", @@ -1053,6 +1053,7 @@ dependencies = [ "sgx-isa", "sgxs", "sgxs-loaders", + "thiserror", "toml 0.4.10", "xmas-elf", ] @@ -2840,8 +2841,8 @@ dependencies = [ name = "report-test" version = "0.3.3" dependencies = [ + "anyhow", "enclave-runner", - "failure", "sgx-isa", "sgxs", ] @@ -3189,14 +3190,14 @@ name = "sgxs-loaders" version = "0.3.3" dependencies = [ "aesm-client", + "anyhow", "bitflags", - "failure", - "failure_derive", "libloading 0.5.2", "nix 0.15.0", "report-test", "sgx-isa", "sgxs", + "thiserror", "winapi", ] diff --git a/intel-sgx/aesm-client/Cargo.toml b/intel-sgx/aesm-client/Cargo.toml index bd92b867..f353f27c 100644 --- a/intel-sgx/aesm-client/Cargo.toml +++ b/intel-sgx/aesm-client/Cargo.toml @@ -34,6 +34,7 @@ byteorder = "1.0" # Unlicense/MIT lazy_static = "1" # MIT/Apache-2.0 protobuf = "2.22.1" # MIT/Apache-2.0 thiserror = "1.0" # MIT/Apache-2.0 +anyhow = "1.0" # MIT/Apache-2.0 [target.'cfg(unix)'.dependencies] # We require a version of unix-socket with the following change: diff --git a/intel-sgx/aesm-client/src/lib.rs b/intel-sgx/aesm-client/src/lib.rs index 60352f0b..96a9f2c0 100644 --- a/intel-sgx/aesm-client/src/lib.rs +++ b/intel-sgx/aesm-client/src/lib.rs @@ -15,6 +15,7 @@ #![deny(warnings)] extern crate byteorder; +pub extern crate anyhow; pub extern crate thiserror; #[macro_use] #[cfg(unix)] @@ -267,7 +268,7 @@ impl EinittokenProvider for AesmClient { sigstruct: &Sigstruct, attributes: Attributes, _retry: bool, - ) -> StdResult { + ) -> StdResult { let token = self.get_launch_token( sigstruct, attributes, diff --git a/intel-sgx/dcap-ql/Cargo.toml b/intel-sgx/dcap-ql/Cargo.toml index 35ee499b..4dd2271d 100644 --- a/intel-sgx/dcap-ql/Cargo.toml +++ b/intel-sgx/dcap-ql/Cargo.toml @@ -42,7 +42,7 @@ verify = ["mbedtls", "num", "yasna"] # External dependencies byteorder = "1.1.0" # Unlicense/MIT -failure = "0.1.1" # MIT/Apache-2.0 +anyhow = "1.0" # MIT/Apache-2.0 lazy_static = "1" # MIT/Apache-2.0 libc = { version = "0.2", optional = true } # MIT/Apache-2.0 mbedtls = { version = ">=0.8.0, <0.10.0", default-features = false, features = ["std"], optional = true } diff --git a/intel-sgx/dcap-ql/src/lib.rs b/intel-sgx/dcap-ql/src/lib.rs index 50b093b7..d44ca674 100644 --- a/intel-sgx/dcap-ql/src/lib.rs +++ b/intel-sgx/dcap-ql/src/lib.rs @@ -10,7 +10,7 @@ extern crate byteorder; #[macro_use] -extern crate failure; +extern crate anyhow; #[cfg(all(feature="bindings", not(feature = "link")))] #[macro_use] extern crate lazy_static; diff --git a/intel-sgx/dcap-ql/src/quote.rs b/intel-sgx/dcap-ql/src/quote.rs index fcc6d861..56f73282 100644 --- a/intel-sgx/dcap-ql/src/quote.rs +++ b/intel-sgx/dcap-ql/src/quote.rs @@ -19,6 +19,7 @@ use serde::{Deserialize, Serialize}; use sgx_isa::Report; use std::borrow::Cow; use std::mem; +use anyhow::bail; // ==================================================== // ================= TYPE DEFINITIONS ================= @@ -93,7 +94,7 @@ pub struct Qe3CertDataPckCertChain<'a> { pub type RawQe3CertData<'a> = Cow<'a, [u8]>; -pub type Result = ::std::result::Result; +pub type Result = ::std::result::Result; // =========================================== // ================= PARSING ================= diff --git a/intel-sgx/dcap-retrieve-pckid/Cargo.toml b/intel-sgx/dcap-retrieve-pckid/Cargo.toml index 0b244a73..65ce115d 100644 --- a/intel-sgx/dcap-retrieve-pckid/Cargo.toml +++ b/intel-sgx/dcap-retrieve-pckid/Cargo.toml @@ -21,4 +21,4 @@ categories = ["command-line-utilities"] "sgxs-loaders" = { version = "0.3.0", path = "../sgxs-loaders" } # External dependencies -failure = "0.1.1" # MIT/Apache-2.0 +anyhow = "1.0" # MIT/Apache-2.0 diff --git a/intel-sgx/dcap-retrieve-pckid/src/lib.rs b/intel-sgx/dcap-retrieve-pckid/src/lib.rs index 8f1a8723..60ae55bc 100644 --- a/intel-sgx/dcap-retrieve-pckid/src/lib.rs +++ b/intel-sgx/dcap-retrieve-pckid/src/lib.rs @@ -8,9 +8,9 @@ use std::convert::TryInto; use std::fmt; +use anyhow::anyhow; use aesm_client::AesmClient; use dcap_ql::quote::{Qe3CertDataPpid, Quote, Quote3SignatureEcdsaP256, QuoteHeader}; -use failure::Error as FailureError; use sgx_isa::Targetinfo; #[cfg(windows)] use sgxs_loaders::enclaveapi::Sgx as IsgxDevice; @@ -54,11 +54,11 @@ impl ToString for PckId { } } -pub fn retrieve_pckid_str() -> Result { +pub fn retrieve_pckid_str() -> Result { const SGX_QL_ALG_ECDSA_P256: u32 = 2; let mut device = IsgxDevice::new() - .map_err(|err| FailureError::from(err).context("Error opening SGX device"))? + .map_err(|err| anyhow::Error::from(err).context("Error opening SGX device"))? .einittoken_provider(AesmClient::new()) .build(); @@ -66,23 +66,23 @@ pub fn retrieve_pckid_str() -> Result { let key_ids = client .get_supported_att_key_ids() - .map_err(|err| FailureError::from(err).context("AESM communication error getting attestation key ID"))?; + .map_err(|err| anyhow::Error::from(err).context("AESM communication error getting attestation key ID"))?; let ecdsa_key_id = key_ids .into_iter() .find(|id| SGX_QL_ALG_ECDSA_P256 == get_algorithm_id(id)) - .ok_or(::failure::err_msg("No appropriate attestation key ID"))?; + .ok_or(anyhow!("No appropriate attestation key ID"))?; let quote_info = client .init_quote_ex(ecdsa_key_id.clone()) - .map_err(|err| FailureError::from(err).context("Error during quote initialization"))?; + .map_err(|err| anyhow::Error::from(err).context("Error during quote initialization"))?; let ti = Targetinfo::try_copy_from(quote_info.target_info()).unwrap(); let report = report_test::report(&ti, &mut device).unwrap(); let res = client .get_quote_ex(ecdsa_key_id, report.as_ref().to_owned(), None, vec![0; 16]) - .map_err(|err| FailureError::from(err).context("Error obtaining quote"))?; + .map_err(|err| anyhow::Error::from(err).context("Error obtaining quote"))?; let quote = Quote::parse(res.quote()).map_err(|err| err.context("Error parsing quote"))?; let QuoteHeader::V3 { user_data, .. } = quote.header(); diff --git a/intel-sgx/enclave-runner/Cargo.toml b/intel-sgx/enclave-runner/Cargo.toml index 1130a129..8aab62cf 100644 --- a/intel-sgx/enclave-runner/Cargo.toml +++ b/intel-sgx/enclave-runner/Cargo.toml @@ -26,8 +26,8 @@ sgx-isa = { version = "0.4.0", path = "../sgx-isa" } ipc-queue = { version = "0.2.0", path = "../../ipc-queue" } # External dependencies -failure = "0.1.1" # MIT/Apache-2.0 -failure_derive = "0.1.1" # MIT/Apache-2.0 +anyhow = "1.0" # MIT/Apache-2.0 +thiserror = "1.0" # MIT/Apache-2.0 fnv = "1" # MIT/Apache-2.0 lazy_static = "1.2.0" # MIT/Apache-2.0 libc = "0.2.48" # MIT/Apache-2.0 diff --git a/intel-sgx/enclave-runner/src/command.rs b/intel-sgx/enclave-runner/src/command.rs index ff49cfd6..666ccb05 100644 --- a/intel-sgx/enclave-runner/src/command.rs +++ b/intel-sgx/enclave-runner/src/command.rs @@ -6,7 +6,7 @@ use std::path::Path; -use failure::Error; +use anyhow::Error; use sgxs::loader::{Load, MappingInfo}; use crate::loader::{EnclaveBuilder, ErasedTcs}; diff --git a/intel-sgx/enclave-runner/src/library.rs b/intel-sgx/enclave-runner/src/library.rs index f80ff943..4ab75851 100644 --- a/intel-sgx/enclave-runner/src/library.rs +++ b/intel-sgx/enclave-runner/src/library.rs @@ -7,7 +7,7 @@ use std::path::Path; use std::sync::Arc; -use failure::Error; +use anyhow::Error; use sgxs::loader::{Load, MappingInfo}; use crate::loader::{EnclaveBuilder, ErasedTcs}; diff --git a/intel-sgx/enclave-runner/src/loader.rs b/intel-sgx/enclave-runner/src/loader.rs index 88840135..b25a203c 100644 --- a/intel-sgx/enclave-runner/src/loader.rs +++ b/intel-sgx/enclave-runner/src/loader.rs @@ -10,8 +10,9 @@ use std::os::raw::c_void; use std::path::Path; use std::{arch, str}; -use failure::{format_err, Error, ResultExt}; -use failure_derive::Fail; +use thiserror::Error as ThisError; +use anyhow::Context; +use anyhow::anyhow; #[cfg(feature = "crypto-openssl")] use openssl::{ @@ -65,23 +66,23 @@ pub struct EnclaveBuilder<'a> { attributes: Option, miscselect: Option, usercall_ext: Option>, - load_and_sign: Option Result>>, - hash_enclave: Option) -> Result>>, + load_and_sign: Option Result>>, + hash_enclave: Option) -> Result>>, forward_panics: bool, cmd_args: Option>>, } -#[derive(Debug, Fail)] +#[derive(Debug, ThisError)] pub enum EnclavePanic { /// The first byte of the debug buffer was 0 - #[fail(display = "Enclave panicked.")] + #[error("Enclave panicked.")] NoDebugBuf, /// The debug buffer could be interpreted as a zero-terminated UTF-8 string - #[fail(display = "Enclave panicked: {}", _0)] + #[error("Enclave panicked: {}", _0)] DebugStr(String), /// The first byte of the debug buffer was not 0, but it was also not a /// zero-terminated UTF-8 string - #[fail(display = "Enclave panicked: {:?}", _0)] + #[error("Enclave panicked: {:?}", _0)] DebugBuf(Vec), } @@ -158,7 +159,7 @@ impl<'a> EnclaveBuilder<'a> { ret } - fn generate_dummy_signature(&mut self) -> Result { + fn generate_dummy_signature(&mut self) -> Result { fn xgetbv0() -> u64 { unsafe { arch::x86_64::_xgetbv(0) } } @@ -166,7 +167,7 @@ impl<'a> EnclaveBuilder<'a> { let mut enclave = self.enclave.try_clone().unwrap(); let hash = match self.hash_enclave.take() { Some(f) => f(&mut enclave)?, - None => return Err(format_err!("either compile with default features or use with_dummy_signature_signer()")) + None => return Err(anyhow!("either compile with default features or use with_dummy_signature_signer()")) }; let mut signer = Signer::new(hash); @@ -184,7 +185,7 @@ impl<'a> EnclaveBuilder<'a> { match self.load_and_sign.take() { Some(f) => f(signer), - None => Err(format_err!("either compile with default features or use with_dummy_signature_signer()")) + None => Err(anyhow!("either compile with default features or use with_dummy_signature_signer()")) } } @@ -309,7 +310,7 @@ impl<'a> EnclaveBuilder<'a> { fn load( mut self, loader: &mut T, - ) -> Result<(Vec, *mut c_void, usize, bool), Error> { + ) -> Result<(Vec, *mut c_void, usize, bool), anyhow::Error> { let signature = match self.signature { Some(sig) => sig, None => self @@ -331,7 +332,7 @@ impl<'a> EnclaveBuilder<'a> { )) } - pub fn build(mut self, loader: &mut T) -> Result { + pub fn build(mut self, loader: &mut T) -> Result { self.initialized_args_mut(); let args = self.cmd_args.take().unwrap_or_default(); let c = self.usercall_ext.take(); @@ -343,7 +344,7 @@ impl<'a> EnclaveBuilder<'a> { /// /// [`arg`]: struct.EnclaveBuilder.html#method.arg /// [`args`]: struct.EnclaveBuilder.html#method.args - pub fn build_library(mut self, loader: &mut T) -> Result { + pub fn build_library(mut self, loader: &mut T) -> Result { if self.cmd_args.is_some() { panic!("Command arguments do not apply to Library enclaves."); } diff --git a/intel-sgx/enclave-runner/src/usercalls/mod.rs b/intel-sgx/enclave-runner/src/usercalls/mod.rs index 289eb5bd..a1340ddc 100644 --- a/intel-sgx/enclave-runner/src/usercalls/mod.rs +++ b/intel-sgx/enclave-runner/src/usercalls/mod.rs @@ -17,7 +17,7 @@ use std::thread::{self, JoinHandle}; use std::time::{self, Duration}; use std::{cmp, fmt, str}; -use failure::bail; +use anyhow::bail; use fnv::FnvHashMap; use futures::future::{poll_fn, Either, Future, FutureExt}; use futures::lock::Mutex; @@ -1086,7 +1086,7 @@ impl EnclaveState { usercall_ext: Option>, forward_panics: bool, cmd_args: Vec>, - ) -> StdResult<(), failure::Error> { + ) -> StdResult<(), anyhow::Error> { let mut event_queues = FnvHashMap::with_capacity_and_hasher(threads.len() + 1, Default::default()); let main = Self::event_queue_add_tcs(&mut event_queues, main); @@ -1184,7 +1184,7 @@ impl EnclaveState { p3: u64, p4: u64, p5: u64, - ) -> StdResult<(u64, u64), failure::Error> { + ) -> StdResult<(u64, u64), anyhow::Error> { let thread = enclave.threads_queue.pop().expect("threads queue empty"); let work = Work { tcs: RunningTcs { diff --git a/intel-sgx/fortanix-sgx-tools/Cargo.toml b/intel-sgx/fortanix-sgx-tools/Cargo.toml index 18469813..84d1e6db 100644 --- a/intel-sgx/fortanix-sgx-tools/Cargo.toml +++ b/intel-sgx/fortanix-sgx-tools/Cargo.toml @@ -28,8 +28,8 @@ sgx-isa = { version = "0.4.0", path = "../sgx-isa" } # External dependencies xmas-elf = "0.6.0" # Apache-2.0/MIT clap = "2.2.5" # MIT -failure = "0.1.1" # MIT/Apache-2.0 -failure_derive = "0.1.1" # MIT/Apache-2.0 +anyhow = "1.0" # MIT/Apache-2.0 +thiserror = "1.0" # MIT/Apache-2.0 serde_derive = "1.0.84" # MIT/Apache-2.0 serde = "1.0.84" # MIT/Apache-2.0 toml = "0.4.10" # MIT/Apache-2.0 diff --git a/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs b/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs index 8a699bdd..290ef81c 100644 --- a/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs +++ b/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs @@ -10,7 +10,7 @@ extern crate sgx_isa; extern crate sgxs as sgxs_crate; extern crate xmas_elf; #[macro_use] -extern crate failure; +extern crate anyhow; use std::borrow::Borrow; use std::fs::File; @@ -19,7 +19,7 @@ use std::mem::replace; use std::num::ParseIntError; use std::path::{Path, PathBuf}; -use failure::{err_msg, Error, ResultExt}; +use crate::anyhow::Context; use xmas_elf::dynamic::{Dynamic as DynEntry, Tag as DynTag}; use xmas_elf::header::Class as HeaderClass; @@ -182,7 +182,7 @@ macro_rules! check_size { impl<'a> LayoutInfo<'a> { // Check version defined in rust-lang assembly code is supported, see .note.x86_64-fortanix-unknown-sgx section in https://github.com/rust-lang/rust/blob/master/library/std/src/sys/sgx/abi/entry.S - fn check_toolchain_version(elf: &ElfFile<'a>) -> Result<(), Error> { + fn check_toolchain_version(elf: &ElfFile<'a>) -> Result<(), anyhow::Error> { let note_header = elf.find_section_by_name(".note.x86_64-fortanix-unknown-sgx") .ok_or_else(|| format_err!("Could not find .note.x86_64-fortanix-unknown-sgx header!"))?; @@ -216,7 +216,7 @@ impl<'a> LayoutInfo<'a> { } #[allow(non_snake_case)] - fn check_symbols(elf: &ElfFile<'a>) -> Result, Error> { + fn check_symbols(elf: &ElfFile<'a>) -> Result, anyhow::Error> { let dynsym = elf .find_section_by_name(".dynsym") .ok_or_else(|| format_err!("Could not find dynamic symbol table!"))?; @@ -268,7 +268,7 @@ impl<'a> LayoutInfo<'a> { Ok(syms) } - fn check_section(elf: &ElfFile<'a>, section_name: &str) -> Result { + fn check_section(elf: &ElfFile<'a>, section_name: &str) -> Result { let sec = elf .find_section_by_name(§ion_name) .ok_or_else(|| format_err!("Could not find {}!", section_name))?; @@ -278,7 +278,7 @@ impl<'a> LayoutInfo<'a> { }) } - fn check_dynamic(elf: &ElfFile<'a>) -> Result>, Error> { + fn check_dynamic(elf: &ElfFile<'a>) -> Result>, anyhow::Error> { use xmas_elf::dynamic::Tag::*; const DT_RELACOUNT: DynTag = OsSpecific(0x6ffffff9); const DT_RELCOUNT: DynTag = OsSpecific(0x6ffffffa); @@ -331,7 +331,7 @@ impl<'a> LayoutInfo<'a> { } } - fn check_relocs(elf: &ElfFile<'a>, dynamic: Option<&Dynamic<'a>>) -> Result<(), Error> { + fn check_relocs(elf: &ElfFile<'a>, dynamic: Option<&Dynamic<'a>>) -> Result<(), anyhow::Error> { const R_X86_64_RELATIVE: u32 = 8; let writable_ranges = elf @@ -389,7 +389,7 @@ impl<'a> LayoutInfo<'a> { debug: bool, library: bool, sized: bool, - ) -> Result, Error> { + ) -> Result, anyhow::Error> { if let HeaderClass::SixtyFour = elf.header.pt1.class() { } else { bail!("Only 64-bit ELF supported!"); @@ -426,7 +426,7 @@ impl<'a> LayoutInfo<'a> { heap_addr: u64, memory_size: u64, enclave_size: Option, - ) -> Result<(), Error> { + ) -> Result<(), anyhow::Error> { let mut splices = vec![ Splice::for_sym_u64(self.sym.HEAP_BASE, heap_addr), Splice::for_sym_u64(self.sym.HEAP_SIZE, self.heap_size), @@ -558,7 +558,7 @@ impl<'a> LayoutInfo<'a> { Ok(()) } - pub fn write(&self, writer: &mut W) -> Result<(), Error> { + pub fn write(&self, writer: &mut W) -> Result<(), anyhow::Error> { let max_addr = self .elf .program_iter() @@ -719,7 +719,7 @@ fn read_file>(path: P) -> Result, IoError> { Ok(buf) } -fn main_result(args: ArgMatches) -> Result<(), Error> { +fn main_result(args: ArgMatches) -> Result<(), anyhow::Error> { let ssaframesize = u32::parse_arg(args.value_of("ssaframesize").unwrap()); let heap_size = u64::parse_arg(args.value_of("heap-size").unwrap()); let stack_size = u64::parse_arg(args.value_of("stack-size").unwrap()); diff --git a/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-runner-cargo.rs b/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-runner-cargo.rs index 109cdde0..aed17965 100644 --- a/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-runner-cargo.rs +++ b/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-runner-cargo.rs @@ -1,15 +1,17 @@ #[macro_use] extern crate serde_derive; + +extern crate anyhow; #[macro_use] -extern crate failure; -#[macro_use] -extern crate failure_derive; +extern crate thiserror; use std::env; use std::fs::File; use std::io::{self, Read}; use std::process::{self, Command, ExitStatus}; -use failure::{Error, ResultExt}; +use anyhow::Context; +use anyhow::format_err; +use thiserror::Error as ThisError; const HEAP_SIZE: u64 = 0x2000000; const SSAFRAMESIZE: u32 = 1; @@ -46,11 +48,11 @@ struct Config { package: Package } -#[derive(Debug, Fail)] +#[derive(Debug, ThisError)] enum CommandFail { - #[fail(display = "failed to run {}, {}", _0, _1)] + #[error("failed to run {}, {}", _0, _1)] Io(String, io::Error), - #[fail(display = "while running {} got {}", _0, _1)] + #[error("while running {} got {}", _0, _1)] Status(String, ExitStatus), } @@ -62,7 +64,7 @@ fn run_command(mut cmd: Command) -> Result<(), CommandFail> { } } -fn run() -> Result<(), Error> { +fn run() -> Result<(), anyhow::Error> { let key = "CARGO_MANIFEST_DIR"; let mut filepath = env::var_os(key) .ok_or_else(|| format_err!("{} is not defined in the environment.", key))?; diff --git a/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-runner.rs b/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-runner.rs index bd43be85..7fc9d753 100644 --- a/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-runner.rs +++ b/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-runner.rs @@ -12,7 +12,7 @@ use std::io::{stderr, Write}; use aesm_client::AesmClient; use enclave_runner::EnclaveBuilder; -use failure::{Error, ResultExt}; +use anyhow::Context; #[cfg(unix)] use libc::{c_int, c_void, siginfo_t}; #[cfg(unix)] @@ -47,7 +47,7 @@ fn catch_sigbus() { } } -fn main() -> Result<(), Error> { +fn main() -> Result<(), anyhow::Error> { let args = App::new("ftxsgx-runner") .before_help("Runs an sgxs file, with support for ftxsgx usercalls. \ See the Fortanix architecture and elf2sgxs for details.") diff --git a/intel-sgx/report-test/Cargo.toml b/intel-sgx/report-test/Cargo.toml index cdea98b4..f6323957 100644 --- a/intel-sgx/report-test/Cargo.toml +++ b/intel-sgx/report-test/Cargo.toml @@ -21,4 +21,4 @@ categories = ["development-tools"] "sgx-isa" = { version = "0.4.0", path = "../sgx-isa" } # External dependencies -failure = "0.1.1" # MIT/Apache-2.0 +anyhow = "1.0" # MIT/Apache-2.0 diff --git a/intel-sgx/report-test/src/lib.rs b/intel-sgx/report-test/src/lib.rs index 209fb560..c37134a7 100644 --- a/intel-sgx/report-test/src/lib.rs +++ b/intel-sgx/report-test/src/lib.rs @@ -9,12 +9,11 @@ html_root_url = "https://edp.fortanix.com/docs/api/")] extern crate enclave_runner; -extern crate failure; +extern crate anyhow; extern crate sgx_isa; extern crate sgxs; -use failure::{Error, ResultExt}; - +use anyhow::Context; use enclave_runner::EnclaveBuilder; use sgx_isa::{PageType, Report, SecinfoFlags, Targetinfo, Attributes, AttributesFlags, Miscselect}; use sgxs::loader::Load; @@ -59,7 +58,7 @@ impl ReportBuilder { self } - pub fn build(self, enclave_loader: &mut L) -> Result { + pub fn build(self, enclave_loader: &mut L) -> Result { let mut builder = EnclaveBuilder::new_from_memory(&self.enclave_bytes); if let Some(attributes) = self.attributes { @@ -83,6 +82,6 @@ impl ReportBuilder { } } -pub fn report(targetinfo: &Targetinfo, enclave_loader: &mut L) -> Result { +pub fn report(targetinfo: &Targetinfo, enclave_loader: &mut L) -> Result { ReportBuilder::new(targetinfo).build(enclave_loader) } diff --git a/intel-sgx/sgxs-loaders/Cargo.toml b/intel-sgx/sgxs-loaders/Cargo.toml index c6d333fc..a68bb63c 100644 --- a/intel-sgx/sgxs-loaders/Cargo.toml +++ b/intel-sgx/sgxs-loaders/Cargo.toml @@ -31,8 +31,8 @@ no_sgx_enclave_common = [] # External dependencies bitflags = "1" # MIT/Apache-2.0 nix = "0.15" # MIT -failure = "0.1.1" # MIT/Apache-2.0 -failure_derive = "0.1.1" # MIT/Apache-2.0 +anyhow = "1.0" # MIT/Apache-2.0 +thiserror = "1.0" # MIT/Apache-2.0 libloading = "0.5" # ISC [target.'cfg(windows)'.dependencies] diff --git a/intel-sgx/sgxs-loaders/src/generic.rs b/intel-sgx/sgxs-loaders/src/generic.rs index cdb62e84..961f1061 100644 --- a/intel-sgx/sgxs-loaders/src/generic.rs +++ b/intel-sgx/sgxs-loaders/src/generic.rs @@ -7,19 +7,17 @@ use std::fmt::Debug; use std::sync::Arc; -use failure::{Fail, ResultExt}; - use sgx_isa::{Attributes, Einittoken, Miscselect, PageType, Sigstruct}; use sgxs::einittoken::EinittokenProvider; use sgxs::loader; use sgxs::sgxs::{ CreateInfo, Error as SgxsError, MeasEAdd, MeasECreate, PageChunks, PageReader, SgxsRead, }; - +use anyhow::Context; use crate::{MappingInfo, Tcs}; pub(crate) trait EnclaveLoad: Debug + Sized + Send + Sync + 'static { - type Error: Fail + EinittokenError; + type Error: std::error::Error + EinittokenError + Send + Sync; type MapData: Debug + Send + Sync; fn new( device: Arc, @@ -85,7 +83,7 @@ impl Device { sigstruct: &Sigstruct, attributes: Attributes, miscselect: Miscselect, - ) -> ::std::result::Result { + ) -> ::std::result::Result { let mut tokprov = self.einittoken_provider.as_mut(); let mut tokprov_err = None; let einittoken = if let Some(ref mut p) = tokprov { diff --git a/intel-sgx/sgxs-loaders/src/isgx/mod.rs b/intel-sgx/sgxs-loaders/src/isgx/mod.rs index 2f1d7a31..f0cb4a63 100644 --- a/intel-sgx/sgxs-loaders/src/isgx/mod.rs +++ b/intel-sgx/sgxs-loaders/src/isgx/mod.rs @@ -23,6 +23,7 @@ use sgx_isa::{Attributes, Einittoken, ErrorCode, Miscselect, Secinfo, Secs, Sigs use sgxs::einittoken::EinittokenProvider; use sgxs::loader; use sgxs::sgxs::{MeasEAdd, MeasECreate, PageChunks, SgxsRead}; +use thiserror::Error as ThisError; use crate::{MappingInfo, Tcs}; use crate::generic::{self, EinittokenError, EnclaveLoad, Mapping}; @@ -60,28 +61,28 @@ pub enum DriverFamily { use self::DriverFamily::*; -#[derive(Fail, Debug)] +#[derive(ThisError, Debug)] pub enum SgxIoctlError { - #[fail(display = "I/O ctl failed.")] - Io(#[cause] IoError), - #[fail(display = "The SGX instruction returned an error: {:?}.", _0)] + #[error("I/O ctl failed.")] + Io(#[source] IoError), + #[error("The SGX instruction returned an error: {:?}.", _0)] Ret(ErrorCode), - #[fail(display = "The enclave was destroyed because the CPU was powered down.")] + #[error("The enclave was destroyed because the CPU was powered down.")] PowerLostEnclave, - #[fail(display = "Launch enclave version rollback detected.")] + #[error("Launch enclave version rollback detected.")] LeRollback, } -#[derive(Fail, Debug)] +#[derive(ThisError, Debug)] pub enum Error { - #[fail(display = "Failed to map enclave into memory.")] - Map(#[cause] IoError), - #[fail(display = "Failed to call ECREATE.")] - Create(#[cause] SgxIoctlError), - #[fail(display = "Failed to call EADD.")] - Add(#[cause] SgxIoctlError), - #[fail(display = "Failed to call EINIT.")] - Init(#[cause] SgxIoctlError), + #[error("Failed to map enclave into memory.")] + Map(#[source] IoError), + #[error("Failed to call ECREATE.")] + Create(#[source] SgxIoctlError), + #[error("Failed to call EADD.")] + Add(#[source] SgxIoctlError), + #[error("Failed to call EINIT.")] + Init(#[source] SgxIoctlError), } impl Error { @@ -493,7 +494,7 @@ impl loader::Load for Device { sigstruct: &Sigstruct, attributes: Attributes, miscselect: Miscselect, - ) -> ::std::result::Result, ::failure::Error> { + ) -> ::std::result::Result, ::anyhow::Error> { self.inner .load(reader, sigstruct, attributes, miscselect) .map(Into::into) diff --git a/intel-sgx/sgxs-loaders/src/lib.rs b/intel-sgx/sgxs-loaders/src/lib.rs index 4675f810..fec49662 100644 --- a/intel-sgx/sgxs-loaders/src/lib.rs +++ b/intel-sgx/sgxs-loaders/src/lib.rs @@ -10,8 +10,8 @@ #[cfg(unix)] #[macro_use] extern crate nix; -#[macro_use] -extern crate failure_derive; + +extern crate thiserror; #[macro_use] extern crate bitflags; diff --git a/intel-sgx/sgxs-loaders/src/sgx_enclave_common/mod.rs b/intel-sgx/sgxs-loaders/src/sgx_enclave_common/mod.rs index 3d716b2b..afdd7b69 100644 --- a/intel-sgx/sgxs-loaders/src/sgx_enclave_common/mod.rs +++ b/intel-sgx/sgxs-loaders/src/sgx_enclave_common/mod.rs @@ -16,6 +16,7 @@ use sgx_isa::{Attributes, Einittoken, Miscselect, PageType, SecinfoFlags, Secs, use sgxs::einittoken::EinittokenProvider; use sgxs::loader; use sgxs::sgxs::{MeasEAdd, MeasECreate, PageChunks, SgxsRead}; +use thiserror::Error as ThisError; use crate::{MappingInfo, Tcs}; use crate::generic::{self, EinittokenError, EnclaveLoad, Mapping}; @@ -24,54 +25,54 @@ mod defs; use self::defs::*; -#[derive(Fail, Debug)] +#[derive(ThisError, Debug)] #[non_exhaustive] pub enum LibraryError { - #[fail( - display = "Enclave type not supported, Intel SGX not supported, or Intel SGX device not present" + #[error( + "Enclave type not supported, Intel SGX not supported, or Intel SGX device not present" )] NotSupported, - #[fail(display = "SGX - SIGSTRUCT contains an invalid value")] + #[error("SGX - SIGSTRUCT contains an invalid value")] InvalidSigstruct, - #[fail(display = "SGX - invalid signature or the SIGSTRUCT value")] + #[error("SGX - invalid signature or the SIGSTRUCT value")] InvalidSignature, - #[fail(display = "SGX - invalid SECS attribute")] + #[error("SGX - invalid SECS attribute")] InvalidAttribute, - #[fail(display = "SGX - invalid measurement")] + #[error("SGX - invalid measurement")] InvalidMeasurement, - #[fail( - display = "Enclave not authorized to run. For example, the enclave does not have a signing privilege required for a requested attribute." + #[error( + "Enclave not authorized to run. For example, the enclave does not have a signing privilege required for a requested attribute." )] NotAuthorized, - #[fail(display = "Address is not a valid enclave")] + #[error("Address is not a valid enclave")] InvalidEnclave, - #[fail(display = "SGX - enclave is lost (likely due to a power event)")] + #[error("SGX - enclave is lost (likely due to a power event)")] EnclaveLost, - #[fail( - display = "Invalid Parameter (unspecified) - may occur due to a wrong length or format type" + #[error( + "Invalid Parameter (unspecified) - may occur due to a wrong length or format type" )] InvalidParameter, - #[fail( - display = "Out of memory. May be a result of allocation failure in the API or internal function calls" + #[error( + "Out of memory. May be a result of allocation failure in the API or internal function calls" )] OutOfMemory, - #[fail(display = "Out of EPC memory")] + #[error("Out of EPC memory")] DeviceNoResources, - #[fail(display = "Enclave has already been initialized")] + #[error("Enclave has already been initialized")] AlreadyInitialized, - #[fail(display = "Address is not within a valid enclave / Address has already been committed")] + #[error("Address is not within a valid enclave / Address has already been committed")] InvalidAddress, - #[fail(display = "Please retry the operation - an unmasked event occurred in EINIT")] + #[error("Please retry the operation - an unmasked event occurred in EINIT")] Retry, - #[fail(display = "Invalid size")] + #[error("Invalid size")] InvalidSize, - #[fail(display = "Enclave is not initialized - the operation requires an initialized enclave")] + #[error("Enclave is not initialized - the operation requires an initialized enclave")] NotInitialized, - #[fail(display = "Unexpected error in the API")] + #[error("Unexpected error in the API")] Unexpected, - #[fail(display = "Unknown error ({}) in SGX device interface", _0)] + #[error("Unknown error ({}) in SGX device interface", _0)] Other(u32), - #[fail(display = "Failed to adjust the page table permissions: {}", _0)] + #[error("Failed to adjust the page table permissions: {}", _0)] PageTableFailure(IoError), } @@ -101,14 +102,14 @@ impl From for LibraryError { } } -#[derive(Fail, Debug)] +#[derive(ThisError, Debug)] pub enum Error { - #[fail(display = "Failed to call ECREATE.")] - Create(#[cause] LibraryError), - #[fail(display = "Failed to call EADD.")] - Add(#[cause] LibraryError), - #[fail(display = "Failed to call EINIT.")] - Init(#[cause] LibraryError), + #[error("Failed to call ECREATE.")] + Create(#[source] LibraryError), + #[error("Failed to call EADD.")] + Add(#[source] LibraryError), + #[error("Failed to call EINIT.")] + Init(#[source] LibraryError), } impl EinittokenError for Error { @@ -343,7 +344,7 @@ impl loader::Load for Library { sigstruct: &Sigstruct, attributes: Attributes, miscselect: Miscselect, - ) -> ::std::result::Result, ::failure::Error> { + ) -> ::std::result::Result, ::anyhow::Error> { self.inner .load(reader, sigstruct, attributes, miscselect) .map(Into::into) From d6c65dc1db188ebc3d8ce27f779aa46850b47611 Mon Sep 17 00:00:00 2001 From: NikitaShyrei Date: Wed, 6 Mar 2024 18:29:53 +0100 Subject: [PATCH 03/10] - fin --- Cargo.lock | 26 ++------------- intel-sgx/dcap-ql/src/bindings/mod.rs | 5 +-- intel-sgx/enclave-runner/src/loader.rs | 7 ++-- .../src/bin/ftxsgx-elf2sgxs.rs | 17 +++++----- intel-sgx/sgxs-tools/Cargo.toml | 4 +-- intel-sgx/sgxs-tools/src/bin/sgxs-append.rs | 13 ++++---- .../sgxs-tools/src/sgx_detect/imp/linux.rs | 4 +-- intel-sgx/sgxs-tools/src/sgx_detect/main.rs | 32 +++++++++---------- .../sgxs-tools/src/sgx_detect/tests/mod.rs | 3 +- 9 files changed, 45 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21104840..5d72a9bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -924,28 +924,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 1.0.81", - "synstructure", -] - [[package]] name = "fake-simd" version = "0.1.2" @@ -3206,6 +3184,7 @@ name = "sgxs-tools" version = "0.8.6" dependencies = [ "aesm-client", + "anyhow", "atty", "byteorder 1.3.4", "clap", @@ -3213,8 +3192,6 @@ dependencies = [ "dcap-ql", "enclave-runner", "env_logger 0.6.2", - "failure", - "failure_derive", "fnv", "lazy_static", "log 0.4.14", @@ -3235,6 +3212,7 @@ dependencies = [ "sgxs", "sgxs-loaders", "syn 0.15.44", + "thiserror", "winapi", "yansi", ] diff --git a/intel-sgx/dcap-ql/src/bindings/mod.rs b/intel-sgx/dcap-ql/src/bindings/mod.rs index ab4bb9ec..0138c12e 100644 --- a/intel-sgx/dcap-ql/src/bindings/mod.rs +++ b/intel-sgx/dcap-ql/src/bindings/mod.rs @@ -4,7 +4,8 @@ extern crate libc; extern crate sgxs_loaders; -use failure::Error; +use anyhow::Error; +use anyhow::anyhow; use num_traits::FromPrimitive; pub use self::dcap_ql_sys::Quote3Error; @@ -76,7 +77,7 @@ pub fn is_loaded() -> bool { /// Since DCAP is being used, assume that no EINITTOKEN provider is necessary. pub fn enclave_loader() -> Result { #[cfg(not(feature = "link"))] - dl::load().map_err(failure::err_msg)?; + dl::load().map_err(|e| anyhow!(e))?; // NB. libsgx_dcap_ql.so.1 transitively links to libsgx_enclave_common.so.1 // so we should be able to find it already loaded. // We can't use the library from `mod dl` if `not(feature = "link")`, diff --git a/intel-sgx/enclave-runner/src/loader.rs b/intel-sgx/enclave-runner/src/loader.rs index b25a203c..daca85e3 100644 --- a/intel-sgx/enclave-runner/src/loader.rs +++ b/intel-sgx/enclave-runner/src/loader.rs @@ -11,8 +11,7 @@ use std::path::Path; use std::{arch, str}; use thiserror::Error as ThisError; -use anyhow::Context; -use anyhow::anyhow; +use anyhow::{Context, format_err}; #[cfg(feature = "crypto-openssl")] use openssl::{ @@ -167,7 +166,7 @@ impl<'a> EnclaveBuilder<'a> { let mut enclave = self.enclave.try_clone().unwrap(); let hash = match self.hash_enclave.take() { Some(f) => f(&mut enclave)?, - None => return Err(anyhow!("either compile with default features or use with_dummy_signature_signer()")) + None => return Err(format_err!("either compile with default features or use with_dummy_signature_signer()")) }; let mut signer = Signer::new(hash); @@ -185,7 +184,7 @@ impl<'a> EnclaveBuilder<'a> { match self.load_and_sign.take() { Some(f) => f(signer), - None => Err(anyhow!("either compile with default features or use with_dummy_signature_signer()")) + None => Err(format_err!("either compile with default features or use with_dummy_signature_signer()")) } } diff --git a/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs b/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs index 290ef81c..846ec0d5 100644 --- a/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs +++ b/intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs @@ -20,6 +20,7 @@ use std::num::ParseIntError; use std::path::{Path, PathBuf}; use crate::anyhow::Context; +use anyhow::anyhow; use xmas_elf::dynamic::{Dynamic as DynEntry, Tag as DynTag}; use xmas_elf::header::Class as HeaderClass; @@ -127,13 +128,13 @@ macro_rules! read_syms { $(let mut $optional_name=None;)* for sym in $syms.iter().skip(1) { if sym.shndx()==SHN_UNDEF { - bail!("Found undefined dynamic symbol: {}", sym.get_name(&$elf).map_err(err_msg)?); - } $(else if sym.get_name(&$elf).map_err(err_msg)?==stringify!($mandatory_name) { + bail!("Found undefined dynamic symbol: {}", sym.get_name(&$elf).map_err(|e| anyhow!(e))?); + } $(else if sym.get_name(&$elf).map_err(|e| anyhow!(e))?==stringify!($mandatory_name) { if replace(&mut $mandatory_name,Some(sym)).is_some() { bail!("Found symbol twice: {}", stringify!($mandatory_name)); } })* - $(else if sym.get_name(&$elf).map_err(err_msg)?==stringify!($optional_name) { + $(else if sym.get_name(&$elf).map_err(|e| anyhow!(e))?==stringify!($optional_name) { if replace(&mut $optional_name,Some(sym)).is_some() { bail!("Found symbol twice: {}", stringify!($optional_name)); } @@ -222,7 +223,7 @@ impl<'a> LayoutInfo<'a> { .ok_or_else(|| format_err!("Could not find dynamic symbol table!"))?; let syms = - if let SectionData::DynSymbolTable64(syms) = dynsym.get_data(&elf).map_err(err_msg)? { + if let SectionData::DynSymbolTable64(syms) = dynsym.get_data(&elf).map_err(|e| anyhow!(e))? { syms } else { bail!(".dynsym section is not a dynamic symbol table!"); @@ -290,7 +291,7 @@ impl<'a> LayoutInfo<'a> { .find(|ph| ph.get_type() == Ok(PhType::Dynamic)) .ok_or_else(|| format_err!("Could not found dynamic section!"))?; - let dyns = if let SegmentData::Dynamic64(dyns) = dynh.get_data(&elf).map_err(err_msg)? { + let dyns = if let SegmentData::Dynamic64(dyns) = dynh.get_data(&elf).map_err(|e| anyhow!(e))? { dyns } else { bail!("PT_DYNAMIC segment is not a dynamic section!") @@ -300,7 +301,7 @@ impl<'a> LayoutInfo<'a> { let mut relacount = None; for dynamic in dyns { - match dynamic.get_tag().map_err(err_msg)? { + match dynamic.get_tag().map_err(|e| anyhow!(e))? { // Some entries for PLT/GOT checking are currently // commented out. I *think* that if there were an actual // PLT/GOT problem, that would be caught by the remaining @@ -347,7 +348,7 @@ impl<'a> LayoutInfo<'a> { let mut count = 0; for section in elf.section_iter() { - if let SectionData::Rela64(relas) = section.get_data(&elf).map_err(err_msg)? { + if let SectionData::Rela64(relas) = section.get_data(&elf).map_err(|e| anyhow!(e))? { count += relas.len(); for rela in relas { let shind = rela.get_symbol_table_index(); @@ -501,7 +502,7 @@ impl<'a> LayoutInfo<'a> { let base = start & !0xfff; let mut end = start + ph.mem_size(); let base_data; - if let SegmentData::Undefined(data) = ph.get_data(&self.elf).map_err(err_msg)? { + if let SegmentData::Undefined(data) = ph.get_data(&self.elf).map_err(|e| anyhow!(e))? { base_data = data; } else { // Reachable if xmas-elf changes definition of SegmentData diff --git a/intel-sgx/sgxs-tools/Cargo.toml b/intel-sgx/sgxs-tools/Cargo.toml index 798b2d38..ce369219 100644 --- a/intel-sgx/sgxs-tools/Cargo.toml +++ b/intel-sgx/sgxs-tools/Cargo.toml @@ -40,8 +40,8 @@ regex = "1" # MIT/Apache-2.0 num = "0.2" # MIT/Apache-2.0 byteorder = "1.1.0" # Unlicense/MIT openssl = "0.10" # Apache-2.0 -failure = "0.1.1" # MIT/Apache-2.0 -failure_derive = "0.1.1" # MIT/Apache-2.0 +anyhow = "1.0" # MIT/Apache-2.0 +thiserror = "1.0" # MIT/Apache-2.0 crypto-hash = "0.3" # MIT log = "0.4" # MIT/Apache-2.0 env_logger = "0.6" # MIT/Apache-2.0 diff --git a/intel-sgx/sgxs-tools/src/bin/sgxs-append.rs b/intel-sgx/sgxs-tools/src/bin/sgxs-append.rs index 3c6badb3..0cfecd6c 100644 --- a/intel-sgx/sgxs-tools/src/bin/sgxs-append.rs +++ b/intel-sgx/sgxs-tools/src/bin/sgxs-append.rs @@ -7,10 +7,8 @@ extern crate byteorder; extern crate sgx_isa; extern crate sgxs as sgxs_crate; -#[macro_use] -extern crate failure; -#[macro_use] -extern crate failure_derive; +extern crate anyhow; +extern crate thiserror; use std::borrow::Cow; use std::cell::RefCell; @@ -22,16 +20,17 @@ use std::ops::{Deref, DerefMut}; use std::rc::Rc; use byteorder::{LittleEndian, WriteBytesExt}; -use failure::{Error, ResultExt}; use sgx_isa::{PageType, SecinfoFlags}; use crate::sgxs_crate::sgxs::{ CanonicalSgxsReader, Meas, PageChunk, SecinfoTruncated, SgxsRead, SgxsWrite, }; use crate::sgxs_crate::util::size_fit_natural; +use anyhow::{Context, Error, bail, format_err}; +use thiserror::Error as ThisError; -#[derive(Debug, Fail)] -#[fail(display = "Usage error")] +#[derive(Debug, ThisError)] +#[error("Usage error")] struct UsageError(Cow<'static, str>); struct NamedFile { diff --git a/intel-sgx/sgxs-tools/src/sgx_detect/imp/linux.rs b/intel-sgx/sgxs-tools/src/sgx_detect/imp/linux.rs index 79b4f18c..1ba225cb 100644 --- a/intel-sgx/sgxs-tools/src/sgx_detect/imp/linux.rs +++ b/intel-sgx/sgxs-tools/src/sgx_detect/imp/linux.rs @@ -7,7 +7,7 @@ use std::path::PathBuf; use std::process::Command; use byteorder::{ReadBytesExt, LE}; -use failure::{Error, Fail, ResultExt}; +use anyhow::{bail, Error, Context, anyhow}; use crate::DetectError; use crate::interpret::{AesmStatus, KmodStatus}; @@ -41,7 +41,7 @@ pub fn rdmsr(address: u64) -> Result { modprobe_msr().context("Failed to load MSR kernel module")?; continue; } - Err(e) => bail!(e.context("Failed to open MSR device")), + Err(e) => bail!(anyhow!(e).context("Failed to open MSR device")), } } } diff --git a/intel-sgx/sgxs-tools/src/sgx_detect/main.rs b/intel-sgx/sgxs-tools/src/sgx_detect/main.rs index c152d2d6..52f46c2a 100644 --- a/intel-sgx/sgxs-tools/src/sgx_detect/main.rs +++ b/intel-sgx/sgxs-tools/src/sgx_detect/main.rs @@ -32,10 +32,9 @@ #[macro_use] extern crate log; -#[macro_use] -extern crate failure; -#[macro_use] -extern crate failure_derive; + +extern crate anyhow; +extern crate thiserror; #[macro_use] extern crate mopa; #[macro_use] @@ -52,7 +51,6 @@ use std::rc::Rc; use std::process::Command; use std::io::{self, BufRead, Error as IOError, ErrorKind}; use reqwest; -use failure::Error; use yansi::Paint; use aesm_client::AesmClient; use sgx_isa::{Sigstruct, Attributes, Einittoken}; @@ -63,6 +61,8 @@ use sgxs_loaders::isgx::Device as SgxDevice; use sgxs_loaders::enclaveapi::Sgx as SgxDevice; use sgxs_loaders::sgx_enclave_common::Library as EnclCommonLib; use proc_mounts::MountList; +use anyhow::{bail, Error, format_err}; +use thiserror::Error as ThisError; mod interpret; #[cfg(windows)] @@ -79,15 +79,15 @@ mod tests; use crate::interpret::*; use crate::tests::Tests; -#[derive(Debug, Fail)] +#[derive(Debug, ThisError)] enum DetectError { - #[fail(display = "CPUID leaf {:x}h is not valid", leaf)] + #[error("CPUID leaf {:x}h is not valid", leaf)] CpuidLeafInvalid { leaf: u32 }, - #[fail(display = "Failed access EFI variables")] - EfiFsError(#[cause] io::Error), - #[fail(display = "Failed to read EFI variable")] - EfiVariableError(#[cause] io::Error), - #[fail(display = "Not available when using JSON tests")] + #[error("Failed access EFI variables")] + EfiFsError(#[source] io::Error), + #[error("Failed to read EFI variable")] + EfiVariableError(#[source] io::Error), + #[error("Not available when using JSON tests")] NotAvailableInTest, } @@ -104,7 +104,7 @@ fn cpuid(eax: u32, ecx: u32) -> Result { mod detect_result { use std::rc::Rc; - use failure::{Error, err_msg}; + use anyhow::{Error, anyhow}; use serde::ser::{Serialize, Serializer}; use serde::de::{Deserialize, Deserializer}; @@ -115,7 +115,7 @@ mod detect_result { pub fn deserialize<'de, T: Deserialize<'de>, D: Deserializer<'de>>(deserializer: D) -> Result>, D::Error> { match Result::::deserialize(deserializer) { Ok(Ok(v)) => Ok(Ok(v)), - Ok(Err(e)) => Ok(Err(Rc::new(err_msg(e)))), + Ok(Err(e)) => Ok(Err(Rc::new(anyhow!(e)))), Err(e) => Err(e), } } @@ -168,7 +168,7 @@ struct FailTrace<'a>(pub &'a Error); impl<'a> fmt::Display for FailTrace<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { write!(fmt, "{}", self.0)?; - for cause in self.0.iter_causes() { + for cause in self.0.chain() { write!(fmt, "\ncause: {}", cause)?; } Ok(()) @@ -267,7 +267,7 @@ impl SgxSupport { while let Some(p) = path.parent() { if let Some(mount_info) = mount_list.0.iter().find(|&x| x.dest == p) { if mount_info.options.iter().any(|o| o == "noexec") { - return Err(failure::format_err!("{:?} mounted with `noexec` option", mount_info.dest)); + return Err(format_err!("{:?} mounted with `noexec` option", mount_info.dest)); } } path = p; diff --git a/intel-sgx/sgxs-tools/src/sgx_detect/tests/mod.rs b/intel-sgx/sgxs-tools/src/sgx_detect/tests/mod.rs index f92bce0c..d62537f8 100644 --- a/intel-sgx/sgxs-tools/src/sgx_detect/tests/mod.rs +++ b/intel-sgx/sgxs-tools/src/sgx_detect/tests/mod.rs @@ -7,13 +7,14 @@ use std::io::ErrorKind; use std::io::Error as IoError; use std::process; -use failure::Error; +use anyhow::Error; use petgraph::visit::EdgeRef; use enclave_runner::EnclaveBuilder; use report_test::ReportBuilder; use sgx_isa::{Attributes, AttributesFlags, Miscselect, Sigstruct}; use sgxs::loader::Load; +use anyhow::format_err; mod debug; #[macro_use] From 1df9147919bab7cdd4847c9e2da3dac5d0a07022 Mon Sep 17 00:00:00 2001 From: NikitaShyrei Date: Fri, 8 Mar 2024 14:19:24 +0100 Subject: [PATCH 04/10] - bump minor version --- Cargo.lock | 16 ++++++++-------- intel-sgx/aesm-client/Cargo.toml | 2 +- intel-sgx/dcap-ql/Cargo.toml | 2 +- intel-sgx/dcap-retrieve-pckid/Cargo.toml | 2 +- intel-sgx/enclave-runner/Cargo.toml | 2 +- intel-sgx/fortanix-sgx-tools/Cargo.toml | 2 +- intel-sgx/report-test/Cargo.toml | 2 +- intel-sgx/sgxs-loaders/Cargo.toml | 2 +- intel-sgx/sgxs/Cargo.toml | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d72a9bd..1558e4d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,7 +25,7 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aesm-client" -version = "0.5.4" +version = "0.5.5" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "dcap-ql" -version = "0.3.7" +version = "0.3.8" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -643,7 +643,7 @@ dependencies = [ [[package]] name = "dcap-retrieve-pckid" -version = "0.1.3" +version = "0.1.4" dependencies = [ "aesm-client", "anyhow", @@ -822,7 +822,7 @@ dependencies = [ [[package]] name = "enclave-runner" -version = "0.5.2" +version = "0.5.3" dependencies = [ "anyhow", "crossbeam", @@ -1017,7 +1017,7 @@ dependencies = [ [[package]] name = "fortanix-sgx-tools" -version = "0.5.1" +version = "0.5.2" dependencies = [ "aesm-client", "anyhow", @@ -2817,7 +2817,7 @@ dependencies = [ [[package]] name = "report-test" -version = "0.3.3" +version = "0.3.4" dependencies = [ "anyhow", "enclave-runner", @@ -3149,7 +3149,7 @@ dependencies = [ [[package]] name = "sgxs" -version = "0.7.4" +version = "0.7.5" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -3165,7 +3165,7 @@ dependencies = [ [[package]] name = "sgxs-loaders" -version = "0.3.3" +version = "0.3.4" dependencies = [ "aesm-client", "anyhow", diff --git a/intel-sgx/aesm-client/Cargo.toml b/intel-sgx/aesm-client/Cargo.toml index f353f27c..37f65ee4 100644 --- a/intel-sgx/aesm-client/Cargo.toml +++ b/intel-sgx/aesm-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aesm-client" -version = "0.5.4" +version = "0.5.5" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/dcap-ql/Cargo.toml b/intel-sgx/dcap-ql/Cargo.toml index 4dd2271d..6a510a18 100644 --- a/intel-sgx/dcap-ql/Cargo.toml +++ b/intel-sgx/dcap-ql/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcap-ql" -version = "0.3.7" +version = "0.3.8" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/dcap-retrieve-pckid/Cargo.toml b/intel-sgx/dcap-retrieve-pckid/Cargo.toml index 65ce115d..ab47e486 100644 --- a/intel-sgx/dcap-retrieve-pckid/Cargo.toml +++ b/intel-sgx/dcap-retrieve-pckid/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcap-retrieve-pckid" -version = "0.1.3" +version = "0.1.4" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/enclave-runner/Cargo.toml b/intel-sgx/enclave-runner/Cargo.toml index 8aab62cf..bdf795d0 100644 --- a/intel-sgx/enclave-runner/Cargo.toml +++ b/intel-sgx/enclave-runner/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enclave-runner" -version = "0.5.2" +version = "0.5.3" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/fortanix-sgx-tools/Cargo.toml b/intel-sgx/fortanix-sgx-tools/Cargo.toml index 84d1e6db..e8ab703c 100644 --- a/intel-sgx/fortanix-sgx-tools/Cargo.toml +++ b/intel-sgx/fortanix-sgx-tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fortanix-sgx-tools" -version = "0.5.1" +version = "0.5.2" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/report-test/Cargo.toml b/intel-sgx/report-test/Cargo.toml index f6323957..2ed60b3d 100644 --- a/intel-sgx/report-test/Cargo.toml +++ b/intel-sgx/report-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "report-test" -version = "0.3.3" +version = "0.3.4" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/sgxs-loaders/Cargo.toml b/intel-sgx/sgxs-loaders/Cargo.toml index a68bb63c..7a07af47 100644 --- a/intel-sgx/sgxs-loaders/Cargo.toml +++ b/intel-sgx/sgxs-loaders/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sgxs-loaders" -version = "0.3.3" +version = "0.3.4" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/sgxs/Cargo.toml b/intel-sgx/sgxs/Cargo.toml index 183916cb..88638f2f 100644 --- a/intel-sgx/sgxs/Cargo.toml +++ b/intel-sgx/sgxs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sgxs" -version = "0.7.4" +version = "0.7.5" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ From 5174906b5ba41a8a7816c51d6d1969cc54035ddd Mon Sep 17 00:00:00 2001 From: NikitaShyrei Date: Sun, 10 Mar 2024 20:42:07 +0100 Subject: [PATCH 05/10] Revert "- bump minor version" This reverts commit 1df9147919bab7cdd4847c9e2da3dac5d0a07022. --- Cargo.lock | 16 ++++++++-------- intel-sgx/aesm-client/Cargo.toml | 2 +- intel-sgx/dcap-ql/Cargo.toml | 2 +- intel-sgx/dcap-retrieve-pckid/Cargo.toml | 2 +- intel-sgx/enclave-runner/Cargo.toml | 2 +- intel-sgx/fortanix-sgx-tools/Cargo.toml | 2 +- intel-sgx/report-test/Cargo.toml | 2 +- intel-sgx/sgxs-loaders/Cargo.toml | 2 +- intel-sgx/sgxs/Cargo.toml | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1558e4d0..5d72a9bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,7 +25,7 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aesm-client" -version = "0.5.5" +version = "0.5.4" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "dcap-ql" -version = "0.3.8" +version = "0.3.7" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -643,7 +643,7 @@ dependencies = [ [[package]] name = "dcap-retrieve-pckid" -version = "0.1.4" +version = "0.1.3" dependencies = [ "aesm-client", "anyhow", @@ -822,7 +822,7 @@ dependencies = [ [[package]] name = "enclave-runner" -version = "0.5.3" +version = "0.5.2" dependencies = [ "anyhow", "crossbeam", @@ -1017,7 +1017,7 @@ dependencies = [ [[package]] name = "fortanix-sgx-tools" -version = "0.5.2" +version = "0.5.1" dependencies = [ "aesm-client", "anyhow", @@ -2817,7 +2817,7 @@ dependencies = [ [[package]] name = "report-test" -version = "0.3.4" +version = "0.3.3" dependencies = [ "anyhow", "enclave-runner", @@ -3149,7 +3149,7 @@ dependencies = [ [[package]] name = "sgxs" -version = "0.7.5" +version = "0.7.4" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -3165,7 +3165,7 @@ dependencies = [ [[package]] name = "sgxs-loaders" -version = "0.3.4" +version = "0.3.3" dependencies = [ "aesm-client", "anyhow", diff --git a/intel-sgx/aesm-client/Cargo.toml b/intel-sgx/aesm-client/Cargo.toml index 37f65ee4..f353f27c 100644 --- a/intel-sgx/aesm-client/Cargo.toml +++ b/intel-sgx/aesm-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aesm-client" -version = "0.5.5" +version = "0.5.4" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/dcap-ql/Cargo.toml b/intel-sgx/dcap-ql/Cargo.toml index 6a510a18..4dd2271d 100644 --- a/intel-sgx/dcap-ql/Cargo.toml +++ b/intel-sgx/dcap-ql/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcap-ql" -version = "0.3.8" +version = "0.3.7" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/dcap-retrieve-pckid/Cargo.toml b/intel-sgx/dcap-retrieve-pckid/Cargo.toml index ab47e486..65ce115d 100644 --- a/intel-sgx/dcap-retrieve-pckid/Cargo.toml +++ b/intel-sgx/dcap-retrieve-pckid/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcap-retrieve-pckid" -version = "0.1.4" +version = "0.1.3" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/enclave-runner/Cargo.toml b/intel-sgx/enclave-runner/Cargo.toml index bdf795d0..8aab62cf 100644 --- a/intel-sgx/enclave-runner/Cargo.toml +++ b/intel-sgx/enclave-runner/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enclave-runner" -version = "0.5.3" +version = "0.5.2" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/fortanix-sgx-tools/Cargo.toml b/intel-sgx/fortanix-sgx-tools/Cargo.toml index e8ab703c..84d1e6db 100644 --- a/intel-sgx/fortanix-sgx-tools/Cargo.toml +++ b/intel-sgx/fortanix-sgx-tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fortanix-sgx-tools" -version = "0.5.2" +version = "0.5.1" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/report-test/Cargo.toml b/intel-sgx/report-test/Cargo.toml index 2ed60b3d..f6323957 100644 --- a/intel-sgx/report-test/Cargo.toml +++ b/intel-sgx/report-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "report-test" -version = "0.3.4" +version = "0.3.3" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/sgxs-loaders/Cargo.toml b/intel-sgx/sgxs-loaders/Cargo.toml index 7a07af47..a68bb63c 100644 --- a/intel-sgx/sgxs-loaders/Cargo.toml +++ b/intel-sgx/sgxs-loaders/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sgxs-loaders" -version = "0.3.4" +version = "0.3.3" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/sgxs/Cargo.toml b/intel-sgx/sgxs/Cargo.toml index 88638f2f..183916cb 100644 --- a/intel-sgx/sgxs/Cargo.toml +++ b/intel-sgx/sgxs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sgxs" -version = "0.7.5" +version = "0.7.4" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ From 80a4fed5c41b9f95782eb85d7e495ce6eff868be Mon Sep 17 00:00:00 2001 From: NikitaShyrei Date: Sun, 10 Mar 2024 20:47:26 +0100 Subject: [PATCH 06/10] - bump minor version --- intel-sgx/aesm-client/Cargo.toml | 2 +- intel-sgx/dcap-ql/Cargo.toml | 2 +- intel-sgx/dcap-retrieve-pckid/Cargo.toml | 2 +- intel-sgx/enclave-runner/Cargo.toml | 2 +- intel-sgx/fortanix-sgx-tools/Cargo.toml | 2 +- intel-sgx/report-test/Cargo.toml | 2 +- intel-sgx/sgxs-loaders/Cargo.toml | 2 +- intel-sgx/sgxs/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/intel-sgx/aesm-client/Cargo.toml b/intel-sgx/aesm-client/Cargo.toml index f353f27c..0d7622fe 100644 --- a/intel-sgx/aesm-client/Cargo.toml +++ b/intel-sgx/aesm-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aesm-client" -version = "0.5.4" +version = "0.6.4" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/dcap-ql/Cargo.toml b/intel-sgx/dcap-ql/Cargo.toml index 4dd2271d..c8fa814a 100644 --- a/intel-sgx/dcap-ql/Cargo.toml +++ b/intel-sgx/dcap-ql/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcap-ql" -version = "0.3.7" +version = "0.4.7" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/dcap-retrieve-pckid/Cargo.toml b/intel-sgx/dcap-retrieve-pckid/Cargo.toml index 65ce115d..c1db0355 100644 --- a/intel-sgx/dcap-retrieve-pckid/Cargo.toml +++ b/intel-sgx/dcap-retrieve-pckid/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcap-retrieve-pckid" -version = "0.1.3" +version = "0.2.3" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/enclave-runner/Cargo.toml b/intel-sgx/enclave-runner/Cargo.toml index 8aab62cf..e7948724 100644 --- a/intel-sgx/enclave-runner/Cargo.toml +++ b/intel-sgx/enclave-runner/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enclave-runner" -version = "0.5.2" +version = "0.6.2" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/fortanix-sgx-tools/Cargo.toml b/intel-sgx/fortanix-sgx-tools/Cargo.toml index 84d1e6db..15d08efe 100644 --- a/intel-sgx/fortanix-sgx-tools/Cargo.toml +++ b/intel-sgx/fortanix-sgx-tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fortanix-sgx-tools" -version = "0.5.1" +version = "0.6.1" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/report-test/Cargo.toml b/intel-sgx/report-test/Cargo.toml index f6323957..4b7f0d14 100644 --- a/intel-sgx/report-test/Cargo.toml +++ b/intel-sgx/report-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "report-test" -version = "0.3.3" +version = "0.4.3" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/sgxs-loaders/Cargo.toml b/intel-sgx/sgxs-loaders/Cargo.toml index a68bb63c..0a944d57 100644 --- a/intel-sgx/sgxs-loaders/Cargo.toml +++ b/intel-sgx/sgxs-loaders/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sgxs-loaders" -version = "0.3.3" +version = "0.4.3" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/sgxs/Cargo.toml b/intel-sgx/sgxs/Cargo.toml index 183916cb..670a9fcd 100644 --- a/intel-sgx/sgxs/Cargo.toml +++ b/intel-sgx/sgxs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sgxs" -version = "0.7.4" +version = "0.8.4" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ From 0f0ea62d23627f910d0c187138ef540205b2b78b Mon Sep 17 00:00:00 2001 From: NikitaShyrei Date: Sun, 10 Mar 2024 21:09:51 +0100 Subject: [PATCH 07/10] - bumped mover version to satisfy semver --- Cargo.lock | 16 ++++++++-------- intel-sgx/aesm-client/Cargo.toml | 6 +++--- intel-sgx/dcap-provider/Cargo.toml | 4 ++-- intel-sgx/dcap-ql/Cargo.toml | 6 +++--- intel-sgx/dcap-retrieve-pckid/Cargo.toml | 8 ++++---- intel-sgx/enclave-runner/Cargo.toml | 2 +- intel-sgx/fortanix-sgx-tools/Cargo.toml | 8 ++++---- intel-sgx/ias/Cargo.toml | 8 ++++---- intel-sgx/report-test/Cargo.toml | 4 ++-- intel-sgx/sgxs-loaders/Cargo.toml | 6 +++--- intel-sgx/sgxs-tools/Cargo.toml | 12 ++++++------ 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d72a9bd..e2bbbc13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,7 +25,7 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aesm-client" -version = "0.5.4" +version = "0.6.4" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "dcap-ql" -version = "0.3.7" +version = "0.4.7" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -643,7 +643,7 @@ dependencies = [ [[package]] name = "dcap-retrieve-pckid" -version = "0.1.3" +version = "0.2.3" dependencies = [ "aesm-client", "anyhow", @@ -822,7 +822,7 @@ dependencies = [ [[package]] name = "enclave-runner" -version = "0.5.2" +version = "0.6.2" dependencies = [ "anyhow", "crossbeam", @@ -1017,7 +1017,7 @@ dependencies = [ [[package]] name = "fortanix-sgx-tools" -version = "0.5.1" +version = "0.6.1" dependencies = [ "aesm-client", "anyhow", @@ -2817,7 +2817,7 @@ dependencies = [ [[package]] name = "report-test" -version = "0.3.3" +version = "0.4.3" dependencies = [ "anyhow", "enclave-runner", @@ -3149,7 +3149,7 @@ dependencies = [ [[package]] name = "sgxs" -version = "0.7.4" +version = "0.8.4" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -3165,7 +3165,7 @@ dependencies = [ [[package]] name = "sgxs-loaders" -version = "0.3.3" +version = "0.4.3" dependencies = [ "aesm-client", "anyhow", diff --git a/intel-sgx/aesm-client/Cargo.toml b/intel-sgx/aesm-client/Cargo.toml index 0d7622fe..c7d9b861 100644 --- a/intel-sgx/aesm-client/Cargo.toml +++ b/intel-sgx/aesm-client/Cargo.toml @@ -26,7 +26,7 @@ test-sgx = [] [dependencies] # Project dependencies -sgxs = { version = "0.7.0", path = "../sgxs", optional = true } +sgxs = { version = "0.8.0", path = "../sgxs", optional = true } sgx-isa = { version = "0.4.0", path = "../sgx-isa"} # External dependencies @@ -54,5 +54,5 @@ protoc-rust = "2.8.0" # MIT/Apache-2.0 [dev-dependencies] sgx-isa = { version = "0.4.0", path = "../sgx-isa" } -"report-test" = { version = "0.3.1", path = "../report-test" } -"sgxs-loaders" = { version = "0.3.0", path = "../sgxs-loaders" } +"report-test" = { version = "0.4.1", path = "../report-test" } +"sgxs-loaders" = { version = "0.4.0", path = "../sgxs-loaders" } diff --git a/intel-sgx/dcap-provider/Cargo.toml b/intel-sgx/dcap-provider/Cargo.toml index cac210c0..02950cd6 100644 --- a/intel-sgx/dcap-provider/Cargo.toml +++ b/intel-sgx/dcap-provider/Cargo.toml @@ -34,8 +34,8 @@ crate-type = ["cdylib"] [dependencies] # Project dependencies -"dcap-ql" = { version = "0.3.0", path = "../dcap-ql", features = ["link"] } -"report-test" = { version = "0.3.1", path = "../report-test" } +"dcap-ql" = { version = "0.4.0", path = "../dcap-ql", features = ["link"] } +"report-test" = { version = "0.4.1", path = "../report-test" } # External dependencies byteorder = "1.1.0" # Unlicense/MIT diff --git a/intel-sgx/dcap-ql/Cargo.toml b/intel-sgx/dcap-ql/Cargo.toml index c8fa814a..954e8277 100644 --- a/intel-sgx/dcap-ql/Cargo.toml +++ b/intel-sgx/dcap-ql/Cargo.toml @@ -37,7 +37,7 @@ verify = ["mbedtls", "num", "yasna"] [dependencies] # Project dependencies "dcap-ql-sys" = { version = "0.2.0", path = "../dcap-ql-sys", optional = true } -"sgxs-loaders" = { version = "0.3.0", path = "../sgxs-loaders", optional = true } +"sgxs-loaders" = { version = "0.4.0", path = "../sgxs-loaders", optional = true } "sgx-isa" = { version = "0.4.0", path = "../sgx-isa" } # External dependencies @@ -54,7 +54,7 @@ yasna = { version = "0.3", features = ["num-bigint", "bit-vec"], optional = true [dev-dependencies] mbedtls = { version = ">=0.8.0, <0.10.0" } -report-test = { version = "0.3.1", path = "../report-test" } -sgxs = { version = "0.7.0", path = "../sgxs" } +report-test = { version = "0.4.1", path = "../report-test" } +sgxs = { version = "0.8.0", path = "../sgxs" } serde = { version = "1.0.104", features = ["derive"] } serde_json = { version = "1.0" } diff --git a/intel-sgx/dcap-retrieve-pckid/Cargo.toml b/intel-sgx/dcap-retrieve-pckid/Cargo.toml index c1db0355..74ee3318 100644 --- a/intel-sgx/dcap-retrieve-pckid/Cargo.toml +++ b/intel-sgx/dcap-retrieve-pckid/Cargo.toml @@ -14,11 +14,11 @@ categories = ["command-line-utilities"] [dependencies] # Project dependencies -"aesm-client" = { version = "0.5.0", path = "../aesm-client", features = ["sgxs"] } -"dcap-ql" = { version = "0.3.0", path = "../dcap-ql", default-features = false } -"report-test" = { version = "0.3.1", path = "../report-test" } +"aesm-client" = { version = "0.6.0", path = "../aesm-client", features = ["sgxs"] } +"dcap-ql" = { version = "0.4.0", path = "../dcap-ql", default-features = false } +"report-test" = { version = "0.4.1", path = "../report-test" } "sgx-isa" = { version = "0.4.0", path = "../sgx-isa" } -"sgxs-loaders" = { version = "0.3.0", path = "../sgxs-loaders" } +"sgxs-loaders" = { version = "0.4.0", path = "../sgxs-loaders" } # External dependencies anyhow = "1.0" # MIT/Apache-2.0 diff --git a/intel-sgx/enclave-runner/Cargo.toml b/intel-sgx/enclave-runner/Cargo.toml index e7948724..1f2ba6ec 100644 --- a/intel-sgx/enclave-runner/Cargo.toml +++ b/intel-sgx/enclave-runner/Cargo.toml @@ -20,7 +20,7 @@ exclude = ["fake-vdso/.gitignore", "fake-vdso/Makefile", "fake-vdso/main.S"] [dependencies] # Project dependencies -sgxs = { version = "0.7.2", path = "../sgxs" } +sgxs = { version = "0.8.2", path = "../sgxs" } fortanix-sgx-abi = { version = "0.5.0", path = "../fortanix-sgx-abi" } sgx-isa = { version = "0.4.0", path = "../sgx-isa" } ipc-queue = { version = "0.2.0", path = "../../ipc-queue" } diff --git a/intel-sgx/fortanix-sgx-tools/Cargo.toml b/intel-sgx/fortanix-sgx-tools/Cargo.toml index 15d08efe..224376da 100644 --- a/intel-sgx/fortanix-sgx-tools/Cargo.toml +++ b/intel-sgx/fortanix-sgx-tools/Cargo.toml @@ -19,10 +19,10 @@ edition = "2018" [dependencies] # Project dependencies -aesm-client = { version = "0.5.0", path = "../aesm-client", features = ["sgxs"] } -sgxs-loaders = { version = "0.3.0", path = "../sgxs-loaders" } -enclave-runner = { version = "0.5.0", path = "../enclave-runner" } -sgxs = { version = "0.7.0", path = "../sgxs" } +aesm-client = { version = "0.6.0", path = "../aesm-client", features = ["sgxs"] } +sgxs-loaders = { version = "0.4.0", path = "../sgxs-loaders" } +enclave-runner = { version = "0.6.0", path = "../enclave-runner" } +sgxs = { version = "0.8.0", path = "../sgxs" } sgx-isa = { version = "0.4.0", path = "../sgx-isa" } # External dependencies diff --git a/intel-sgx/ias/Cargo.toml b/intel-sgx/ias/Cargo.toml index 978cb447..411328cc 100644 --- a/intel-sgx/ias/Cargo.toml +++ b/intel-sgx/ias/Cargo.toml @@ -41,10 +41,10 @@ env_logger = "0.9.0" [target.'cfg(not(target_env="sgx"))'.dev-dependencies] clap = "2.23.3" -report-test = { version = "0.3", path = "../report-test" } -aesm-client = { version = "0.5", features = ["sgxs"], path = "../aesm-client" } -sgxs = { version = "0.7", path = "../sgxs" } -sgxs-loaders = { version = "0.3", path = "../sgxs-loaders" } +report-test = { version = "0.4", path = "../report-test" } +aesm-client = { version = "0.6", features = ["sgxs"], path = "../aesm-client" } +sgxs = { version = "0.8", path = "../sgxs" } +sgxs-loaders = { version = "0.4", path = "../sgxs-loaders" } [[example]] name = "attestation-tool" diff --git a/intel-sgx/report-test/Cargo.toml b/intel-sgx/report-test/Cargo.toml index 4b7f0d14..eb7ad033 100644 --- a/intel-sgx/report-test/Cargo.toml +++ b/intel-sgx/report-test/Cargo.toml @@ -16,8 +16,8 @@ categories = ["development-tools"] [dependencies] # Project dependencies -"enclave-runner" = { version = "0.5.0", path = "../enclave-runner" } -"sgxs" = { version = "0.7.0", path = "../sgxs" } +"enclave-runner" = { version = "0.6.0", path = "../enclave-runner" } +"sgxs" = { version = "0.8.0", path = "../sgxs" } "sgx-isa" = { version = "0.4.0", path = "../sgx-isa" } # External dependencies diff --git a/intel-sgx/sgxs-loaders/Cargo.toml b/intel-sgx/sgxs-loaders/Cargo.toml index 0a944d57..3b30793c 100644 --- a/intel-sgx/sgxs-loaders/Cargo.toml +++ b/intel-sgx/sgxs-loaders/Cargo.toml @@ -25,7 +25,7 @@ no_sgx_enclave_common = [] [dependencies] # Project dependencies -"sgxs" = { version = "0.7.0", path = "../sgxs" } +"sgxs" = { version = "0.8.0", path = "../sgxs" } "sgx-isa" = { version = "0.4.0", path = "../sgx-isa" } # External dependencies @@ -40,5 +40,5 @@ winapi = { version = "0.3.7", features = ["enclaveapi","memoryapi","processthrea [dev-dependencies] # Project dependencies -"report-test" = { version = "0.3.0", path = "../report-test" } -"aesm-client" = { version = "0.5.0", path = "../aesm-client", features = ["sgxs"] } +"report-test" = { version = "0.4.0", path = "../report-test" } +"aesm-client" = { version = "0.6.0", path = "../aesm-client", features = ["sgxs"] } diff --git a/intel-sgx/sgxs-tools/Cargo.toml b/intel-sgx/sgxs-tools/Cargo.toml index ce369219..2096941d 100644 --- a/intel-sgx/sgxs-tools/Cargo.toml +++ b/intel-sgx/sgxs-tools/Cargo.toml @@ -25,12 +25,12 @@ path = "src/sgx_detect/main.rs" [dependencies] # Project dependencies -"sgxs" = { version = "0.7.0", path = "../sgxs", features = ["crypto-openssl"] } -"sgxs-loaders" = { version = "0.3.0", path = "../sgxs-loaders" } -"aesm-client" = { version = "0.5.0", path = "../aesm-client", features = ["sgxs"] } +"sgxs" = { version = "0.8.0", path = "../sgxs", features = ["crypto-openssl"] } +"sgxs-loaders" = { version = "0.4.0", path = "../sgxs-loaders" } +"aesm-client" = { version = "0.6.0", path = "../aesm-client", features = ["sgxs"] } "sgx-isa" = { version = "0.4.0", path = "../sgx-isa" } -"report-test" = { version = "0.3.1", path = "../report-test" } -"enclave-runner" = { version = "0.5.0", path = "../enclave-runner" } +"report-test" = { version = "0.4.1", path = "../report-test" } +"enclave-runner" = { version = "0.6.0", path = "../enclave-runner" } # External dependencies lazy_static = "1" # MIT/Apache-2.0 @@ -59,7 +59,7 @@ serde_derive = "1.0.84" # MIT/Apache-2.0 serde_yaml = "0.8.8" # MIT/Apache-2.0 [target.'cfg(unix)'.dependencies] -"dcap-ql" = { version = "0.3.0", path = "../dcap-ql" } +"dcap-ql" = { version = "0.4.0", path = "../dcap-ql" } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3.7", features = ["winbase"] } From 45a5539c52997e4dff5687d6f255184fe0955e50 Mon Sep 17 00:00:00 2001 From: Nikita Shyrei Date: Tue, 12 Mar 2024 14:28:39 +0100 Subject: [PATCH 08/10] Properly update minor version Co-authored-by: YX Cao --- intel-sgx/aesm-client/Cargo.toml | 2 +- intel-sgx/dcap-provider/Cargo.toml | 2 +- intel-sgx/dcap-ql/Cargo.toml | 4 ++-- intel-sgx/dcap-retrieve-pckid/Cargo.toml | 4 ++-- intel-sgx/enclave-runner/Cargo.toml | 2 +- intel-sgx/fortanix-sgx-tools/Cargo.toml | 2 +- intel-sgx/report-test/Cargo.toml | 2 +- intel-sgx/sgxs-loaders/Cargo.toml | 2 +- intel-sgx/sgxs-tools/Cargo.toml | 2 +- intel-sgx/sgxs/Cargo.toml | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/intel-sgx/aesm-client/Cargo.toml b/intel-sgx/aesm-client/Cargo.toml index c7d9b861..ac0b6ef0 100644 --- a/intel-sgx/aesm-client/Cargo.toml +++ b/intel-sgx/aesm-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aesm-client" -version = "0.6.4" +version = "0.6.0" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/dcap-provider/Cargo.toml b/intel-sgx/dcap-provider/Cargo.toml index 02950cd6..46ad2914 100644 --- a/intel-sgx/dcap-provider/Cargo.toml +++ b/intel-sgx/dcap-provider/Cargo.toml @@ -35,7 +35,7 @@ crate-type = ["cdylib"] [dependencies] # Project dependencies "dcap-ql" = { version = "0.4.0", path = "../dcap-ql", features = ["link"] } -"report-test" = { version = "0.4.1", path = "../report-test" } +"report-test" = { version = "0.4.0", path = "../report-test" } # External dependencies byteorder = "1.1.0" # Unlicense/MIT diff --git a/intel-sgx/dcap-ql/Cargo.toml b/intel-sgx/dcap-ql/Cargo.toml index 954e8277..0488c672 100644 --- a/intel-sgx/dcap-ql/Cargo.toml +++ b/intel-sgx/dcap-ql/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcap-ql" -version = "0.4.7" +version = "0.4.0" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ @@ -54,7 +54,7 @@ yasna = { version = "0.3", features = ["num-bigint", "bit-vec"], optional = true [dev-dependencies] mbedtls = { version = ">=0.8.0, <0.10.0" } -report-test = { version = "0.4.1", path = "../report-test" } +report-test = { version = "0.4.0", path = "../report-test" } sgxs = { version = "0.8.0", path = "../sgxs" } serde = { version = "1.0.104", features = ["derive"] } serde_json = { version = "1.0" } diff --git a/intel-sgx/dcap-retrieve-pckid/Cargo.toml b/intel-sgx/dcap-retrieve-pckid/Cargo.toml index 74ee3318..bffddc56 100644 --- a/intel-sgx/dcap-retrieve-pckid/Cargo.toml +++ b/intel-sgx/dcap-retrieve-pckid/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcap-retrieve-pckid" -version = "0.2.3" +version = "0.2.0" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" @@ -16,7 +16,7 @@ categories = ["command-line-utilities"] # Project dependencies "aesm-client" = { version = "0.6.0", path = "../aesm-client", features = ["sgxs"] } "dcap-ql" = { version = "0.4.0", path = "../dcap-ql", default-features = false } -"report-test" = { version = "0.4.1", path = "../report-test" } +"report-test" = { version = "0.4.0", path = "../report-test" } "sgx-isa" = { version = "0.4.0", path = "../sgx-isa" } "sgxs-loaders" = { version = "0.4.0", path = "../sgxs-loaders" } diff --git a/intel-sgx/enclave-runner/Cargo.toml b/intel-sgx/enclave-runner/Cargo.toml index 1f2ba6ec..73cbeac2 100644 --- a/intel-sgx/enclave-runner/Cargo.toml +++ b/intel-sgx/enclave-runner/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enclave-runner" -version = "0.6.2" +version = "0.6.0" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/fortanix-sgx-tools/Cargo.toml b/intel-sgx/fortanix-sgx-tools/Cargo.toml index 224376da..6137f116 100644 --- a/intel-sgx/fortanix-sgx-tools/Cargo.toml +++ b/intel-sgx/fortanix-sgx-tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fortanix-sgx-tools" -version = "0.6.1" +version = "0.6.0" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/report-test/Cargo.toml b/intel-sgx/report-test/Cargo.toml index eb7ad033..d8fe17cb 100644 --- a/intel-sgx/report-test/Cargo.toml +++ b/intel-sgx/report-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "report-test" -version = "0.4.3" +version = "0.4.0" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/sgxs-loaders/Cargo.toml b/intel-sgx/sgxs-loaders/Cargo.toml index 3b30793c..e933b4c5 100644 --- a/intel-sgx/sgxs-loaders/Cargo.toml +++ b/intel-sgx/sgxs-loaders/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sgxs-loaders" -version = "0.4.3" +version = "0.4.0" authors = ["Fortanix, Inc."] license = "MPL-2.0" edition = "2018" diff --git a/intel-sgx/sgxs-tools/Cargo.toml b/intel-sgx/sgxs-tools/Cargo.toml index 2096941d..ef49b976 100644 --- a/intel-sgx/sgxs-tools/Cargo.toml +++ b/intel-sgx/sgxs-tools/Cargo.toml @@ -29,7 +29,7 @@ path = "src/sgx_detect/main.rs" "sgxs-loaders" = { version = "0.4.0", path = "../sgxs-loaders" } "aesm-client" = { version = "0.6.0", path = "../aesm-client", features = ["sgxs"] } "sgx-isa" = { version = "0.4.0", path = "../sgx-isa" } -"report-test" = { version = "0.4.1", path = "../report-test" } +"report-test" = { version = "0.4.0", path = "../report-test" } "enclave-runner" = { version = "0.6.0", path = "../enclave-runner" } # External dependencies diff --git a/intel-sgx/sgxs/Cargo.toml b/intel-sgx/sgxs/Cargo.toml index 670a9fcd..47c05dcd 100644 --- a/intel-sgx/sgxs/Cargo.toml +++ b/intel-sgx/sgxs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sgxs" -version = "0.8.4" +version = "0.8.0" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ From b3995174379884bfb6a41e19bc3958138b46c8ae Mon Sep 17 00:00:00 2001 From: NikitaShyrei Date: Tue, 12 Mar 2024 21:54:01 +0100 Subject: [PATCH 09/10] - missing versions --- Cargo.lock | 4 ++-- intel-sgx/aesm-client/Cargo.toml | 2 +- intel-sgx/dcap-provider/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e2bbbc13..5bdf6b59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,7 +25,7 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aesm-client" -version = "0.6.4" +version = "0.6.0" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -598,7 +598,7 @@ dependencies = [ [[package]] name = "dcap-provider" -version = "0.3.1" +version = "0.3.0" dependencies = [ "byteorder 1.3.4", "dcap-ql", diff --git a/intel-sgx/aesm-client/Cargo.toml b/intel-sgx/aesm-client/Cargo.toml index c7d9b861..ac0b6ef0 100644 --- a/intel-sgx/aesm-client/Cargo.toml +++ b/intel-sgx/aesm-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aesm-client" -version = "0.6.4" +version = "0.6.0" authors = ["Fortanix, Inc."] license = "MPL-2.0" description = """ diff --git a/intel-sgx/dcap-provider/Cargo.toml b/intel-sgx/dcap-provider/Cargo.toml index 02950cd6..86fde0c6 100644 --- a/intel-sgx/dcap-provider/Cargo.toml +++ b/intel-sgx/dcap-provider/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcap-provider" -version = "0.3.1" +version = "0.3.0" authors = ["Fortanix, Inc."] edition = "2018" license = "MPL-2.0" From 8016671159cb5710aa0efb85a6fa8c60235d14e3 Mon Sep 17 00:00:00 2001 From: NikitaShyrei Date: Tue, 12 Mar 2024 21:57:16 +0100 Subject: [PATCH 10/10] - missing version part 2 --- Cargo.lock | 14 +++++++------- intel-sgx/aesm-client/Cargo.toml | 2 +- intel-sgx/enclave-runner/Cargo.toml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5bdf6b59..5035cbab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "dcap-ql" -version = "0.4.7" +version = "0.4.0" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -643,7 +643,7 @@ dependencies = [ [[package]] name = "dcap-retrieve-pckid" -version = "0.2.3" +version = "0.2.0" dependencies = [ "aesm-client", "anyhow", @@ -822,7 +822,7 @@ dependencies = [ [[package]] name = "enclave-runner" -version = "0.6.2" +version = "0.6.0" dependencies = [ "anyhow", "crossbeam", @@ -1017,7 +1017,7 @@ dependencies = [ [[package]] name = "fortanix-sgx-tools" -version = "0.6.1" +version = "0.6.0" dependencies = [ "aesm-client", "anyhow", @@ -2817,7 +2817,7 @@ dependencies = [ [[package]] name = "report-test" -version = "0.4.3" +version = "0.4.0" dependencies = [ "anyhow", "enclave-runner", @@ -3149,7 +3149,7 @@ dependencies = [ [[package]] name = "sgxs" -version = "0.8.4" +version = "0.8.0" dependencies = [ "anyhow", "byteorder 1.3.4", @@ -3165,7 +3165,7 @@ dependencies = [ [[package]] name = "sgxs-loaders" -version = "0.4.3" +version = "0.4.0" dependencies = [ "aesm-client", "anyhow", diff --git a/intel-sgx/aesm-client/Cargo.toml b/intel-sgx/aesm-client/Cargo.toml index ac0b6ef0..6fae4777 100644 --- a/intel-sgx/aesm-client/Cargo.toml +++ b/intel-sgx/aesm-client/Cargo.toml @@ -54,5 +54,5 @@ protoc-rust = "2.8.0" # MIT/Apache-2.0 [dev-dependencies] sgx-isa = { version = "0.4.0", path = "../sgx-isa" } -"report-test" = { version = "0.4.1", path = "../report-test" } +"report-test" = { version = "0.4.0", path = "../report-test" } "sgxs-loaders" = { version = "0.4.0", path = "../sgxs-loaders" } diff --git a/intel-sgx/enclave-runner/Cargo.toml b/intel-sgx/enclave-runner/Cargo.toml index 73cbeac2..ddba47ca 100644 --- a/intel-sgx/enclave-runner/Cargo.toml +++ b/intel-sgx/enclave-runner/Cargo.toml @@ -20,7 +20,7 @@ exclude = ["fake-vdso/.gitignore", "fake-vdso/Makefile", "fake-vdso/main.S"] [dependencies] # Project dependencies -sgxs = { version = "0.8.2", path = "../sgxs" } +sgxs = { version = "0.8.0", path = "../sgxs" } fortanix-sgx-abi = { version = "0.5.0", path = "../fortanix-sgx-abi" } sgx-isa = { version = "0.4.0", path = "../sgx-isa" } ipc-queue = { version = "0.2.0", path = "../../ipc-queue" }