diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d923b0f..e916a5e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: toolchain: - - 1.60.0 # MSRV + - 1.66.1 # MSRV - stable - beta - nightly diff --git a/.gitignore b/.gitignore index 96ef6c0..0c98f0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target +/.idea Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index c268efb..98e97ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.6.0" authors = ["The Enarx Project Developers"] license = "Apache-2.0" edition = "2021" -rust-version = "1.60" +rust-version = "1.66" homepage = "https://github.com/enarx/sgx" repository = "https://github.com/enarx/sgx" description = "Library for Intel SGX" @@ -25,19 +25,19 @@ is-it-maintained-open-issues = { repository = "enarx/sgx" } rcrypto = ["rand", "rsa", "sha2", "num-integer", "num-traits", "const-oid", "der", "x509",] [dependencies] -x86_64 = { version = "^0.14.6", default-features = false } -openssl = { version = "^0.10.36", optional = true } -bitflags = "^1.3.2" +x86_64 = { version = "^0.14.11", default-features = false } +openssl = { version = "^0.10.57", optional = true } +bitflags = "^2.4.0" # Used by the rcrypto feature (see above). -num-integer = { version = "^0.1.44", optional = true } -num-traits = { version = "^0.2.14", optional = true } -rand = { version = "^0.8.4", optional = true } -sha2 = { version = "0.10.2", features = ["oid"], optional = true } -rsa = { version = "0.8.1", features = ["sha2"], optional = true } +num-integer = { version = "^0.1.45", optional = true } +num-traits = { version = "^0.2.16", optional = true } +rand = { version = "^0.8.5", optional = true } +sha2 = { version = "0.10.8", features = ["oid"], optional = true } +rsa = { version = "0.9.2", features = ["sha2"], optional = true } const-oid = { version = "0.9.1", default-features = false, optional = true } -der = { version = "0.6.1", optional = true } -x509 = { version = "0.1", package = "x509-cert", default-features = false, optional = true } +der = { version = "0.7.8", optional = true } +x509 = { version = "0.2.4", package = "x509-cert", default-features = false, optional = true } [target.'cfg(target_arch = "x86_64")'.dependencies] xsave = { version = "^2.0.0", default-features = false } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index d6414d5..7703945 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.60" +channel = "1.66" profile = "minimal" diff --git a/src/crypto/rcrypto.rs b/src/crypto/rcrypto.rs index 2e13287..9f04b31 100644 --- a/src/crypto/rcrypto.rs +++ b/src/crypto/rcrypto.rs @@ -3,7 +3,8 @@ use num_integer::Integer; use num_traits::ToPrimitive; use rand::thread_rng; -use rsa::{pkcs1::DecodeRsaPrivateKey, BigUint, Pkcs1v15Sign, PublicKeyParts, RsaPrivateKey}; +use rsa::traits::PublicKeyParts; +use rsa::{pkcs1::DecodeRsaPrivateKey, BigUint, Pkcs1v15Sign, RsaPrivateKey}; use sha2::{Digest, Sha256}; fn arr_from_big(value: &BigUint) -> [u8; 384] { diff --git a/src/page/flags.rs b/src/page/flags.rs index 2b41fbc..092227a 100644 --- a/src/page/flags.rs +++ b/src/page/flags.rs @@ -5,6 +5,7 @@ bitflags::bitflags! { /// /// This type identifies the flags of one or more pages. Some of these /// flags indicate permissions. Others, indicate state. + #[derive(Copy, Clone, Debug)] pub struct Flags: u8 { const READ = 1 << 0; const WRITE = 1 << 1; diff --git a/src/parameters/attributes/features.rs b/src/parameters/attributes/features.rs index d22b713..c637e97 100644 --- a/src/parameters/attributes/features.rs +++ b/src/parameters/attributes/features.rs @@ -2,7 +2,7 @@ bitflags::bitflags! { /// Expresses the non-XSAVE related enclave features - #[derive(Default)] + #[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord)] pub struct Features: u64 { /// Enclave has been initialized by EINIT /// diff --git a/src/parameters/mod.rs b/src/parameters/mod.rs index 19a2e9c..f732896 100644 --- a/src/parameters/mod.rs +++ b/src/parameters/mod.rs @@ -22,7 +22,7 @@ bitflags::bitflags! { /// /// This type controls which extra data will be provided in the SSA page /// after an AEX. - #[derive(Default)] + #[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord)] pub struct MiscSelect: u32 { /// Report #PF and #GP information const EXINFO = 1 << 0; diff --git a/src/pck/mod.rs b/src/pck/mod.rs index 8dee57c..73677e3 100644 --- a/src/pck/mod.rs +++ b/src/pck/mod.rs @@ -43,8 +43,8 @@ impl<'a> SgxExtension<'a> { .find(|e| e.extn_id == SgxExtensionRaw::OID) .ok_or(SgxExtensionError::MissingSgxExtension)?; - let sgx_extension: SgxExtensionRaw = - Decode::from_der(extension.extn_value).map_err(SgxExtensionError::DerDecodingError)?; + let sgx_extension: SgxExtensionRaw = Decode::from_der(extension.extn_value.as_bytes()) + .map_err(SgxExtensionError::DerDecodingError)?; Ok(Self { fmspc: sgx_extension.fmspc.bytes,