diff --git a/Cargo.toml b/Cargo.toml index 8d4847d..006dc9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,6 @@ rcrypto = ["rand", "rsa", "sha2", "num-integer", "num-traits"] [dependencies] x86_64 = { version = "^0.14.6", default-features = false } -xsave = { version = "^2.0.0", default-features = false } openssl = { version = "^0.10.36", optional = true } bitflags = "^1.3.2" @@ -36,6 +35,9 @@ rand = { version = "^0.8.4", optional = true } sha2 = { version = "0.10.2", optional = true } rsa = { version = "^0.6.0", optional = true } +[target.'cfg(target_arch = "x86_64")'.dependencies] +xsave = { version = "^2.0.0", default-features = false } + [dev-dependencies] testaso = "0.1" rstest = "^0.12.0" diff --git a/src/crypto/openssl.rs b/src/crypto/openssl.rs index d16feb9..513cd54 100644 --- a/src/crypto/openssl.rs +++ b/src/crypto/openssl.rs @@ -93,7 +93,7 @@ impl super::PrivateKey for RS256PrivateKey { Ok(super::SigData { signature: arr_from_bn(&s), - modulus: arr_from_bn(&*m), + modulus: arr_from_bn(m), exponent, q1: arr_from_bn(&*q1), q2: arr_from_bn(&*q2), diff --git a/src/lib.rs b/src/lib.rs index 0640933..ed4f61d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,6 +27,8 @@ pub mod crypto; pub mod page; pub mod parameters; pub mod signature; + +#[cfg(target_arch = "x86_64")] pub mod ssa; /// SGX ENCLU Leaf Instructions diff --git a/src/page/class.rs b/src/page/class.rs index 7c5bf7d..d415884 100644 --- a/src/page/class.rs +++ b/src/page/class.rs @@ -7,7 +7,7 @@ use crate::page::{Flags, SecInfo}; /// page. #[repr(u8)] #[non_exhaustive] -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Class { /// SGX Enclave Control Structure (SECS) Secs = 0, diff --git a/src/signature/hasher.rs b/src/signature/hasher.rs index aa73853..fb67bc3 100644 --- a/src/signature/hasher.rs +++ b/src/signature/hasher.rs @@ -6,7 +6,7 @@ use core::num::NonZeroU32; use core::slice::from_raw_parts; /// Input length is not a multiple of the page size -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct InvalidSize(()); /// Hashes an enclave producing a measurement diff --git a/src/ssa.rs b/src/ssa.rs index c933807..cc56a35 100644 --- a/src/ssa.rs +++ b/src/ssa.rs @@ -18,7 +18,7 @@ pub use xsave::XSave; /// Section 38.9.1.1, Table 38-9 #[non_exhaustive] -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum ExitType { Hardware, Software,