Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion fortanix-vme/fortanix-vme-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ authors = ["Fortanix, Inc."]
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" }
serde = { version = "1.0", default-features = false, optional = true }
thiserror = { version = "1.0", optional = true }
vsock = { version = "0.2.4", optional = true }

[dev-dependencies]
serde_cbor = { version = "0.11" }

[features]
std = ["serde/std", "vsock"]
std = ["serde/std", "vsock", "thiserror"]
default = ["std"]
docs = []
rustc-dep-of-std = ["core", "alloc", "serde/rustc-dep-of-std"]
6 changes: 6 additions & 0 deletions fortanix-vme/fortanix-vme-abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2026,13 +2026,19 @@ impl<'de> Deserialize<'de> for ErrorKind {
}

#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature="std", derive(thiserror::Error))]
pub enum Error {
#[cfg_attr(feature="std", error("connection not found"))]
ConnectionNotFound,
#[cfg_attr(feature="std", error("system error {0}"))]
SystemError(i32),
#[cfg_attr(feature="std", error("unknown error"))]
Unknown,
#[cfg_attr(feature="std", error("vsock error"))]
VsockError,
/// Command executed on behalf of enclave (e.g., bind, accept, ...) resulted in an error.
/// This error itself should be returned as the result of the command.
#[cfg_attr(feature="std", error("enclave command error of kind {0:?}"))]
Command(ErrorKind),
}

Expand Down
4 changes: 3 additions & 1 deletion fortanix-vme/fortanix-vme-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ edition = "2018"
authors = ["Fortanix, Inc."]

[dependencies]
anyhow = "1.0"
clap = { version = "4.0", features = ["derive"] }
clap-verbosity-flag = "3.0.3"
confidential-vm-blobs = { path = "../tools/confidential-vm-blobs/" }
env_logger = "0.9.0"
fnv = "1.0.7"
fortanix-vme-abi = { path = "../fortanix-vme-abi", features = ["std"] }
Expand All @@ -14,6 +17,5 @@ log = "0.4.21"
nitro-cli = { git = "https://github.com/aws/aws-nitro-enclaves-cli.git", rev = "v1.4.2" }
nix = "0.22.1"
rand = "0.7.3"
serde = { version = "1.0", features = ["derive"] }
serde_cbor = { version = "0.11" }
vsock = "0.2.4"
6 changes: 2 additions & 4 deletions fortanix-vme/fortanix-vme-runner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ use std::cmp;
use std::str;
use std::thread::{self, JoinHandle};
use std::io::{self, Error as IoError, ErrorKind as IoErrorKind, Read, Write};
use std::marker::PhantomData;
use std::net::{Shutdown, TcpListener, TcpStream};
use std::os::unix::io::AsRawFd;
use std::sync::{Arc, Mutex, RwLock};
use fortanix_vme_abi::{self, Addr, Error as VmeError, Response, Request, SERVER_PORT};
use vsock::{self, SockAddr as VsockAddr, Std, Vsock, VsockListener, VsockStream};

mod platforms;
pub use platforms::{Platform, NitroEnclaves, Simulator, SimulatorArgs};
pub use platforms::{Platform, NitroEnclaves, EnclaveSimulator, EnclaveSimulatorArgs};
pub use platforms::amdsevsnp::{AmdSevVm, RunningVm, VmRunArgs, VmSimulator};

const MAX_LOG_MESSAGE_LEN: usize = 80;
const PROXY_BUFF_SIZE: usize = 4192;
Expand Down Expand Up @@ -297,15 +297,13 @@ impl ClientConnection {

pub struct EnclaveRunner<P: Platform> {
servers: Vec<(Arc<Server<P>>, JoinHandle<()>)>,
platform: PhantomData<P>,
}

impl<P: Platform + 'static> EnclaveRunner<P> {
/// Creates a new enclave runner
pub fn new() -> Result<EnclaveRunner<P>, IoError> {
Ok(EnclaveRunner {
servers: Vec::new(),
platform: PhantomData,
})
}

Expand Down
Loading