Upgrade Rust SGX SDK and its deps to the latest
1. Upgrade Rust SGX SDK to v1.1.0 2. Upgrade Intel SGX SDK to v2.7.1 3. Upgrade Rust to nightly-2019-11-25
This commit is contained in:
parent
f2b4e96ed0
commit
488ec48fe7
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd src/libos
|
cd src/libos
|
||||||
output=$(cargo fmt --all -- --check 2>&1)
|
output=$(cargo fmt -- --check 2>&1)
|
||||||
retval=$?
|
retval=$?
|
||||||
|
|
||||||
if [[ $retval -eq 0 ]]
|
if [[ $retval -eq 0 ]]
|
||||||
@ -8,7 +8,7 @@ then
|
|||||||
exit 0
|
exit 0
|
||||||
elif [[ $retval -eq 1 ]]
|
elif [[ $retval -eq 1 ]]
|
||||||
then
|
then
|
||||||
echo "Rust format suggestsions (generated by \`cd src/libos && cargo fmt --all -- --check\`):"
|
echo "Rust format suggestsions (generated by \`cd src/libos && cargo fmt -- --check\`):"
|
||||||
echo
|
echo
|
||||||
echo "$output"
|
echo "$output"
|
||||||
echo
|
echo
|
||||||
|
@ -20,13 +20,13 @@
|
|||||||
# with "WIP" (work in progress).
|
# with "WIP" (work in progress).
|
||||||
|
|
||||||
cd src/libos
|
cd src/libos
|
||||||
output=$(cargo fmt --all -- --check 2>&1)
|
output=$(cargo fmt -- --check 2>&1)
|
||||||
retval=$?
|
retval=$?
|
||||||
|
|
||||||
# cargo fmt finds any format issues
|
# cargo fmt finds any format issues
|
||||||
if [[ $retval -eq 1 ]]
|
if [[ $retval -eq 1 ]]
|
||||||
then
|
then
|
||||||
echo "Rust format suggestsions (generated by \`cd src/libos && cargo fmt --all -- --check\`):"
|
echo "Rust format suggestsions (generated by \`cd src/libos && cargo fmt -- --check\`):"
|
||||||
echo
|
echo
|
||||||
echo "$output"
|
echo "$output"
|
||||||
echo
|
echo
|
||||||
|
11
.gitmodules
vendored
11
.gitmodules
vendored
@ -1,6 +1,6 @@
|
|||||||
[submodule "deps/rust-sgx-sdk"]
|
[submodule "deps/rust-sgx-sdk"]
|
||||||
path = deps/rust-sgx-sdk
|
path = deps/rust-sgx-sdk
|
||||||
url = https://github.com/baidu/rust-sgx-sdk
|
url = https://github.com/apache/incubator-teaclave-sgx-sdk
|
||||||
branch = master
|
branch = master
|
||||||
[submodule "deps/xmas-elf"]
|
[submodule "deps/xmas-elf"]
|
||||||
path = deps/xmas-elf
|
path = deps/xmas-elf
|
||||||
@ -9,3 +9,12 @@
|
|||||||
[submodule "deps/sefs"]
|
[submodule "deps/sefs"]
|
||||||
path = deps/sefs
|
path = deps/sefs
|
||||||
url = https://github.com/occlum/sefs.git
|
url = https://github.com/occlum/sefs.git
|
||||||
|
[submodule "deps/serde-sgx"]
|
||||||
|
path = deps/serde-sgx
|
||||||
|
url = https://github.com/mesalock-linux/serde-sgx
|
||||||
|
[submodule "deps/itoa-sgx"]
|
||||||
|
path = deps/itoa-sgx
|
||||||
|
url = https://github.com/mesalock-linux/itoa-sgx
|
||||||
|
[submodule "deps/serde-json-sgx"]
|
||||||
|
path = deps/serde-json-sgx
|
||||||
|
url = https://github.com/mesalock-linux/serde-json-sgx
|
||||||
|
4
Makefile
4
Makefile
@ -9,7 +9,9 @@ githooks:
|
|||||||
submodule: githooks
|
submodule: githooks
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update
|
git submodule update
|
||||||
cd deps/rust-sgx-sdk && git apply ../rust-sgx-sdk.patch
|
@# Try to apply the patches. If failed, check if the patches are already applied
|
||||||
|
cd deps/rust-sgx-sdk && git apply ../rust-sgx-sdk.patch >/dev/null 2>&1 || git apply ../rust-sgx-sdk.patch -R --check
|
||||||
|
cd deps/serde-json-sgx && git apply ../serde-json-sgx.patch >/dev/null 2>&1 || git apply ../serde-json-sgx.patch -R --check
|
||||||
cd deps/sefs/sefs-fuse && make
|
cd deps/sefs/sefs-fuse && make
|
||||||
cd tools/ && make
|
cd tools/ && make
|
||||||
|
|
||||||
|
1
deps/itoa-sgx
vendored
Submodule
1
deps/itoa-sgx
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit e35b45000adf57e592ccd66273b607fcec998258
|
2
deps/rust-sgx-sdk
vendored
2
deps/rust-sgx-sdk
vendored
@ -1 +1 @@
|
|||||||
Subproject commit a824416aba3840a2d76753b6da94130526b60893
|
Subproject commit 15b8470dd50e9628e1cb7a0fdb08989f0b5ecc35
|
118
deps/rust-sgx-sdk.patch
vendored
118
deps/rust-sgx-sdk.patch
vendored
@ -1,25 +1,25 @@
|
|||||||
From 5a6f0000e5a5d644e547fcf8a7c9c87f89ae5935 Mon Sep 17 00:00:00 2001
|
From 45e0641710606f98ed295063d171ca62990d32f3 Mon Sep 17 00:00:00 2001
|
||||||
From: Liu Shuang <ls123674@antfin.com>
|
From: LI Qing <geding.lq@alibaba-inc.com>
|
||||||
Date: Tue, 6 Aug 2019 06:59:49 +0000
|
Date: Tue, 7 Jan 2020 12:20:05 +0000
|
||||||
Subject: [PATCH] Add support for integrity-only SGX protected files
|
Subject: [PATCH] Add support for integrity-only SGX protected files
|
||||||
|
|
||||||
1. Add SgxFile::open_integrity_only API
|
1. Add SgxFile::open_integrity_only API
|
||||||
1. Add SgxFile::create_integrity_only API
|
2. Add SgxFile::create_integrity_only API
|
||||||
2. Add the unit test for integrity-only SgxFile
|
3. Add the unit test for integrity-only SgxFile
|
||||||
---
|
---
|
||||||
samplecode/unit-test/enclave/src/lib.rs | 2 +
|
samplecode/unit-test/enclave/src/lib.rs | 2 +
|
||||||
samplecode/unit-test/enclave/src/test_file.rs | 41 +++++++++++++
|
samplecode/unit-test/enclave/src/test_file.rs | 41 +++++++++++++
|
||||||
sgx_tprotected_fs/src/fs.rs | 86 +++++++++++++++++++++++++++
|
sgx_tprotected_fs/src/fs.rs | 84 +++++++++++++++++++++++++++
|
||||||
sgx_tstd/src/sgxfs.rs | 39 +++++++++++-
|
sgx_tstd/src/sgxfs.rs | 39 ++++++++++++-
|
||||||
sgx_tstd/src/sys/sgxfs.rs | 40 +++++++++++--
|
sgx_tstd/src/sys/sgxfs.rs | 39 +++++++++++--
|
||||||
sgx_types/src/function.rs | 4 ++
|
sgx_types/src/function.rs | 3 +
|
||||||
6 files changed, 205 insertions(+), 7 deletions(-)
|
6 files changed, 201 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
diff --git a/samplecode/unit-test/enclave/src/lib.rs b/samplecode/unit-test/enclave/src/lib.rs
|
diff --git a/samplecode/unit-test/enclave/src/lib.rs b/samplecode/unit-test/enclave/src/lib.rs
|
||||||
index e368e26..45579da 100644
|
index c04cb4d..14a6d63 100644
|
||||||
--- a/samplecode/unit-test/enclave/src/lib.rs
|
--- a/samplecode/unit-test/enclave/src/lib.rs
|
||||||
+++ b/samplecode/unit-test/enclave/src/lib.rs
|
+++ b/samplecode/unit-test/enclave/src/lib.rs
|
||||||
@@ -148,6 +148,8 @@ fn test_main_entrance() -> sgx_status_t {
|
@@ -157,6 +157,8 @@ fn test_main_entrance() -> size_t {
|
||||||
test_serialize_enum,
|
test_serialize_enum,
|
||||||
// std::sgxfs
|
// std::sgxfs
|
||||||
test_sgxfs,
|
test_sgxfs,
|
||||||
@ -29,10 +29,10 @@ index e368e26..45579da 100644
|
|||||||
test_fs,
|
test_fs,
|
||||||
// std::fs untrusted mode
|
// std::fs untrusted mode
|
||||||
diff --git a/samplecode/unit-test/enclave/src/test_file.rs b/samplecode/unit-test/enclave/src/test_file.rs
|
diff --git a/samplecode/unit-test/enclave/src/test_file.rs b/samplecode/unit-test/enclave/src/test_file.rs
|
||||||
index e9a85a7..0dbc805 100644
|
index 5e7466e..8b8d6d0 100644
|
||||||
--- a/samplecode/unit-test/enclave/src/test_file.rs
|
--- a/samplecode/unit-test/enclave/src/test_file.rs
|
||||||
+++ b/samplecode/unit-test/enclave/src/test_file.rs
|
+++ b/samplecode/unit-test/enclave/src/test_file.rs
|
||||||
@@ -138,3 +138,44 @@ pub fn test_fs_untrusted_fs_feature_enabled() {
|
@@ -128,3 +128,44 @@ pub fn test_fs_untrusted_fs_feature_enabled() {
|
||||||
assert!(f.is_ok());
|
assert!(f.is_ok());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,15 +78,14 @@ index e9a85a7..0dbc805 100644
|
|||||||
+ assert!(remove_result.is_ok());
|
+ assert!(remove_result.is_ok());
|
||||||
+}
|
+}
|
||||||
diff --git a/sgx_tprotected_fs/src/fs.rs b/sgx_tprotected_fs/src/fs.rs
|
diff --git a/sgx_tprotected_fs/src/fs.rs b/sgx_tprotected_fs/src/fs.rs
|
||||||
index d1e438c..b9e508f 100644
|
index 64d85d0..9ded4e8 100644
|
||||||
--- a/sgx_tprotected_fs/src/fs.rs
|
--- a/sgx_tprotected_fs/src/fs.rs
|
||||||
+++ b/sgx_tprotected_fs/src/fs.rs
|
+++ b/sgx_tprotected_fs/src/fs.rs
|
||||||
@@ -47,6 +47,16 @@ unsafe fn rsgx_fopen(filename: &CStr, mode: &CStr, key: &sgx_key_128bit_t) -> Sy
|
@@ -35,6 +35,15 @@ unsafe fn rsgx_fopen(filename: &CStr, mode: &CStr, key: &sgx_key_128bit_t) -> Sy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+unsafe fn rsgx_fopen_integrity_only(filename: &CStr, mode: &CStr) -> SysResult<SGX_FILE> {
|
+unsafe fn rsgx_fopen_integrity_only(filename: &CStr, mode: &CStr) -> SysResult<SGX_FILE> {
|
||||||
+
|
|
||||||
+ let file = sgx_fopen_integrity_only(filename.as_ptr(), mode.as_ptr());
|
+ let file = sgx_fopen_integrity_only(filename.as_ptr(), mode.as_ptr());
|
||||||
+ if file.is_null() {
|
+ if file.is_null() {
|
||||||
+ Err(errno())
|
+ Err(errno())
|
||||||
@ -96,14 +95,13 @@ index d1e438c..b9e508f 100644
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
unsafe fn rsgx_fopen_auto_key(filename: &CStr, mode: &CStr) -> SysResult<SGX_FILE> {
|
unsafe fn rsgx_fopen_auto_key(filename: &CStr, mode: &CStr) -> SysResult<SGX_FILE> {
|
||||||
|
|
||||||
let file = sgx_fopen_auto_key(filename.as_ptr(), mode.as_ptr());
|
let file = sgx_fopen_auto_key(filename.as_ptr(), mode.as_ptr());
|
||||||
@@ -218,6 +228,16 @@ unsafe fn rsgx_fimport_auto_key(filename: &CStr, key: &sgx_key_128bit_t) -> SysE
|
if file.is_null() {
|
||||||
|
@@ -193,6 +202,15 @@ unsafe fn rsgx_fimport_auto_key(filename: &CStr, key: &sgx_key_128bit_t) -> SysE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+unsafe fn rsgx_fget_mac(stream: SGX_FILE, mac: &mut sgx_aes_gcm_128bit_tag_t) -> SysError {
|
+unsafe fn rsgx_fget_mac(stream: SGX_FILE, mac: &mut sgx_aes_gcm_128bit_tag_t) -> SysError {
|
||||||
+
|
|
||||||
+ let ret = sgx_fget_mac(stream, mac as * mut sgx_aes_gcm_128bit_tag_t);
|
+ let ret = sgx_fget_mac(stream, mac as * mut sgx_aes_gcm_128bit_tag_t);
|
||||||
+ if ret == 0 {
|
+ if ret == 0 {
|
||||||
+ Ok(())
|
+ Ok(())
|
||||||
@ -115,7 +113,7 @@ index d1e438c..b9e508f 100644
|
|||||||
pub struct SgxFileStream {
|
pub struct SgxFileStream {
|
||||||
stream: SGX_FILE
|
stream: SGX_FILE
|
||||||
}
|
}
|
||||||
@@ -303,6 +323,48 @@ impl SgxFileStream {
|
@@ -278,6 +296,48 @@ impl SgxFileStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -138,8 +136,8 @@ index d1e438c..b9e508f 100644
|
|||||||
+ ///
|
+ ///
|
||||||
+ /// **mode**
|
+ /// **mode**
|
||||||
+ ///
|
+ ///
|
||||||
+ /// The file open mode string. Allowed values are any combination of ‘r’, ‘w’ or ‘a’, with possible ‘+’
|
+ /// The file open mode string. Allowed values are any combination of, or, with possible
|
||||||
+ /// and possible ‘b’ (since string functions are currently not sup- ported, ‘b’ is meaningless).
|
+ /// and possible (since string functions are currently not sup- ported, is meaningless).
|
||||||
+ ///
|
+ ///
|
||||||
+ /// # Requirements
|
+ /// # Requirements
|
||||||
+ ///
|
+ ///
|
||||||
@ -164,7 +162,7 @@ index d1e438c..b9e508f 100644
|
|||||||
/// The read function reads the requested amount of data from the file, and extends the file pointer by that amount.
|
/// The read function reads the requested amount of data from the file, and extends the file pointer by that amount.
|
||||||
///
|
///
|
||||||
/// # Description
|
/// # Description
|
||||||
@@ -542,6 +604,30 @@ impl SgxFileStream {
|
@@ -517,6 +577,30 @@ impl SgxFileStream {
|
||||||
pub fn clear_cache(&self) -> SysError {
|
pub fn clear_cache(&self) -> SysError {
|
||||||
unsafe { rsgx_fclear_cache(self.stream) }
|
unsafe { rsgx_fclear_cache(self.stream) }
|
||||||
}
|
}
|
||||||
@ -196,19 +194,19 @@ index d1e438c..b9e508f 100644
|
|||||||
|
|
||||||
///
|
///
|
||||||
diff --git a/sgx_tstd/src/sgxfs.rs b/sgx_tstd/src/sgxfs.rs
|
diff --git a/sgx_tstd/src/sgxfs.rs b/sgx_tstd/src/sgxfs.rs
|
||||||
index b03d174..1b2ce52 100644
|
index b07aaf2..ccb7f93 100644
|
||||||
--- a/sgx_tstd/src/sgxfs.rs
|
--- a/sgx_tstd/src/sgxfs.rs
|
||||||
+++ b/sgx_tstd/src/sgxfs.rs
|
+++ b/sgx_tstd/src/sgxfs.rs
|
||||||
@@ -28,7 +28,7 @@
|
@@ -17,7 +17,7 @@
|
||||||
|
|
||||||
//! Filesystem manipulation operations.
|
//! Filesystem manipulation operations.
|
||||||
|
|
||||||
-use sgx_types::sgx_key_128bit_t;
|
-use sgx_types::{sgx_key_128bit_t, sgx_align_key_128bit_t};
|
||||||
+use sgx_types::{sgx_key_128bit_t, sgx_aes_gcm_128bit_tag_t};
|
+use sgx_types::{sgx_key_128bit_t, sgx_align_key_128bit_t, sgx_aes_gcm_128bit_tag_t};
|
||||||
use io::{self, SeekFrom, Seek, Read, Initializer, Write};
|
use crate::io::{self, SeekFrom, Seek, Read, Initializer, Write};
|
||||||
use path::Path;
|
use crate::path::Path;
|
||||||
use sys::sgxfs as fs_imp;
|
use crate::sys::sgxfs as fs_imp;
|
||||||
@@ -120,6 +120,19 @@ impl SgxFile {
|
@@ -109,6 +109,19 @@ impl SgxFile {
|
||||||
OpenOptions::new().read(true).open(path.as_ref())
|
OpenOptions::new().read(true).open(path.as_ref())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +226,7 @@ index b03d174..1b2ce52 100644
|
|||||||
/// Opens a file in write-only mode.
|
/// Opens a file in write-only mode.
|
||||||
///
|
///
|
||||||
/// This function will create a file if it does not exist,
|
/// This function will create a file if it does not exist,
|
||||||
@@ -129,6 +142,15 @@ impl SgxFile {
|
@@ -118,6 +131,15 @@ impl SgxFile {
|
||||||
OpenOptions::new().write(true).open(path.as_ref())
|
OpenOptions::new().write(true).open(path.as_ref())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +242,7 @@ index b03d174..1b2ce52 100644
|
|||||||
pub fn open_ex<P: AsRef<Path>>(path: P, key: &sgx_key_128bit_t) -> io::Result<SgxFile> {
|
pub fn open_ex<P: AsRef<Path>>(path: P, key: &sgx_key_128bit_t) -> io::Result<SgxFile> {
|
||||||
OpenOptions::new().read(true).open_ex(path.as_ref(), key)
|
OpenOptions::new().read(true).open_ex(path.as_ref(), key)
|
||||||
}
|
}
|
||||||
@@ -148,6 +170,12 @@ impl SgxFile {
|
@@ -137,6 +159,12 @@ impl SgxFile {
|
||||||
pub fn clear_cache(&self) -> io::Result<()> {
|
pub fn clear_cache(&self) -> io::Result<()> {
|
||||||
self.inner.clear_cache()
|
self.inner.clear_cache()
|
||||||
}
|
}
|
||||||
@ -257,7 +255,7 @@ index b03d174..1b2ce52 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl AsInner<fs_imp::SgxFile> for SgxFile {
|
impl AsInner<fs_imp::SgxFile> for SgxFile {
|
||||||
@@ -284,6 +312,10 @@ impl OpenOptions {
|
@@ -273,6 +301,10 @@ impl OpenOptions {
|
||||||
self._open_ex(path.as_ref(), key)
|
self._open_ex(path.as_ref(), key)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +266,7 @@ index b03d174..1b2ce52 100644
|
|||||||
fn _open(&self, path: &Path) -> io::Result<SgxFile> {
|
fn _open(&self, path: &Path) -> io::Result<SgxFile> {
|
||||||
let inner = fs_imp::SgxFile::open(path, &self.0)?;
|
let inner = fs_imp::SgxFile::open(path, &self.0)?;
|
||||||
Ok(SgxFile { inner: inner })
|
Ok(SgxFile { inner: inner })
|
||||||
@@ -293,6 +325,11 @@ impl OpenOptions {
|
@@ -282,6 +314,11 @@ impl OpenOptions {
|
||||||
let inner = fs_imp::SgxFile::open_ex(path, &self.0, key)?;
|
let inner = fs_imp::SgxFile::open_ex(path, &self.0, key)?;
|
||||||
Ok(SgxFile { inner: inner })
|
Ok(SgxFile { inner: inner })
|
||||||
}
|
}
|
||||||
@ -281,19 +279,19 @@ index b03d174..1b2ce52 100644
|
|||||||
|
|
||||||
impl AsInnerMut<fs_imp::OpenOptions> for OpenOptions {
|
impl AsInnerMut<fs_imp::OpenOptions> for OpenOptions {
|
||||||
diff --git a/sgx_tstd/src/sys/sgxfs.rs b/sgx_tstd/src/sys/sgxfs.rs
|
diff --git a/sgx_tstd/src/sys/sgxfs.rs b/sgx_tstd/src/sys/sgxfs.rs
|
||||||
index a32814d..ebc3627 100644
|
index 7b47471..9735193 100644
|
||||||
--- a/sgx_tstd/src/sys/sgxfs.rs
|
--- a/sgx_tstd/src/sys/sgxfs.rs
|
||||||
+++ b/sgx_tstd/src/sys/sgxfs.rs
|
+++ b/sgx_tstd/src/sys/sgxfs.rs
|
||||||
@@ -26,7 +26,7 @@
|
@@ -15,7 +15,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// specific language governing permissions and limitations
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// under the License..
|
||||||
|
|
||||||
-use sgx_types::{sgx_status_t, sgx_key_128bit_t};
|
-use sgx_types::{sgx_status_t, sgx_key_128bit_t, sgx_align_key_128bit_t};
|
||||||
+use sgx_types::{sgx_status_t, sgx_key_128bit_t, sgx_aes_gcm_128bit_tag_t};
|
+use sgx_types::{sgx_status_t, sgx_key_128bit_t, sgx_align_key_128bit_t, sgx_aes_gcm_128bit_tag_t};
|
||||||
use sgx_trts::libc;
|
use sgx_trts::libc;
|
||||||
use sgx_tprotected_fs::{self, SgxFileStream};
|
use sgx_tprotected_fs::{self, SgxFileStream};
|
||||||
use os::unix::prelude::*;
|
use crate::os::unix::prelude::*;
|
||||||
@@ -87,7 +87,7 @@ impl SgxFile {
|
@@ -76,7 +76,7 @@ impl SgxFile {
|
||||||
let path = cstr(path)?;
|
let path = cstr(path)?;
|
||||||
let mode = opts.get_access_mode()?;
|
let mode = opts.get_access_mode()?;
|
||||||
let opts = CString::new(mode.as_bytes())?;
|
let opts = CString::new(mode.as_bytes())?;
|
||||||
@ -302,7 +300,7 @@ index a32814d..ebc3627 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn open_ex(path: &Path, opts: &OpenOptions, key: &sgx_key_128bit_t) -> io::Result<SgxFile> {
|
pub fn open_ex(path: &Path, opts: &OpenOptions, key: &sgx_key_128bit_t) -> io::Result<SgxFile> {
|
||||||
@@ -95,12 +95,23 @@ impl SgxFile {
|
@@ -84,12 +84,22 @@ impl SgxFile {
|
||||||
let path = cstr(path)?;
|
let path = cstr(path)?;
|
||||||
let mode = opts.get_access_mode()?;
|
let mode = opts.get_access_mode()?;
|
||||||
let opts = CString::new(mode.as_bytes())?;
|
let opts = CString::new(mode.as_bytes())?;
|
||||||
@ -318,7 +316,6 @@ index a32814d..ebc3627 100644
|
|||||||
+ let mode = opts.get_access_mode()?;
|
+ let mode = opts.get_access_mode()?;
|
||||||
+ let opts = CString::new(mode.as_bytes())?;
|
+ let opts = CString::new(mode.as_bytes())?;
|
||||||
+ SgxFile::open_c(&path, &opts, &sgx_key_128bit_t::default(), false, true)
|
+ SgxFile::open_c(&path, &opts, &sgx_key_128bit_t::default(), false, true)
|
||||||
+
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ pub fn open_c(path: &CStr, opts: &CStr, key: &sgx_key_128bit_t, auto: bool, integrity_only: bool) -> io::Result<SgxFile> {
|
+ pub fn open_c(path: &CStr, opts: &CStr, key: &sgx_key_128bit_t, auto: bool, integrity_only: bool) -> io::Result<SgxFile> {
|
||||||
@ -329,7 +326,7 @@ index a32814d..ebc3627 100644
|
|||||||
SgxFileStream::open_auto_key(path, opts)
|
SgxFileStream::open_auto_key(path, opts)
|
||||||
} else {
|
} else {
|
||||||
SgxFileStream::open(path, opts, key)
|
SgxFileStream::open(path, opts, key)
|
||||||
@@ -233,6 +244,23 @@ impl SgxFile {
|
@@ -222,6 +232,23 @@ impl SgxFile {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -353,7 +350,7 @@ index a32814d..ebc3627 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove(path: &Path) -> io::Result<()> {
|
pub fn remove(path: &Path) -> io::Result<()> {
|
||||||
@@ -324,4 +352,4 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
|
@@ -331,4 +358,4 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
|
||||||
let ret = io::copy(&mut reader, &mut writer)?;
|
let ret = io::copy(&mut reader, &mut writer)?;
|
||||||
fs::set_permissions(to, perm)?;
|
fs::set_permissions(to, perm)?;
|
||||||
Ok(ret)
|
Ok(ret)
|
||||||
@ -361,24 +358,23 @@ index a32814d..ebc3627 100644
|
|||||||
\ No newline at end of file
|
\ No newline at end of file
|
||||||
+}
|
+}
|
||||||
diff --git a/sgx_types/src/function.rs b/sgx_types/src/function.rs
|
diff --git a/sgx_types/src/function.rs b/sgx_types/src/function.rs
|
||||||
index 91869f7..fdd8a04 100644
|
index 5bb06e0..4e8c7bc 100644
|
||||||
--- a/sgx_types/src/function.rs
|
--- a/sgx_types/src/function.rs
|
||||||
+++ b/sgx_types/src/function.rs
|
+++ b/sgx_types/src/function.rs
|
||||||
@@ -551,6 +551,8 @@ extern {
|
@@ -609,6 +609,8 @@ extern {
|
||||||
|
|
||||||
pub fn sgx_fopen_auto_key(filename: * const ::c_char, mode: * const ::c_char) -> SGX_FILE;
|
pub fn sgx_fopen_auto_key(filename: * const c_char, mode: * const c_char) -> SGX_FILE;
|
||||||
|
|
||||||
+ pub fn sgx_fopen_integrity_only(filename: * const ::c_char, mode: * const ::c_char) -> SGX_FILE;
|
+ pub fn sgx_fopen_integrity_only(filename: * const c_char, mode: * const c_char) -> SGX_FILE;
|
||||||
+
|
+
|
||||||
pub fn sgx_fwrite(ptr: * const ::c_void,
|
pub fn sgx_fwrite(ptr: * const c_void,
|
||||||
size: ::size_t,
|
size: size_t,
|
||||||
count: ::size_t,
|
count: size_t,
|
||||||
@@ -582,6 +584,8 @@ extern {
|
@@ -630,6 +632,7 @@ extern {
|
||||||
pub fn sgx_fimport_auto_key(filename: * const ::c_char, key: * const sgx_key_128bit_t) -> ::int32_t;
|
pub fn sgx_fexport_auto_key(filename: * const c_char, key: * mut sgx_key_128bit_t) -> int32_t;
|
||||||
|
pub fn sgx_fimport_auto_key(filename: * const c_char, key: * const sgx_key_128bit_t) -> int32_t;
|
||||||
pub fn sgx_fclear_cache(stream: SGX_FILE) -> ::int32_t;
|
pub fn sgx_fclear_cache(stream: SGX_FILE) -> int32_t;
|
||||||
+
|
+ pub fn sgx_fget_mac(stream: SGX_FILE, mac: * mut sgx_aes_gcm_128bit_tag_t) -> int32_t;
|
||||||
+ pub fn sgx_fget_mac(stream: SGX_FILE, mac: * mut sgx_aes_gcm_128bit_tag_t) -> ::int32_t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* intel sgx sdk 2.0 */
|
/* intel sgx sdk 2.0 */
|
||||||
|
2
deps/sefs
vendored
2
deps/sefs
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 96fbb3ed48ec949dd3aa0d34b8a54205bd8e09d3
|
Subproject commit 8379fe273871de8fcfedf01f3b95ec73c91d548c
|
1
deps/serde-json-sgx
vendored
Submodule
1
deps/serde-json-sgx
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit c0a62f63fafdfbbbd5b89a6ad517373b93ccd41f
|
38
deps/serde-json-sgx.patch
vendored
Normal file
38
deps/serde-json-sgx.patch
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From 64bafe1617c776fcbcb5e1587841396dc62abdc5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: LI Qing <geding.lq@alibaba-inc.com>
|
||||||
|
Date: Mon, 13 Jan 2020 06:22:07 +0000
|
||||||
|
Subject: [PATCH] Modify Cargo.toml's dependency to use path instead of git url
|
||||||
|
|
||||||
|
---
|
||||||
|
Cargo.toml | 8 ++++----
|
||||||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Cargo.toml b/Cargo.toml
|
||||||
|
index 096e9f3..bab974a 100644
|
||||||
|
--- a/Cargo.toml
|
||||||
|
+++ b/Cargo.toml
|
||||||
|
@@ -17,9 +17,9 @@ travis-ci = { repository = "serde-rs/json" }
|
||||||
|
appveyor = { repository = "serde-rs/json" }
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
-serde = { git = "https://github.com/mesalock-linux/serde-sgx.git" }
|
||||||
|
-indexmap = { git = "https://github.com/mesalock-linux/indexmap-sgx.git", optional = true }
|
||||||
|
-itoa = { git = "https://github.com/mesalock-linux/itoa-sgx.git" }
|
||||||
|
+serde = { path = "../serde-sgx/serde" }
|
||||||
|
+#indexmap = { git = "https://github.com/mesalock-linux/indexmap-sgx.git", optional = true }
|
||||||
|
+itoa = { path = "../itoa-sgx" }
|
||||||
|
ryu = "1.0"
|
||||||
|
sgx_tstd = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ default = ["mesalock_sgx"]
|
||||||
|
# Use a different representation for the map type of serde_json::Value.
|
||||||
|
# This allows data to be read into a Value and written back to a JSON string
|
||||||
|
# while preserving the order of map keys in the input.
|
||||||
|
-preserve_order = ["indexmap"]
|
||||||
|
+#preserve_order = ["indexmap"]
|
||||||
|
|
||||||
|
# Use an arbitrary precision number representation for serde_json::Number. This
|
||||||
|
# allows JSON numbers of arbitrary size/precision to be read into a Number and
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
1
deps/serde-sgx
vendored
Submodule
1
deps/serde-sgx
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit c945ac9aeb23dc799070f3afaf590a6c3ac2c1a2
|
263
src/libos/Cargo.lock
generated
263
src/libos/Cargo.lock
generated
@ -4,32 +4,32 @@
|
|||||||
name = "Occlum"
|
name = "Occlum"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"derive_builder 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"derive_builder 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rcore-fs 0.1.0",
|
"rcore-fs 0.1.0",
|
||||||
"rcore-fs-mountfs 0.1.0",
|
"rcore-fs-mountfs 0.1.0",
|
||||||
"rcore-fs-ramfs 0.1.0",
|
"rcore-fs-ramfs 0.1.0",
|
||||||
"rcore-fs-sefs 0.1.0",
|
"rcore-fs-sefs 0.1.0",
|
||||||
"serde 1.0.84",
|
"serde 1.0.104",
|
||||||
"serde_json 1.0.36",
|
"serde_json 1.0.40",
|
||||||
"sgx_tcrypto 1.0.6",
|
"sgx_tcrypto 1.1.0",
|
||||||
"sgx_trts 1.0.6",
|
"sgx_trts 1.1.0",
|
||||||
"sgx_tse 1.0.6",
|
"sgx_tse 1.1.0",
|
||||||
"sgx_tstd 1.0.6",
|
"sgx_tstd 1.1.0",
|
||||||
"sgx_types 1.0.6",
|
"sgx_types 1.1.0",
|
||||||
"xmas-elf 0.6.2",
|
"xmas-elf 0.6.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "1.0.4"
|
version = "1.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -37,9 +37,14 @@ name = "bitvec"
|
|||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cc"
|
||||||
|
version = "1.0.50"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
version = "0.1.6"
|
version = "0.1.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -47,7 +52,7 @@ name = "cloudabi"
|
|||||||
version = "0.0.3"
|
version = "0.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -67,9 +72,9 @@ dependencies = [
|
|||||||
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -78,8 +83,8 @@ version = "0.9.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -90,8 +95,8 @@ dependencies = [
|
|||||||
"darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"derive_builder_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"derive_builder_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -101,8 +106,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -122,30 +127,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "0.4.1"
|
version = "0.4.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sgx_tstd 1.0.6",
|
"sgx_tstd 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lazy_static"
|
name = "lazy_static"
|
||||||
version = "1.3.0"
|
version = "1.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.62"
|
version = "0.2.66"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.6"
|
version = "0.4.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -156,21 +161,37 @@ dependencies = [
|
|||||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "1.0.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "0.6.12"
|
version = "0.6.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "1.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand"
|
name = "rand"
|
||||||
version = "0.6.5"
|
version = "0.6.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -187,7 +208,7 @@ name = "rand_chacha"
|
|||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -225,7 +246,7 @@ name = "rand_jitter"
|
|||||||
version = "0.1.4"
|
version = "0.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
@ -237,7 +258,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -248,7 +269,7 @@ name = "rand_pcg"
|
|||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -264,26 +285,26 @@ dependencies = [
|
|||||||
name = "rcore-fs"
|
name = "rcore-fs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rcore-fs-mountfs"
|
name = "rcore-fs-mountfs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rcore-fs 0.1.0",
|
"rcore-fs 0.1.0",
|
||||||
"spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rcore-fs-ramfs"
|
name = "rcore-fs-ramfs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rcore-fs 0.1.0",
|
"rcore-fs 0.1.0",
|
||||||
"spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -291,10 +312,10 @@ name = "rcore-fs-sefs"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitvec 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitvec 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rcore-fs 0.1.0",
|
"rcore-fs 0.1.0",
|
||||||
"spin 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"static_assertions 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -308,121 +329,143 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "0.2.8"
|
version = "1.0.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.84"
|
version = "1.0.104"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive 1.0.84",
|
"serde_derive 1.0.104",
|
||||||
"sgx_tstd 1.0.6",
|
"sgx_tstd 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.84"
|
version = "1.0.104"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
"proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.36"
|
version = "1.0.40"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa 0.4.1",
|
"itoa 0.4.4",
|
||||||
"ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 1.0.84",
|
"serde 1.0.104",
|
||||||
"sgx_tstd 1.0.6",
|
"sgx_tstd 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_alloc"
|
name = "sgx_alloc"
|
||||||
version = "1.0.6"
|
version = "1.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sgx_backtrace_sys"
|
||||||
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sgx_trts 1.0.6",
|
"cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"sgx_build_helper 0.1.0",
|
||||||
|
"sgx_libc 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_build_helper"
|
name = "sgx_build_helper"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sgx_demangle"
|
||||||
|
version = "1.1.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_libc"
|
name = "sgx_libc"
|
||||||
version = "1.0.6"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sgx_types 1.0.6",
|
"sgx_types 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_tcrypto"
|
name = "sgx_tcrypto"
|
||||||
version = "1.0.6"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sgx_types 1.0.6",
|
"sgx_types 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_tprotected_fs"
|
name = "sgx_tprotected_fs"
|
||||||
version = "1.0.6"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sgx_trts 1.0.6",
|
"sgx_trts 1.1.0",
|
||||||
"sgx_types 1.0.6",
|
"sgx_types 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_trts"
|
name = "sgx_trts"
|
||||||
version = "1.0.6"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sgx_libc 1.0.6",
|
"sgx_libc 1.1.0",
|
||||||
"sgx_types 1.0.6",
|
"sgx_types 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_tse"
|
name = "sgx_tse"
|
||||||
version = "1.0.6"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sgx_types 1.0.6",
|
"sgx_types 1.1.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sgx_tseal"
|
||||||
|
version = "1.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"sgx_tcrypto 1.1.0",
|
||||||
|
"sgx_trts 1.1.0",
|
||||||
|
"sgx_tse 1.1.0",
|
||||||
|
"sgx_types 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_tstd"
|
name = "sgx_tstd"
|
||||||
version = "1.0.6"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sgx_alloc 1.0.6",
|
"sgx_alloc 1.1.0",
|
||||||
"sgx_build_helper 0.1.0",
|
"sgx_backtrace_sys 1.1.0",
|
||||||
"sgx_libc 1.0.6",
|
"sgx_demangle 1.1.0",
|
||||||
"sgx_tprotected_fs 1.0.6",
|
"sgx_libc 1.1.0",
|
||||||
"sgx_trts 1.0.6",
|
"sgx_tprotected_fs 1.1.0",
|
||||||
"sgx_types 1.0.6",
|
"sgx_trts 1.1.0",
|
||||||
"sgx_unwind 0.0.1",
|
"sgx_tseal 1.1.0",
|
||||||
|
"sgx_types 1.1.0",
|
||||||
|
"sgx_unwind 0.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_types"
|
name = "sgx_types"
|
||||||
version = "1.0.6"
|
version = "1.1.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sgx_unwind"
|
name = "sgx_unwind"
|
||||||
version = "0.0.1"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sgx_trts 1.0.6",
|
"sgx_build_helper 0.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "spin"
|
name = "spin"
|
||||||
version = "0.4.9"
|
version = "0.4.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "spin"
|
name = "spin"
|
||||||
version = "0.5.0"
|
version = "0.5.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "static_assertions"
|
name = "static_assertions"
|
||||||
version = "0.3.1"
|
version = "0.3.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -432,19 +475,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "0.15.39"
|
version = "0.15.44"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "1.0.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-xid"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-xid"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "0.7.4"
|
version = "0.7.4"
|
||||||
@ -485,10 +543,11 @@ version = "0.1.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"
|
"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
|
||||||
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
|
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||||
"checksum bitvec 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfadef5c4e2c2e64067b9ecc061179f12ac7ec65ba613b1f60f3972bbada1f5b"
|
"checksum bitvec 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfadef5c4e2c2e64067b9ecc061179f12ac7ec65ba613b1f60f3972bbada1f5b"
|
||||||
"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
|
"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
|
||||||
|
"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||||
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
|
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
|
||||||
"checksum darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfbcb0c5961907597a7d1148e3af036268f2b773886b8bb3eeb1e1281d3d3d6"
|
"checksum darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfbcb0c5961907597a7d1148e3af036268f2b773886b8bb3eeb1e1281d3d3d6"
|
||||||
"checksum darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6afc018370c3bff3eb51f89256a6bdb18b4fdcda72d577982a14954a7a0b402c"
|
"checksum darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6afc018370c3bff3eb51f89256a6bdb18b4fdcda72d577982a14954a7a0b402c"
|
||||||
@ -498,11 +557,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
|
"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
|
||||||
"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
|
"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
|
||||||
"checksum ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
"checksum ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
||||||
"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
|
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
|
"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558"
|
||||||
"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
|
"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
|
||||||
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
|
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
|
||||||
"checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db"
|
"checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc"
|
||||||
|
"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
|
||||||
|
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
|
||||||
"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
|
"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
|
||||||
"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
|
"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
|
||||||
"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
|
"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
|
||||||
@ -514,13 +575,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
|
"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
|
||||||
"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
|
"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
|
||||||
"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
|
"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
|
||||||
"checksum ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "b96a9549dc8d48f2c283938303c4b5a77aa29bfbc5b54b084fb1630408899a8f"
|
"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8"
|
||||||
"checksum spin 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "37b5646825922b96b5d7d676b5bb3458a54498e96ed7b0ce09dc43a07038fea4"
|
"checksum spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ceac490aa12c567115b40b7b7fceca03a6c9d53d5defea066123debc83c5dc1f"
|
||||||
"checksum spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44363f6f51401c34e7be73db0db371c04705d35efbe9f7d6082e03a921a32c55"
|
"checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
|
||||||
"checksum static_assertions 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "389ce475f424f267dbed6479cbd8f126c5e1afb053b0acdaa019c74305fc65d1"
|
"checksum static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3"
|
||||||
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
|
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
|
||||||
"checksum syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d960b829a55e56db167e861ddb43602c003c7be0bee1d345021703fac2fb7c"
|
"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
|
||||||
|
"checksum syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4ff033220a41d1a57d8125eab57bf5263783dfdcc18688b1dacc6ce9651ef8"
|
||||||
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
|
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
|
||||||
|
"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
|
||||||
"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a"
|
"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a"
|
||||||
"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
|
"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
|
||||||
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "Occlum"
|
name = "Occlum"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "occlum_libos_core_rs"
|
name = "occlum_libos_core_rs"
|
||||||
@ -15,8 +16,11 @@ rcore-fs = { path = "../../deps/sefs/rcore-fs" }
|
|||||||
rcore-fs-sefs = { path = "../../deps/sefs/rcore-fs-sefs" }
|
rcore-fs-sefs = { path = "../../deps/sefs/rcore-fs-sefs" }
|
||||||
rcore-fs-ramfs = { path = "../../deps/sefs/rcore-fs-ramfs" }
|
rcore-fs-ramfs = { path = "../../deps/sefs/rcore-fs-ramfs" }
|
||||||
rcore-fs-mountfs = { path = "../../deps/sefs/rcore-fs-mountfs" }
|
rcore-fs-mountfs = { path = "../../deps/sefs/rcore-fs-mountfs" }
|
||||||
serde = { path = "../../deps/rust-sgx-sdk/third_party/serde-rs/serde/serde", features = ["derive"] }
|
serde = { path = "../../deps/serde-sgx/serde", features = ["derive"] }
|
||||||
serde_json = { path = "../../deps/rust-sgx-sdk/third_party/serde-rs/json" }
|
serde_json = { path = "../../deps/serde-json-sgx" }
|
||||||
|
|
||||||
|
[patch.'https://github.com/apache/teaclave-sgx-sdk.git']
|
||||||
|
sgx_tstd = { path = "../../deps/rust-sgx-sdk/sgx_tstd" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["integrity_only_opt", "sgx_file_cache"]
|
default = ["integrity_only_opt", "sgx_file_cache"]
|
||||||
|
@ -132,7 +132,7 @@ $(BUILD_DIR)/src/libos/src/Enclave_t.o: $(BUILD_DIR)/src/libos/src/Enclave_t.c
|
|||||||
@echo "CC <= $@"
|
@echo "CC <= $@"
|
||||||
|
|
||||||
$(BUILD_DIR)/src/libos/src/Enclave_t.c: $(SGX_EDGER8R) ../Enclave.edl
|
$(BUILD_DIR)/src/libos/src/Enclave_t.c: $(SGX_EDGER8R) ../Enclave.edl
|
||||||
@cd $(BUILD_DIR)/src/libos/src && $(SGX_EDGER8R) --trusted $(CUR_DIR)/../Enclave.edl --search-path $(SGX_SDK)/include --search-path $(RUST_SGX_SDK_DIR)/edl/
|
@cd $(BUILD_DIR)/src/libos/src && $(SGX_EDGER8R) --trusted $(CUR_DIR)/../Enclave.edl --search-path $(SGX_SDK)/include --search-path $(RUST_SGX_SDK_DIR)/edl
|
||||||
@echo "GEN <= $@"
|
@echo "GEN <= $@"
|
||||||
|
|
||||||
$(BUILD_DIR)/src/libos/%.o: %.c
|
$(BUILD_DIR)/src/libos/%.o: %.c
|
||||||
|
1
src/libos/rust-toolchain
Normal file
1
src/libos/rust-toolchain
Normal file
@ -0,0 +1 @@
|
|||||||
|
nightly-2019-11-25
|
@ -16,7 +16,7 @@ impl File for DevNull {
|
|||||||
Ok(bufs.iter().map(|buf| buf.len()).sum())
|
Ok(bufs.iter().map(|buf| buf.len()).sum())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ impl File for DevRandom {
|
|||||||
Ok(total_nbytes)
|
Ok(total_nbytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ impl File for DevSgx {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ impl File for DevZero {
|
|||||||
Ok(total_nbytes)
|
Ok(total_nbytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,10 +83,10 @@ pub trait File: Debug + Sync + Send + Any {
|
|||||||
return_op_unsupported_error!("set_status_flags")
|
return_op_unsupported_error!("set_status_flags")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any;
|
fn as_any(&self) -> &dyn Any;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type FileRef = Arc<Box<File>>;
|
pub type FileRef = Arc<Box<dyn File>>;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
@ -162,7 +162,7 @@ impl File for SgxFile {
|
|||||||
inner.seek(pos)
|
inner.seek(pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -429,7 +429,7 @@ impl File for StdoutFile {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -504,7 +504,7 @@ impl File for StdinFile {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ impl FileSystem for HostFS {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn root_inode(&self) -> Arc<INode> {
|
fn root_inode(&self) -> Arc<dyn INode> {
|
||||||
Arc::new(HNode {
|
Arc::new(HNode {
|
||||||
path: self.path.clone(),
|
path: self.path.clone(),
|
||||||
file: Mutex::new(None),
|
file: Mutex::new(None),
|
||||||
@ -136,7 +136,7 @@ impl INode for HNode {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn link(&self, name: &str, other: &Arc<INode>) -> Result<()> {
|
fn link(&self, name: &str, other: &Arc<dyn INode>) -> Result<()> {
|
||||||
let other = other.downcast_ref::<Self>().ok_or(FsError::NotSameFs)?;
|
let other = other.downcast_ref::<Self>().ok_or(FsError::NotSameFs)?;
|
||||||
try_std!(fs::hard_link(&other.path, &self.path.join(name)));
|
try_std!(fs::hard_link(&other.path, &self.path.join(name)));
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -155,11 +155,11 @@ impl INode for HNode {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn move_(&self, old_name: &str, target: &Arc<INode>, new_name: &str) -> Result<()> {
|
fn move_(&self, old_name: &str, target: &Arc<dyn INode>, new_name: &str) -> Result<()> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn find(&self, name: &str) -> Result<Arc<INode>> {
|
fn find(&self, name: &str) -> Result<Arc<dyn INode>> {
|
||||||
let new_path = self.path.join(name);
|
let new_path = self.path.join(name);
|
||||||
if !new_path.exists() {
|
if !new_path.exists() {
|
||||||
return Err(FsError::EntryNotFound);
|
return Err(FsError::EntryNotFound);
|
||||||
@ -193,11 +193,11 @@ impl INode for HNode {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fs(&self) -> Arc<FileSystem> {
|
fn fs(&self) -> Arc<dyn FileSystem> {
|
||||||
self.fs.clone()
|
self.fs.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any_ref(&self) -> &Any {
|
fn as_any_ref(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ trait IntoFsMetadata {
|
|||||||
|
|
||||||
impl IntoFsMetadata for fs::Metadata {
|
impl IntoFsMetadata for fs::Metadata {
|
||||||
fn into_fs_metadata(self) -> Metadata {
|
fn into_fs_metadata(self) -> Metadata {
|
||||||
use libc;
|
use sgx_trts::libc;
|
||||||
use std::os::fs::MetadataExt;
|
use std::os::fs::MetadataExt;
|
||||||
Metadata {
|
Metadata {
|
||||||
dev: self.st_dev() as usize,
|
dev: self.st_dev() as usize,
|
||||||
|
@ -4,7 +4,7 @@ use sgx_trts::libc::S_IRUSR;
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
pub struct INodeFile {
|
pub struct INodeFile {
|
||||||
inode: Arc<INode>,
|
inode: Arc<dyn INode>,
|
||||||
abs_path: String,
|
abs_path: String,
|
||||||
offset: SgxMutex<usize>,
|
offset: SgxMutex<usize>,
|
||||||
access_mode: AccessMode,
|
access_mode: AccessMode,
|
||||||
@ -159,13 +159,13 @@ impl File for INodeFile {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl INodeFile {
|
impl INodeFile {
|
||||||
pub fn open(inode: Arc<INode>, abs_path: &str, flags: u32) -> Result<Self> {
|
pub fn open(inode: Arc<dyn INode>, abs_path: &str, flags: u32) -> Result<Self> {
|
||||||
let access_mode = AccessMode::from_u32(flags)?;
|
let access_mode = AccessMode::from_u32(flags)?;
|
||||||
if (access_mode.readable() && !inode.allow_read()?) {
|
if (access_mode.readable() && !inode.allow_read()?) {
|
||||||
return_errno!(EBADF, "File not readable");
|
return_errno!(EBADF, "File not readable");
|
||||||
@ -207,7 +207,7 @@ pub trait INodeExt {
|
|||||||
fn allow_read(&self) -> Result<bool>;
|
fn allow_read(&self) -> Result<bool>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl INodeExt for INode {
|
impl INodeExt for dyn INode {
|
||||||
fn read_as_vec(&self) -> Result<Vec<u8>> {
|
fn read_as_vec(&self) -> Result<Vec<u8>> {
|
||||||
let size = self.metadata()?.size;
|
let size = self.metadata()?.size;
|
||||||
let mut buf = Vec::with_capacity(size);
|
let mut buf = Vec::with_capacity(size);
|
||||||
|
@ -159,7 +159,7 @@ pub fn do_epoll_create1(flags: c_int) -> Result<FileDesc> {
|
|||||||
info!("epoll_create1: flags: {}", flags);
|
info!("epoll_create1: flags: {}", flags);
|
||||||
|
|
||||||
let epoll = EpollFile::new()?;
|
let epoll = EpollFile::new()?;
|
||||||
let file_ref: Arc<Box<File>> = Arc::new(Box::new(epoll));
|
let file_ref: Arc<Box<dyn File>> = Arc::new(Box::new(epoll));
|
||||||
let current_ref = process::get_current();
|
let current_ref = process::get_current();
|
||||||
let mut proc = current_ref.lock().unwrap();
|
let mut proc = current_ref.lock().unwrap();
|
||||||
let fd = {
|
let fd = {
|
||||||
@ -308,7 +308,7 @@ impl Drop for EpollFileInner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl File for EpollFile {
|
impl File for EpollFile {
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ pub use self::root_inode::ROOT_INODE;
|
|||||||
pub use self::unix_socket::{AsUnixSocket, UnixSocketFile};
|
pub use self::unix_socket::{AsUnixSocket, UnixSocketFile};
|
||||||
use sgx_trts::libc::S_IWUSR;
|
use sgx_trts::libc::S_IWUSR;
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::mem::uninitialized;
|
use std::mem::MaybeUninit;
|
||||||
|
|
||||||
mod access;
|
mod access;
|
||||||
mod dev_null;
|
mod dev_null;
|
||||||
@ -54,7 +54,7 @@ pub fn do_open(path: &str, flags: u32, mode: u32) -> Result<FileDesc> {
|
|||||||
let mut proc = current_ref.lock().unwrap();
|
let mut proc = current_ref.lock().unwrap();
|
||||||
|
|
||||||
let file = proc.open_file(path, flags, mode)?;
|
let file = proc.open_file(path, flags, mode)?;
|
||||||
let file_ref: Arc<Box<File>> = Arc::new(file);
|
let file_ref: Arc<Box<dyn File>> = Arc::new(file);
|
||||||
|
|
||||||
let fd = {
|
let fd = {
|
||||||
let creation_flags = CreationFlags::from_bits_truncate(flags);
|
let creation_flags = CreationFlags::from_bits_truncate(flags);
|
||||||
@ -402,7 +402,7 @@ pub fn do_sendfile(
|
|||||||
|
|
||||||
let in_file = file_table.get(in_fd)?;
|
let in_file = file_table.get(in_fd)?;
|
||||||
let out_file = file_table.get(out_fd)?;
|
let out_file = file_table.get(out_fd)?;
|
||||||
let mut buffer: [u8; 1024 * 11] = unsafe { uninitialized() };
|
let mut buffer: [u8; 1024 * 11] = unsafe { MaybeUninit::uninit().assume_init() };
|
||||||
|
|
||||||
let mut read_offset = match offset {
|
let mut read_offset = match offset {
|
||||||
Some(offset) => offset,
|
Some(offset) => offset,
|
||||||
@ -441,7 +441,7 @@ extern "C" {
|
|||||||
|
|
||||||
impl Process {
|
impl Process {
|
||||||
/// Open a file on the process. But DO NOT add it to file table.
|
/// Open a file on the process. But DO NOT add it to file table.
|
||||||
pub fn open_file(&self, path: &str, flags: u32, mode: u32) -> Result<Box<File>> {
|
pub fn open_file(&self, path: &str, flags: u32, mode: u32) -> Result<Box<dyn File>> {
|
||||||
if path == "/dev/null" {
|
if path == "/dev/null" {
|
||||||
return Ok(Box::new(DevNull));
|
return Ok(Box::new(DevNull));
|
||||||
}
|
}
|
||||||
@ -481,7 +481,7 @@ impl Process {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Lookup INode from the cwd of the process
|
/// Lookup INode from the cwd of the process
|
||||||
pub fn lookup_inode(&self, path: &str) -> Result<Arc<INode>> {
|
pub fn lookup_inode(&self, path: &str) -> Result<Arc<dyn INode>> {
|
||||||
debug!("lookup_inode: cwd: {:?}, path: {:?}", self.get_cwd(), path);
|
debug!("lookup_inode: cwd: {:?}, path: {:?}", self.get_cwd(), path);
|
||||||
if path.len() > 0 && path.as_bytes()[0] == b'/' {
|
if path.len() > 0 && path.as_bytes()[0] == b'/' {
|
||||||
// absolute path
|
// absolute path
|
||||||
|
@ -60,7 +60,7 @@ impl File for PipeReader {
|
|||||||
Ok(total_bytes)
|
Ok(total_bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ impl File for PipeWriter {
|
|||||||
return_errno!(ESPIPE, "Pipe does not support seek")
|
return_errno!(ESPIPE, "Pipe does not support seek")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@ use rcore_fs_sefs::SEFS;
|
|||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
/// The root of file system
|
/// The root of file system
|
||||||
pub static ref ROOT_INODE: Arc<INode> = {
|
pub static ref ROOT_INODE: Arc<dyn INode> = {
|
||||||
fn init_root_inode() -> Result<Arc<INode>> {
|
fn init_root_inode() -> Result<Arc<dyn INode>> {
|
||||||
let mount_config = &config::LIBOS_CONFIG.mount;
|
let mount_config = &config::LIBOS_CONFIG.mount;
|
||||||
let root_inode = {
|
let root_inode = {
|
||||||
let rootfs = open_root_fs_according_to(mount_config)?;
|
let rootfs = open_root_fs_according_to(mount_config)?;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use super::sgx_aes_gcm_128bit_tag_t;
|
use super::sgx_aes_gcm_128bit_tag_t;
|
||||||
use alloc::prelude::ToString;
|
use alloc::string::ToString;
|
||||||
use rcore_fs::dev::TimeProvider;
|
use rcore_fs::dev::TimeProvider;
|
||||||
use rcore_fs::vfs::Timespec;
|
use rcore_fs::vfs::Timespec;
|
||||||
use rcore_fs_sefs::dev::*;
|
use rcore_fs_sefs::dev::*;
|
||||||
@ -104,7 +104,7 @@ impl SgxStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Storage for SgxStorage {
|
impl Storage for SgxStorage {
|
||||||
fn open(&self, file_id: &str) -> DevResult<Box<File>> {
|
fn open(&self, file_id: &str) -> DevResult<Box<dyn File>> {
|
||||||
let locked_file = self.get(file_id, |this| {
|
let locked_file = self.get(file_id, |this| {
|
||||||
let mut path = this.path.to_path_buf();
|
let mut path = this.path.to_path_buf();
|
||||||
path.push(file_id);
|
path.push(file_id);
|
||||||
@ -143,7 +143,7 @@ impl Storage for SgxStorage {
|
|||||||
Ok(Box::new(locked_file))
|
Ok(Box::new(locked_file))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create(&self, file_id: &str) -> DevResult<Box<File>> {
|
fn create(&self, file_id: &str) -> DevResult<Box<dyn File>> {
|
||||||
let locked_file = self.get(file_id, |this| {
|
let locked_file = self.get(file_id, |this| {
|
||||||
let mut path = this.path.to_path_buf();
|
let mut path = this.path.to_path_buf();
|
||||||
path.push(file_id);
|
path.push(file_id);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use alloc::prelude::ToString;
|
use alloc::string::ToString;
|
||||||
use std::collections::btree_map::BTreeMap;
|
use std::collections::btree_map::BTreeMap;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::sync::atomic::{spin_loop_hint, AtomicUsize, Ordering};
|
use std::sync::atomic::{spin_loop_hint, AtomicUsize, Ordering};
|
||||||
@ -83,7 +83,7 @@ impl File for UnixSocketFile {
|
|||||||
inner.ioctl(cmd)
|
inner.ioctl(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
#![crate_type = "staticlib"]
|
#![crate_type = "staticlib"]
|
||||||
#![cfg_attr(not(target_env = "sgx"), no_std)]
|
#![cfg_attr(not(target_env = "sgx"), no_std)]
|
||||||
#![cfg_attr(target_env = "sgx", feature(rustc_private))]
|
#![cfg_attr(target_env = "sgx", feature(rustc_private))]
|
||||||
#![feature(alloc)]
|
|
||||||
#![feature(allocator_api)]
|
#![feature(allocator_api)]
|
||||||
#![feature(range_contains)]
|
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
#![feature(stmt_expr_attributes)]
|
#![feature(stmt_expr_attributes)]
|
||||||
#![feature(atomic_min_max)]
|
#![feature(atomic_min_max)]
|
||||||
|
@ -135,7 +135,7 @@ impl File for SocketFile {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &Any {
|
fn as_any(&self) -> &dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ impl CpuSet {
|
|||||||
impl std::fmt::LowerHex for CpuSet {
|
impl std::fmt::LowerHex for CpuSet {
|
||||||
fn fmt(&self, fmtr: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn fmt(&self, fmtr: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
for byte in &(self.vec) {
|
for byte in &(self.vec) {
|
||||||
try!(fmtr.write_fmt(format_args!("{:02x}", byte)));
|
fmtr.write_fmt(format_args!("{:02x}", byte))?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ impl std::fmt::LowerHex for CpuSet {
|
|||||||
impl std::fmt::UpperHex for CpuSet {
|
impl std::fmt::UpperHex for CpuSet {
|
||||||
fn fmt(&self, fmtr: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn fmt(&self, fmtr: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
for byte in &(self.vec) {
|
for byte in &(self.vec) {
|
||||||
try!(fmtr.write_fmt(format_args!("{:02X}", byte)));
|
fmtr.write_fmt(format_args!("{:02X}", byte))?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ fn init_files(parent_ref: &ProcessRef, file_actions: &[FileAction]) -> Result<Fi
|
|||||||
fd,
|
fd,
|
||||||
} => {
|
} => {
|
||||||
let file = parent.open_file(path.as_str(), oflag, mode)?;
|
let file = parent.open_file(path.as_str(), oflag, mode)?;
|
||||||
let file_ref: Arc<Box<File>> = Arc::new(file);
|
let file_ref: Arc<Box<dyn File>> = Arc::new(file);
|
||||||
let creation_flags = CreationFlags::from_bits_truncate(oflag);
|
let creation_flags = CreationFlags::from_bits_truncate(oflag);
|
||||||
cloned_file_table.put_at(fd, file_ref, creation_flags.must_close_on_spawn());
|
cloned_file_table.put_at(fd, file_ref, creation_flags.must_close_on_spawn());
|
||||||
}
|
}
|
||||||
@ -166,8 +166,8 @@ fn init_files(parent_ref: &ProcessRef, file_actions: &[FileAction]) -> Result<Fi
|
|||||||
|
|
||||||
// But, for init process, we initialize file table for it
|
// But, for init process, we initialize file table for it
|
||||||
let mut file_table = FileTable::new();
|
let mut file_table = FileTable::new();
|
||||||
let stdin: Arc<Box<File>> = Arc::new(Box::new(StdinFile::new()));
|
let stdin: Arc<Box<dyn File>> = Arc::new(Box::new(StdinFile::new()));
|
||||||
let stdout: Arc<Box<File>> = Arc::new(Box::new(StdoutFile::new()));
|
let stdout: Arc<Box<dyn File>> = Arc::new(Box::new(StdoutFile::new()));
|
||||||
// TODO: implement and use a real stderr
|
// TODO: implement and use a real stderr
|
||||||
let stderr = stdout.clone();
|
let stderr = stdout.clone();
|
||||||
file_table.put(stdin, false);
|
file_table.put(stdin, false);
|
||||||
|
@ -1077,7 +1077,7 @@ fn do_socket(domain: c_int, socket_type: c_int, protocol: c_int) -> Result<isize
|
|||||||
domain, socket_type, protocol
|
domain, socket_type, protocol
|
||||||
);
|
);
|
||||||
|
|
||||||
let file_ref: Arc<Box<File>> = match domain {
|
let file_ref: Arc<Box<dyn File>> = match domain {
|
||||||
libc::AF_LOCAL => {
|
libc::AF_LOCAL => {
|
||||||
let unix_socket = UnixSocketFile::new(socket_type, protocol)?;
|
let unix_socket = UnixSocketFile::new(socket_type, protocol)?;
|
||||||
Arc::new(Box::new(unix_socket))
|
Arc::new(Box::new(unix_socket))
|
||||||
@ -1136,7 +1136,7 @@ fn do_accept4(
|
|||||||
let socket = file_ref.as_socket()?;
|
let socket = file_ref.as_socket()?;
|
||||||
|
|
||||||
let new_socket = socket.accept(addr, addr_len, flags)?;
|
let new_socket = socket.accept(addr, addr_len, flags)?;
|
||||||
let new_file_ref: Arc<Box<File>> = Arc::new(Box::new(new_socket));
|
let new_file_ref: Arc<Box<dyn File>> = Arc::new(Box::new(new_socket));
|
||||||
let new_fd = proc.get_files().lock().unwrap().put(new_file_ref, false);
|
let new_fd = proc.get_files().lock().unwrap().put(new_file_ref, false);
|
||||||
|
|
||||||
Ok(new_fd as isize)
|
Ok(new_fd as isize)
|
||||||
@ -1145,7 +1145,7 @@ fn do_accept4(
|
|||||||
check_mut_ptr(addr)?; // TODO: check addr_len
|
check_mut_ptr(addr)?; // TODO: check addr_len
|
||||||
|
|
||||||
let new_socket = unix_socket.accept()?;
|
let new_socket = unix_socket.accept()?;
|
||||||
let new_file_ref: Arc<Box<File>> = Arc::new(Box::new(new_socket));
|
let new_file_ref: Arc<Box<dyn File>> = Arc::new(Box::new(new_socket));
|
||||||
let new_fd = proc.get_files().lock().unwrap().put(new_file_ref, false);
|
let new_fd = proc.get_files().lock().unwrap().put(new_file_ref, false);
|
||||||
|
|
||||||
Ok(new_fd as isize)
|
Ok(new_fd as isize)
|
||||||
|
@ -41,7 +41,6 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
RUST_SGX_SDK_DIR := $(PROJECT_DIR)/deps/rust-sgx-sdk
|
RUST_SGX_SDK_DIR := $(PROJECT_DIR)/deps/rust-sgx-sdk
|
||||||
SGX_COMMON_CFLAGS += -I$(RUST_SGX_SDK_DIR)/common/ -I$(RUST_SGX_SDK_DIR)/edl/
|
|
||||||
|
|
||||||
ifneq ($(SGX_MODE), HW)
|
ifneq ($(SGX_MODE), HW)
|
||||||
Urts_Library_Name := sgx_urts_sim
|
Urts_Library_Name := sgx_urts_sim
|
||||||
@ -64,7 +63,8 @@ ProtectedFs_Library_Name := sgx_tprotected_fs
|
|||||||
#
|
#
|
||||||
# Export flags used to compile or link untrusted modules
|
# Export flags used to compile or link untrusted modules
|
||||||
#
|
#
|
||||||
SGX_CFLAGS_U := $(SGX_COMMON_CFLAGS) -fPIC -Wno-attributes -I$(SGX_SDK)/include
|
SGX_CFLAGS_U := $(SGX_COMMON_CFLAGS) -fPIC -Wno-attributes \
|
||||||
|
-I$(RUST_SGX_SDK_DIR)/edl -I$(SGX_SDK)/include
|
||||||
SGX_CXXFLAGS_U := $(SGX_CFLAGS_U) -std=c++11
|
SGX_CXXFLAGS_U := $(SGX_CFLAGS_U) -std=c++11
|
||||||
|
|
||||||
SGX_LFLAGS_U := $(SGX_COMMON_CFLAGS) -lpthread -L$(SGX_LIBRARY_PATH) -l$(Urts_Library_Name)
|
SGX_LFLAGS_U := $(SGX_COMMON_CFLAGS) -lpthread -L$(SGX_LIBRARY_PATH) -l$(Urts_Library_Name)
|
||||||
@ -78,7 +78,7 @@ endif
|
|||||||
# Export flags used to compile or link untrusted modules
|
# Export flags used to compile or link untrusted modules
|
||||||
#
|
#
|
||||||
SGX_CFLAGS_T := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector \
|
SGX_CFLAGS_T := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector \
|
||||||
-I$(RUST_SGX_SDK_DIR)/common/inc/ -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc
|
-I$(RUST_SGX_SDK_DIR)/common/inc -I$(RUST_SGX_SDK_DIR)/edl -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc
|
||||||
SGX_CXXFLAGS_T := $(SGX_CFLAGS_T) -std=c++11 -nostdinc++ -I$(SGX_SDK)/include/libcxx
|
SGX_CXXFLAGS_T := $(SGX_CFLAGS_T) -std=c++11 -nostdinc++ -I$(SGX_SDK)/include/libcxx
|
||||||
|
|
||||||
# Before use this linker flag, the user should define $(_Other_Enclave_Libs),
|
# Before use this linker flag, the user should define $(_Other_Enclave_Libs),
|
||||||
@ -105,7 +105,7 @@ SGX_CXXFLAGS_T := $(SGX_CFLAGS_T) -std=c++11 -nostdinc++ -I$(SGX_SDK)/include/li
|
|||||||
# linked.
|
# linked.
|
||||||
SGX_LFLAGS_T = $(SGX_COMMON_CFLAGS) -nostdlib -L$(SGX_LIBRARY_PATH) $(_Other_Link_Flags) \
|
SGX_LFLAGS_T = $(SGX_COMMON_CFLAGS) -nostdlib -L$(SGX_LIBRARY_PATH) $(_Other_Link_Flags) \
|
||||||
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
|
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
|
||||||
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) $(_Other_Enclave_Libs) -Wl,--end-group \
|
-Wl,--start-group -lsgx_tcxx -lsgx_tstdc -l$(Crypto_Library_Name) -l$(Service_Library_Name) $(_Other_Enclave_Libs) -Wl,--end-group \
|
||||||
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
|
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
|
||||||
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
|
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
|
||||||
-Wl,--defsym,__ImageBase=0 \
|
-Wl,--defsym,__ImageBase=0 \
|
||||||
|
@ -52,16 +52,15 @@ RUN wget http://www.etallen.com/cpuid/cpuid-20180519.x86_64.tar.gz && \
|
|||||||
|
|
||||||
# Install SGX SDK
|
# Install SGX SDK
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
RUN git clone https://github.com/occlum/linux-sgx && \
|
RUN git clone -b sgx_2.7.1_for_occlum https://github.com/occlum/linux-sgx && \
|
||||||
cd linux-sgx && \
|
cd linux-sgx && \
|
||||||
./download_prebuilt.sh && \
|
./download_prebuilt.sh && \
|
||||||
./compile.sh && \
|
./compile_and_install.sh && \
|
||||||
./install.sh && \
|
|
||||||
echo 'source /opt/intel/sgxsdk/environment' >> /root/.bashrc && \
|
echo 'source /opt/intel/sgxsdk/environment' >> /root/.bashrc && \
|
||||||
rm -rf /tmp/linux-sgx
|
rm -rf /tmp/linux-sgx
|
||||||
|
|
||||||
# Install Rust
|
# Install Rust
|
||||||
ENV OCCLUM_RUST_VERSION=nightly-2019-01-28
|
ENV OCCLUM_RUST_VERSION=nightly-2019-11-25
|
||||||
RUN curl https://sh.rustup.rs -sSf | \
|
RUN curl https://sh.rustup.rs -sSf | \
|
||||||
sh -s -- --default-toolchain ${OCCLUM_RUST_VERSION} -y && \
|
sh -s -- --default-toolchain ${OCCLUM_RUST_VERSION} -y && \
|
||||||
rm -rf /root/.cargo/registry && rm -rf /root/.cargo/git
|
rm -rf /root/.cargo/registry && rm -rf /root/.cargo/git
|
||||||
|
@ -52,15 +52,15 @@ RUN wget http://www.etallen.com/cpuid/cpuid-20180519.x86_64.tar.gz && \
|
|||||||
|
|
||||||
# Install SGX SDK
|
# Install SGX SDK
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
RUN git clone https://github.com/occlum/linux-sgx . && \
|
RUN git clone -b sgx_2.7.1_for_occlum https://github.com/occlum/linux-sgx && \
|
||||||
|
cd linux-sgx && \
|
||||||
./download_prebuilt.sh && \
|
./download_prebuilt.sh && \
|
||||||
./compile.sh && \
|
./compile_and_install.sh && \
|
||||||
./install.sh && \
|
|
||||||
echo 'source /opt/intel/sgxsdk/environment' >> /root/.bashrc && \
|
echo 'source /opt/intel/sgxsdk/environment' >> /root/.bashrc && \
|
||||||
rm -rf /tmp/linux-sgx
|
rm -rf /tmp/linux-sgx
|
||||||
|
|
||||||
# Install Rust
|
# Install Rust
|
||||||
ENV OCCLUM_RUST_VERSION=nightly-2019-01-28
|
ENV OCCLUM_RUST_VERSION=nightly-2019-11-25
|
||||||
RUN curl https://sh.rustup.rs -sSf | \
|
RUN curl https://sh.rustup.rs -sSf | \
|
||||||
sh -s -- --default-toolchain ${OCCLUM_RUST_VERSION} -y && \
|
sh -s -- --default-toolchain ${OCCLUM_RUST_VERSION} -y && \
|
||||||
rm -rf /root/.cargo/registry && rm -rf /root/.cargo/git
|
rm -rf /root/.cargo/registry && rm -rf /root/.cargo/git
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Start AESM service required by Intel SGX SDK if it is not running
|
# Start AESM service required by Intel SGX SDK if it is not running
|
||||||
if ! pgrep "aesm_service" > /dev/null ; then
|
if ! pgrep "aesm_service" > /dev/null ; then
|
||||||
/opt/intel/sgxpsw/aesm/aesm_service
|
LD_LIBRARY_PATH="/opt/intel/sgxpsw/aesm:$LD_LIBRARY_PATH" /opt/intel/sgxpsw/aesm/aesm_service
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user