Skip to content

Commit d328043

Browse files
committed
update readme for v0.9.6
1 parent 01eb675 commit d328043

File tree

109 files changed

+1188
-804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1188
-804
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD License
22

3-
Copyright (c) 2017 Baidu, Inc. All Rights Reserved.
3+
Copyright (C) 2017-2018 Baidu, Inc. All Rights Reserved.
44

55
Redistribution and use in source and binary forms, with or without
66
modification, are permitted provided that the following conditions

Readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Rust SGX SDK
22
Rust SGX SDK helps developers write Intel SGX applications in Rust programming language. [[Paper pdf]](documents/ccsp17.pdf)
33

4+
## v0.9.6 Release
5+
This version provides security enhancement for untrusted IO and additional support for monotonic counter. Untrusted IO operations in `sgx_tstd::fs` `sgx_tstd::net` and `sgx_tstd::time` are **DISABLED by default** to reduce the untrusted surface, and can be enabled by features. Trusted time support is moved to `sgx_tservice::sgxtime` and monotonic counter is provided by `sgx_tservice::sgxcounter`. Please refer to [release_notes](release_notes.md) for further details.
6+
47
## v0.9.5 Release
58
This is a **milestone version**, and may be the last version before 1.0.0. It provides supports of network access, TLS connection, trusted/untrusted file system access, trusted/untrusted time, and environment variable operations. Most important, it supports `xargo`! Now `x86_64-unknown-linux-sgx` is the new platform target. All of the code samples and third-party libraries could be built by `xargo` via `XARGO_SGX=1 make` (cargo also supported by `make`). What's more, we provide a pair of TLS client/server [sample](samplecode/tls) as a complete stack of secure! Please refer to [release_notes](release_notes.md) for further details.
69

dockerfile/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ RUN wget -O /root/sgx_2.0.tar.gz https://github.com/01org/linux-sgx/archive/sgx_
6666

6767
RUN wget 'https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init' -O /root/rustup-init && \
6868
chmod +x /root/rustup-init && \
69-
echo '1' | /root/rustup-init --default-toolchain nightly-2018-01-19 && \
69+
echo '1' | /root/rustup-init --default-toolchain nightly-2018-02-05 && \
7070
echo 'source /root/.cargo/env' >> /root/.bashrc && \
7171
/root/.cargo/bin/rustup component add rust-src && \
7272
apt-get autoclean && apt-get autoremove && rm -rf /var/cache/apt/archives/*

dockerfile/experimental/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ RUN wget -O /root/sgx_2.0.tar.gz https://github.com/01org/linux-sgx/archive/sgx_
7676

7777
RUN wget 'https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init' -O /root/rustup-init && \
7878
chmod +x /root/rustup-init && \
79-
echo '1' | /root/rustup-init --default-toolchain nightly-2018-01-19 && \
79+
echo '1' | /root/rustup-init --default-toolchain nightly-2018-02-05 && \
8080
echo 'source /root/.cargo/env' >> /root/.bashrc && \
8181
/root/.cargo/bin/rustup component add rust-src && \
8282
apt-get autoclean && apt-get autoremove && rm -rf /var/cache/apt/archives/*

libunwind/build.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main() {
1515
let target = env::var("TARGET").expect("TARGET was not set");
1616

1717
if target.contains("linux") {
18-
if target.contains("musl") && !target.contains("mips") {
18+
if target.contains("musl") {
1919
// musl is handled in lib.rs
2020
} else if !target.contains("android") {
2121
println!("cargo:rustc-link-lib=gcc_s");
@@ -43,5 +43,7 @@ fn main() {
4343
println!("cargo:rustc-link-lib=gcc_s");
4444
} else if target.contains("redox") {
4545
println!("cargo:rustc-link-lib=gcc");
46+
} else if target.contains("cloudabi") {
47+
println!("cargo:rustc-link-lib=unwind");
4648
}
4749
}

libunwind/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cfg_if! {
3535
}
3636
}
3737

38-
#[cfg(all(target_env = "musl", not(target_arch = "mips")))]
38+
#[cfg(target_env = "musl")]
3939
#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))]
4040
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
4141
extern {}

libunwind/libunwind.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ extern "C" {
9393
}
9494

9595
cfg_if! {
96-
if #[cfg(not(any(all(target_os = "android", target_arch = "arm"),
97-
all(target_os = "linux", target_arch = "arm"))))] {
96+
if #[cfg(all(any(target_os = "ios", not(target_arch = "arm"))))] {
9897
// Not ARM EHABI
9998
#[repr(C)]
10099
#[derive(Copy, Clone, PartialEq)]

release_notes.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Rust SGX SDK v0.9.6 Release Notes
2+
**Support latest Rust nightly build (nightly-2018-02-05-x86_64-unknown-linux-gnu)**
3+
4+
**Security enhancement** Added three features for `sgx_tstd`: `untrusted_fs` `untrusted_time` `untrusted_net` to control the insecure ocall interface. By default, io-related features in `fs/time/net` are **DISABLED**. To enable them, please add feature declarations such as `features = ["untrusted_fs"]` for sgx_tstd in `Cargo.toml`. All sample codes and third party libraries are updated accordingly. Note that data from unstrusted `fs/time` are **UNTRUSTED**and thus use them **AT YOUR OWN RISK**. Data from `net` are well-known as untrusted and need validation instinctively. We strongly recommend our TLS termination for network access, instead of using `net` directly.
5+
6+
**Refined sgxtime and support sgxcounter** Moved the trusted time service to `sgx_tservice::sgxtime` and implemented the monotonic counter in `sgx_tservice::sgxcounter`.
7+
18
# Rust SGX SDK v0.9.5 Release Notes
29
**Support latest Rust nightly build (nightly-2018-01-19-x86_64-unknown-linux-gnu)**
310

samplecode/backtrace/enclave/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Backtracesampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]
@@ -12,4 +12,4 @@ default = []
1212

1313
[target.'cfg(not(target_env = "sgx"))'.dependencies]
1414
sgx_types = { path = "../../../sgx_types" }
15-
sgx_tstd = { path = "../../../sgx_tstd" }
15+
sgx_tstd = { path = "../../../sgx_tstd", features = ["backtrace"] }

samplecode/backtrace/enclave/Xargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ stage = 1
1010

1111
[dependencies.std]
1212
path = "../../../xargo/sgx_tstd"
13+
features = ["backtrace"]
1314
stage = 2
1415

1516
[dependencies.sgx_rand]

samplecode/crypto/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Cryptosampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/file/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Filesampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/hello-rust/app/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["duanran01 <[email protected]>"]
55
build = "build.rs"
66

samplecode/hello-rust/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Helloworldsampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/helloworld/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Helloworldsampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/hugemem/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Hugememsampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/localattestation/attestation/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "attestation"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[features]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[dependencies]
2+
alloc = {}
3+
panic_unwind = {}
4+
panic_abort = {}
5+
6+
[dependencies.compiler_builtins]
7+
features = ["c", "compiler-builtins"]
8+
git = "https://github.com/rust-lang-nursery/compiler-builtins"
9+
stage = 1
10+
11+
[dependencies.std]
12+
path = "../../../xargo/sgx_tstd"
13+
stage = 2
14+
15+
[dependencies.sgx_rand]
16+
path = "../../../xargo/sgx_rand"
17+
stage = 3
18+
19+
[dependencies.sgx_serialize]
20+
path = "../../../xargo/sgx_serialize"
21+
stage = 3
22+
23+
[dependencies.sgx_tunittest]
24+
path = "../../../xargo/sgx_tunittest"
25+
stage = 3

samplecode/localattestation/enclave1/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "enclave1"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/localattestation/enclave2/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "enclave2"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/localattestation/enclave3/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "enclave3"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/machine-learning/app/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["duanran01 <[email protected]>"]
55
build = "build.rs"
66

samplecode/machine-learning/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Machinelearningsampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/remoteattestation/Application/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "RAenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/sealeddata/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Sealdatasampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/serialize/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Serializesampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/sgxtime/app/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["duanran01 <[email protected]>"]
55
build = "build.rs"
66

samplecode/sgxtime/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Sgxtimeenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/sgxtime/enclave/src/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ extern crate sgx_tservice;
4040

4141
use sgx_types::*;
4242
use sgx_tservice::*;
43-
//use std::string::String;
44-
//use std::vec::Vec;
45-
//use std::io::{self, Write};
46-
//use std::slice;
4743

4844
#[no_mangle]
4945
pub extern "C" fn sgx_time_sample() -> sgx_status_t {
@@ -52,7 +48,7 @@ pub extern "C" fn sgx_time_sample() -> sgx_status_t {
5248
Ok(_) => println!("Create PSE session done"),
5349
_ => println!("Cannot create PSE session"),
5450
}
55-
let ttime = SgxTime::now();
51+
let ttime = sgxtime::SgxTime::now();
5652
//println!("timestamp: {}", ttime.timestamp);
5753
match ttime {
5854
Ok(st) => println!("Ok with {:?}", st),

samplecode/test_all.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ test_cases=(backtrace \
4444

4545
for i in ${test_cases[@]}
4646
do
47-
cd ${i} && XARGO_SGX=1 make && cd bin && echo -e '\n' | ./app && cd ../ && make clean && cd .. &&
48-
cd ${i} && make && cd bin && echo -e '\n' | ./app && cd ../ && make clean && cd ..
47+
cd ${i} && make && cd bin && echo -e '\n' | ./app && cd ../ && make clean && \
48+
XARGO=1 make && cd bin && echo -e '\n' | ./app && cd ../ && make clean && cd ..
4949
done
5050

5151
echo "Done!"

samplecode/thread/enclave/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Threadsampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]

samplecode/tls/tlsclient/app/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["duanran01 <[email protected]>"]
55
build = "build.rs"
66

samplecode/tls/tlsclient/enclave/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tlsclient"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]
@@ -13,7 +13,7 @@ default = []
1313
[target.'cfg(not(target_env = "sgx"))'.dependencies]
1414
sgx_types = { path = "../../../../sgx_types" }
1515
sgx_trts = { path = "../../../../sgx_trts" }
16-
sgx_tstd = { path = "../../../../sgx_tstd" }
16+
sgx_tstd = { path = "../../../../sgx_tstd", features = ["untrusted_fs", "untrusted_net", "untrusted_time"] }
1717

1818
[dependencies]
1919
rustls = { path = "../../../../third_party/rustls" }

samplecode/tls/tlsclient/enclave/Xargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ stage = 1
1010

1111
[dependencies.std]
1212
path = "../../../../xargo/sgx_tstd"
13+
features = ["untrusted_fs", "untrusted_net", "untrusted_time"]
1314
stage = 2
1415

1516
[dependencies.sgx_rand]

samplecode/tls/tlsserver/app/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["duanran01 <[email protected]>"]
55
build = "build.rs"
66

samplecode/tls/tlsserver/enclave/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tlsclient"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]
@@ -13,7 +13,7 @@ default = []
1313
[target.'cfg(not(target_env = "sgx"))'.dependencies]
1414
sgx_types = { path = "../../../../sgx_types" }
1515
sgx_trts = { path = "../../../../sgx_trts" }
16-
sgx_tstd = { path = "../../../../sgx_tstd" }
16+
sgx_tstd = { path = "../../../../sgx_tstd", features = ["untrusted_fs", "untrusted_net", "untrusted_time"] }
1717

1818
[dependencies]
1919
rustls = { path = "../../../../third_party/rustls" }

samplecode/tls/tlsserver/enclave/Xargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ stage = 1
1010

1111
[dependencies.std]
1212
path = "../../../../xargo/sgx_tstd"
13+
features = ["untrusted_fs", "untrusted_net", "untrusted_time"]
1314
stage = 2
1415

1516
[dependencies.sgx_rand]

samplecode/unit-test/app/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["duanran01 <[email protected]>"]
55
build = "build.rs"
66

samplecode/unit-test/enclave/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Unittestsampleenclave"
3-
version = "0.9.5"
3+
version = "0.9.6"
44
authors = ["Baidu"]
55

66
[lib]
@@ -12,7 +12,7 @@ default = []
1212

1313
[target.'cfg(not(target_env = "sgx"))'.dependencies]
1414
sgx_types = { path = "../../../sgx_types" }
15-
sgx_tstd = { path = "../../../sgx_tstd" }
15+
sgx_tstd = { path = "../../../sgx_tstd", features = ["untrusted_fs", "untrusted_time"] }
1616
sgx_tcrypto = { path = "../../../sgx_tcrypto" }
1717
sgx_tunittest = { path = "../../../sgx_tunittest" }
1818
sgx_trts = { path = "../../../sgx_trts" }

0 commit comments

Comments
 (0)