v0.9.7 release. Provides sgx_tstd::untrusted
diff --git a/Readme.md b/Readme.md
index 2b7059f..8874dfc 100644
--- a/Readme.md
+++ b/Readme.md
@@ -1,6 +1,9 @@
 # Rust SGX SDK
 Rust SGX SDK helps developers write Intel SGX applications in Rust programming language. [[Paper pdf]](documents/ccsp17.pdf)
 
+## v0.9.7 Release
+This version provides a new namespace: `sgx_tstd::untrusted`, including `sgx_tstd::untrusted::fs` `sgx_tstd::untrusted::time` and `sgx_tstd::untrusted::path`, providing supports to operation to ocalls in a **untrusted** namespace. The **untrusted** namespace is always enabled no matter `untrusted_*` is set or not. We **urge** the developers to use the `sgx_tstd::untrusted` namespace to port their crates, instead of enabling the `untrusted_` series of features. Also, we renamed the `untrusted_net` feature to `net` for feature name unification. Please refer to [release_notes](release_notes.md) for further details.
+
 ## v0.9.6 Release
 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.
 
diff --git a/release_notes.md b/release_notes.md
index 66a351b..9291e3b 100644
--- a/release_notes.md
+++ b/release_notes.md
@@ -1,3 +1,8 @@
+# Rust SGX SDK v0.9.7 Release Notes
+**Provide `sgx_tstd::untrusted` namespace** v0.9.7 provides `sgx_tstd::untrusted::{fs,path,time}` which related to ocall functions. They are always enabled no matter `untrusted_fs` or `untrusted_time` feature is enabled or not. The major concern of providing such a namespace is that we want the developer to know they are invoking ocall related functions which brings **untrusted data** into the trusted execution engine. For the best security practice, explicitly importing from `sgx_tstd::untrusted` is better than enabling feature in `Cargo.toml`. We stress that `untrusted_fs` and `untrusted_time` features are designed to be **contingency plans** and should only be enabled when porting an very complex Rust crate to Rust-SGX enclaves.
+
+**Rename feature `untrusted_net` to `net`** `net` is well-known as untrusted and we think `net` is a better choice and similar to current features: `backtrace` and `stdio`.
+
 # Rust SGX SDK v0.9.6 Release Notes
 **Support latest Rust nightly build (nightly-2018-02-05-x86_64-unknown-linux-gnu)**
 
diff --git a/samplecode/backtrace/enclave/Cargo.toml b/samplecode/backtrace/enclave/Cargo.toml
index 1d43974..5f82328 100644
--- a/samplecode/backtrace/enclave/Cargo.toml
+++ b/samplecode/backtrace/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Backtracesampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/crypto/enclave/Cargo.toml b/samplecode/crypto/enclave/Cargo.toml
index 915996c..f2125f0 100644
--- a/samplecode/crypto/enclave/Cargo.toml
+++ b/samplecode/crypto/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Cryptosampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/file/enclave/Cargo.toml b/samplecode/file/enclave/Cargo.toml
index 9c25bb0..b61841f 100644
--- a/samplecode/file/enclave/Cargo.toml
+++ b/samplecode/file/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Filesampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/hello-rust/app/Cargo.toml b/samplecode/hello-rust/app/Cargo.toml
index 1e54aa4..d021e0a 100644
--- a/samplecode/hello-rust/app/Cargo.toml
+++ b/samplecode/hello-rust/app/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "app"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["duanran01 <duanran01@baidu.com>"]
 build = "build.rs"
 
diff --git a/samplecode/hello-rust/enclave/Cargo.toml b/samplecode/hello-rust/enclave/Cargo.toml
index b20378a..6193979 100644
--- a/samplecode/hello-rust/enclave/Cargo.toml
+++ b/samplecode/hello-rust/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Helloworldsampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/helloworld/enclave/Cargo.toml b/samplecode/helloworld/enclave/Cargo.toml
index b20378a..6193979 100644
--- a/samplecode/helloworld/enclave/Cargo.toml
+++ b/samplecode/helloworld/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Helloworldsampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/hugemem/enclave/Cargo.toml b/samplecode/hugemem/enclave/Cargo.toml
index 22e7614..f788757 100644
--- a/samplecode/hugemem/enclave/Cargo.toml
+++ b/samplecode/hugemem/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Hugememsampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/localattestation/attestation/Cargo.toml b/samplecode/localattestation/attestation/Cargo.toml
index b69e7d5..a51e2f3 100644
--- a/samplecode/localattestation/attestation/Cargo.toml
+++ b/samplecode/localattestation/attestation/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "attestation"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [features]
diff --git a/samplecode/localattestation/enclave1/Cargo.toml b/samplecode/localattestation/enclave1/Cargo.toml
index 24424fd..306799f 100644
--- a/samplecode/localattestation/enclave1/Cargo.toml
+++ b/samplecode/localattestation/enclave1/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "enclave1"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/localattestation/enclave2/Cargo.toml b/samplecode/localattestation/enclave2/Cargo.toml
index afe3503..c5cd86d 100644
--- a/samplecode/localattestation/enclave2/Cargo.toml
+++ b/samplecode/localattestation/enclave2/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "enclave2"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/localattestation/enclave3/Cargo.toml b/samplecode/localattestation/enclave3/Cargo.toml
index 764f24e..f9c723d 100644
--- a/samplecode/localattestation/enclave3/Cargo.toml
+++ b/samplecode/localattestation/enclave3/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "enclave3"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/machine-learning/app/Cargo.toml b/samplecode/machine-learning/app/Cargo.toml
index 1e54aa4..d021e0a 100644
--- a/samplecode/machine-learning/app/Cargo.toml
+++ b/samplecode/machine-learning/app/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "app"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["duanran01 <duanran01@baidu.com>"]
 build = "build.rs"
 
diff --git a/samplecode/machine-learning/enclave/Cargo.toml b/samplecode/machine-learning/enclave/Cargo.toml
index 65ffd16..63203a5 100644
--- a/samplecode/machine-learning/enclave/Cargo.toml
+++ b/samplecode/machine-learning/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Machinelearningsampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/remoteattestation/Application/enclave/Cargo.toml b/samplecode/remoteattestation/Application/enclave/Cargo.toml
index 5b364aa..c075d7f 100644
--- a/samplecode/remoteattestation/Application/enclave/Cargo.toml
+++ b/samplecode/remoteattestation/Application/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "RAenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/sealeddata/enclave/Cargo.toml b/samplecode/sealeddata/enclave/Cargo.toml
index 875829e..10e1d15 100644
--- a/samplecode/sealeddata/enclave/Cargo.toml
+++ b/samplecode/sealeddata/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Sealdatasampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/serialize/enclave/Cargo.toml b/samplecode/serialize/enclave/Cargo.toml
index 181e59c..1141279 100644
--- a/samplecode/serialize/enclave/Cargo.toml
+++ b/samplecode/serialize/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Serializesampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/sgxtime/app/Cargo.toml b/samplecode/sgxtime/app/Cargo.toml
index 1e54aa4..d021e0a 100644
--- a/samplecode/sgxtime/app/Cargo.toml
+++ b/samplecode/sgxtime/app/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "app"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["duanran01 <duanran01@baidu.com>"]
 build = "build.rs"
 
diff --git a/samplecode/sgxtime/enclave/Cargo.toml b/samplecode/sgxtime/enclave/Cargo.toml
index 4545e78..68bd365 100644
--- a/samplecode/sgxtime/enclave/Cargo.toml
+++ b/samplecode/sgxtime/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Sgxtimeenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/thread/enclave/Cargo.toml b/samplecode/thread/enclave/Cargo.toml
index d1e16e5..760ad05 100644
--- a/samplecode/thread/enclave/Cargo.toml
+++ b/samplecode/thread/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Threadsampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/samplecode/tls/tlsclient/app/Cargo.toml b/samplecode/tls/tlsclient/app/Cargo.toml
index 796bbf5..71d049c 100644
--- a/samplecode/tls/tlsclient/app/Cargo.toml
+++ b/samplecode/tls/tlsclient/app/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "app"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["duanran01 <duanran01@baidu.com>"]
 build = "build.rs"
 
diff --git a/samplecode/tls/tlsclient/enclave/Cargo.toml b/samplecode/tls/tlsclient/enclave/Cargo.toml
index 7025578..0db2569 100644
--- a/samplecode/tls/tlsclient/enclave/Cargo.toml
+++ b/samplecode/tls/tlsclient/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "tlsclient"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
@@ -13,7 +13,7 @@
 [target.'cfg(not(target_env = "sgx"))'.dependencies]
 sgx_types = { path = "../../../../sgx_types" }
 sgx_trts = { path = "../../../../sgx_trts" }
-sgx_tstd = { path = "../../../../sgx_tstd", features = ["untrusted_fs", "untrusted_net", "untrusted_time"] }
+sgx_tstd = { path = "../../../../sgx_tstd", features = ["net"] }
 
 [dependencies]
 rustls = { path = "../../../../third_party/rustls" }
diff --git a/samplecode/tls/tlsclient/enclave/Enclave.edl b/samplecode/tls/tlsclient/enclave/Enclave.edl
index edbd0fd..6899fe4 100644
--- a/samplecode/tls/tlsclient/enclave/Enclave.edl
+++ b/samplecode/tls/tlsclient/enclave/Enclave.edl
@@ -32,7 +32,6 @@
 enclave {
     from "sgx_tstd.edl" import *;
     from "sgx_stdio.edl" import *;
-    from "sgx_backtrace.edl" import *;
     from "sgx_net.edl" import *;
     from "sgx_time.edl" import *;
     from "sgx_tstdc.edl" import *;
diff --git a/samplecode/tls/tlsclient/enclave/Xargo.toml b/samplecode/tls/tlsclient/enclave/Xargo.toml
index ddb9ad1..66ae2d2 100644
--- a/samplecode/tls/tlsclient/enclave/Xargo.toml
+++ b/samplecode/tls/tlsclient/enclave/Xargo.toml
@@ -10,7 +10,7 @@
 
 [dependencies.std]
 path = "../../../../xargo/sgx_tstd"
-features = ["untrusted_fs", "untrusted_net", "untrusted_time"]
+features = ["net"]
 stage = 2
 
 [dependencies.sgx_rand]
diff --git a/samplecode/tls/tlsclient/enclave/src/lib.rs b/samplecode/tls/tlsclient/enclave/src/lib.rs
index 1aa455d..b4c98de 100644
--- a/samplecode/tls/tlsclient/enclave/src/lib.rs
+++ b/samplecode/tls/tlsclient/enclave/src/lib.rs
@@ -41,7 +41,7 @@
 use sgx_types::*;
 use std::collections;
 
-use std::fs;
+use std::untrusted::fs;
 use std::io::BufReader;
 
 use std::ffi::CStr;
diff --git a/samplecode/tls/tlsserver/app/Cargo.toml b/samplecode/tls/tlsserver/app/Cargo.toml
index 796bbf5..71d049c 100644
--- a/samplecode/tls/tlsserver/app/Cargo.toml
+++ b/samplecode/tls/tlsserver/app/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "app"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["duanran01 <duanran01@baidu.com>"]
 build = "build.rs"
 
diff --git a/samplecode/tls/tlsserver/enclave/Cargo.toml b/samplecode/tls/tlsserver/enclave/Cargo.toml
index 3fe5ca3..0eba178 100644
--- a/samplecode/tls/tlsserver/enclave/Cargo.toml
+++ b/samplecode/tls/tlsserver/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
-name = "tlsclient"
-version = "0.9.6"
+name = "tlsserver"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
@@ -13,7 +13,7 @@
 [target.'cfg(not(target_env = "sgx"))'.dependencies]
 sgx_types = { path = "../../../../sgx_types" }
 sgx_trts = { path = "../../../../sgx_trts" }
-sgx_tstd = { path = "../../../../sgx_tstd", features = ["untrusted_fs", "untrusted_net", "untrusted_time"] }
+sgx_tstd = { path = "../../../../sgx_tstd", features = ["net"] }
 
 [dependencies]
 rustls = { path = "../../../../third_party/rustls" }
diff --git a/samplecode/tls/tlsserver/enclave/Enclave.edl b/samplecode/tls/tlsserver/enclave/Enclave.edl
index b99c544..e821fad 100644
--- a/samplecode/tls/tlsserver/enclave/Enclave.edl
+++ b/samplecode/tls/tlsserver/enclave/Enclave.edl
@@ -32,7 +32,6 @@
 enclave {
     from "sgx_tstd.edl" import *;
     from "sgx_stdio.edl" import *;
-    from "sgx_backtrace.edl" import *;
     from "sgx_net.edl" import *;
     from "sgx_time.edl" import *;
     from "sgx_tstdc.edl" import *;
diff --git a/samplecode/tls/tlsserver/enclave/Xargo.toml b/samplecode/tls/tlsserver/enclave/Xargo.toml
index ddb9ad1..66ae2d2 100644
--- a/samplecode/tls/tlsserver/enclave/Xargo.toml
+++ b/samplecode/tls/tlsserver/enclave/Xargo.toml
@@ -10,7 +10,7 @@
 
 [dependencies.std]
 path = "../../../../xargo/sgx_tstd"
-features = ["untrusted_fs", "untrusted_net", "untrusted_time"]
+features = ["net"]
 stage = 2
 
 [dependencies.sgx_rand]
diff --git a/samplecode/tls/tlsserver/enclave/src/lib.rs b/samplecode/tls/tlsserver/enclave/src/lib.rs
index f553721..7bea1da 100644
--- a/samplecode/tls/tlsserver/enclave/src/lib.rs
+++ b/samplecode/tls/tlsserver/enclave/src/lib.rs
@@ -40,7 +40,7 @@
 
 use sgx_types::*;
 
-use std::fs;
+use std::untrusted::fs;
 use std::io::BufReader;
 
 use std::ffi::CStr;
diff --git a/samplecode/unit-test/app/Cargo.toml b/samplecode/unit-test/app/Cargo.toml
index 1e54aa4..d021e0a 100644
--- a/samplecode/unit-test/app/Cargo.toml
+++ b/samplecode/unit-test/app/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "app"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["duanran01 <duanran01@baidu.com>"]
 build = "build.rs"
 
diff --git a/samplecode/unit-test/enclave/Cargo.toml b/samplecode/unit-test/enclave/Cargo.toml
index 2302d8d..11153c1 100644
--- a/samplecode/unit-test/enclave/Cargo.toml
+++ b/samplecode/unit-test/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Unittestsampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
@@ -12,7 +12,7 @@
 
 [target.'cfg(not(target_env = "sgx"))'.dependencies]
 sgx_types = { path = "../../../sgx_types" }
-sgx_tstd = { path = "../../../sgx_tstd", features = ["untrusted_fs", "untrusted_time"] }
+sgx_tstd = { path = "../../../sgx_tstd",features = ["untrusted_fs"]}
 sgx_tcrypto = { path = "../../../sgx_tcrypto" }
 sgx_tunittest = { path = "../../../sgx_tunittest" }
 sgx_trts = { path = "../../../sgx_trts" }
diff --git a/samplecode/unit-test/enclave/Xargo.toml b/samplecode/unit-test/enclave/Xargo.toml
index 7584c5b..c91357a 100644
--- a/samplecode/unit-test/enclave/Xargo.toml
+++ b/samplecode/unit-test/enclave/Xargo.toml
@@ -10,7 +10,7 @@
 
 [dependencies.std]
 path = "../../../xargo/sgx_tstd"
-features = ["untrusted_fs", "untrusted_time"]
+features = ["untrusted_fs"]
 stage = 2
 
 [dependencies.sgx_rand]
@@ -23,4 +23,4 @@
 
 [dependencies.sgx_tunittest]
 path = "../../../xargo/sgx_tunittest"
-stage = 3
\ No newline at end of file
+stage = 3
diff --git a/samplecode/unit-test/enclave/src/lib.rs b/samplecode/unit-test/enclave/src/lib.rs
index 346edc4..b75a1f7 100644
--- a/samplecode/unit-test/enclave/src/lib.rs
+++ b/samplecode/unit-test/enclave/src/lib.rs
@@ -134,6 +134,8 @@
                      test_sgxfs,
                      // std::fs
                      test_fs,
+                     // std::fs untrusted mode
+                     test_fs_untrusted_fs_feature_enabled,
                      // std::time
                      test_std_time
                      );
diff --git a/samplecode/unit-test/enclave/src/test_file.rs b/samplecode/unit-test/enclave/src/test_file.rs
index ea1ecce..88a039c 100644
--- a/samplecode/unit-test/enclave/src/test_file.rs
+++ b/samplecode/unit-test/enclave/src/test_file.rs
@@ -28,8 +28,8 @@
 
 use sgx_rand::{Rng, StdRng};
 use std::sgxfs::{self, SgxFile};
-use std::fs::File;
-use std::fs::remove_file;
+use std::untrusted::fs::File;
+use std::untrusted::fs::remove_file;
 use std::io::{Read, Write};
 use std::string::*;
 
@@ -116,3 +116,25 @@
         assert!(f.is_ok());
     }
 }
+
+pub fn test_fs_untrusted_fs_feature_enabled() {
+    {
+        use std::fs;
+        let f = fs::File::create("foo.txt");
+        assert!(f.is_ok());
+
+        let result = f.unwrap().write_all(b"Hello, world!");
+        assert!(result.is_ok());
+
+        let f = fs::File::open("foo.txt");
+        assert!(f.is_ok());
+
+        let mut s = String::new();
+        let result = f.unwrap().read_to_string(&mut s);
+        assert!(result.is_ok());
+        assert_eq!(s, "Hello, world!");
+
+        let f = remove_file("foo.txt");
+        assert!(f.is_ok());
+    }
+}
diff --git a/samplecode/unit-test/enclave/src/test_time.rs b/samplecode/unit-test/enclave/src/test_time.rs
index 218cd84..d566f81 100644
--- a/samplecode/unit-test/enclave/src/test_time.rs
+++ b/samplecode/unit-test/enclave/src/test_time.rs
@@ -1,6 +1,6 @@
 use std::time::*;
 use std::panic;
-//use std::thread::sleep;
+use std::untrusted::time::{InstantEx, SystemTimeEx};
 
 pub fn test_std_time() {
     macro_rules! assert_almost_eq {
diff --git a/samplecode/zlib-lazy-static-sample/app/Cargo.toml b/samplecode/zlib-lazy-static-sample/app/Cargo.toml
index 1e54aa4..d021e0a 100644
--- a/samplecode/zlib-lazy-static-sample/app/Cargo.toml
+++ b/samplecode/zlib-lazy-static-sample/app/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "app"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["duanran01 <duanran01@baidu.com>"]
 build = "build.rs"
 
diff --git a/samplecode/zlib-lazy-static-sample/enclave/Cargo.toml b/samplecode/zlib-lazy-static-sample/enclave/Cargo.toml
index 6b77dd8..c2bcf9e 100644
--- a/samplecode/zlib-lazy-static-sample/enclave/Cargo.toml
+++ b/samplecode/zlib-lazy-static-sample/enclave/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "Zlibsampleenclave"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_alloc/Cargo.toml b/sgx_alloc/Cargo.toml
index ba21ff8..b2006e8 100644
--- a/sgx_alloc/Cargo.toml
+++ b/sgx_alloc/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_alloc"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_rand/Cargo.toml b/sgx_rand/Cargo.toml
index 70a1158..bbb58b9 100644
--- a/sgx_rand/Cargo.toml
+++ b/sgx_rand/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_rand"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_rand_derive/Cargo.toml b/sgx_rand_derive/Cargo.toml
index 0d25d2c..fbeb611 100644
--- a/sgx_rand_derive/Cargo.toml
+++ b/sgx_rand_derive/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_rand_derive"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_serialize/Cargo.toml b/sgx_serialize/Cargo.toml
index 1600eef..f9fddd0 100644
--- a/sgx_serialize/Cargo.toml
+++ b/sgx_serialize/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_serialize"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_serialize_derive/Cargo.toml b/sgx_serialize_derive/Cargo.toml
index 95c62be..108c81a 100644
--- a/sgx_serialize_derive/Cargo.toml
+++ b/sgx_serialize_derive/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_serialize_derive"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_serialize_derive_internals/Cargo.toml b/sgx_serialize_derive_internals/Cargo.toml
index 1cb3f1e..65020fa 100644
--- a/sgx_serialize_derive_internals/Cargo.toml
+++ b/sgx_serialize_derive_internals/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_serialize_derive_internals"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_tcrypto/Cargo.toml b/sgx_tcrypto/Cargo.toml
index 83e0c24..327ea2e 100644
--- a/sgx_tcrypto/Cargo.toml
+++ b/sgx_tcrypto/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tcrypto"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_tdh/Cargo.toml b/sgx_tdh/Cargo.toml
index 3e3c0ae..1972436 100644
--- a/sgx_tdh/Cargo.toml
+++ b/sgx_tdh/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tdh"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_tkey_exchange/Cargo.toml b/sgx_tkey_exchange/Cargo.toml
index eff4661..e5d017f 100644
--- a/sgx_tkey_exchange/Cargo.toml
+++ b/sgx_tkey_exchange/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tkey_exchange"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_tprotected_fs/Cargo.toml b/sgx_tprotected_fs/Cargo.toml
index a598bfc..a9a7304 100644
--- a/sgx_tprotected_fs/Cargo.toml
+++ b/sgx_tprotected_fs/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tprotected_fs"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_trts/Cargo.toml b/sgx_trts/Cargo.toml
index af959d1..297671e 100644
--- a/sgx_trts/Cargo.toml
+++ b/sgx_trts/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_trts"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_tse/Cargo.toml b/sgx_tse/Cargo.toml
index 714d938..1df6bfb 100644
--- a/sgx_tse/Cargo.toml
+++ b/sgx_tse/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tse"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_tseal/Cargo.toml b/sgx_tseal/Cargo.toml
index d393b80..bfb2a84 100644
--- a/sgx_tseal/Cargo.toml
+++ b/sgx_tseal/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tseal"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_tservice/Cargo.toml b/sgx_tservice/Cargo.toml
index 2060d97..74f4923 100644
--- a/sgx_tservice/Cargo.toml
+++ b/sgx_tservice/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tservice"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_tstd/Cargo.toml b/sgx_tstd/Cargo.toml
index 1372c66..c3bb18c 100644
--- a/sgx_tstd/Cargo.toml
+++ b/sgx_tstd/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tstd"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 build = "build.rs"
 
@@ -12,8 +12,8 @@
 default = ["stdio"]
 backtrace = ["stdio"]
 stdio = []
+net = []
 untrusted_fs = []
-untrusted_net = []
 untrusted_time = []
 
 [build-dependencies]
diff --git a/sgx_tstd/src/lib.rs b/sgx_tstd/src/lib.rs
index 5ef66f0..13479e4 100644
--- a/sgx_tstd/src/lib.rs
+++ b/sgx_tstd/src/lib.rs
@@ -211,6 +211,7 @@
 pub mod time;
 pub mod heap;
 pub mod enclave;
+pub mod untrusted;
 
 // Platform-abstraction modules
 mod sys_common;
@@ -220,6 +221,8 @@
 mod panicking;
 mod cpuid;
 mod memchr;
+#[cfg(not(feature = "untrusted_fs"))]
+mod fs;
 
 // The runtime entry point and a few unstable public functions used by the
 // compiler
diff --git a/sgx_tstd/src/net/mod.rs b/sgx_tstd/src/net/mod.rs
index d14847c..a481be3 100644
--- a/sgx_tstd/src/net/mod.rs
+++ b/sgx_tstd/src/net/mod.rs
@@ -38,18 +38,18 @@
 
 pub use self::ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
 pub use self::addr::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs};
-#[cfg(feature = "untrusted_net")]
+#[cfg(feature = "net")]
 pub use self::tcp::TcpStream;
-#[cfg(feature = "untrusted_net")]
+#[cfg(feature = "net")]
 pub use self::udp::UdpSocket;
 pub use self::parser::AddrParseError;
 
 mod ip;
 mod addr;
 mod parser;
-#[cfg(feature = "untrusted_net")]
+#[cfg(feature = "net")]
 mod tcp;
-#[cfg(feature = "untrusted_net")]
+#[cfg(feature = "net")]
 mod udp;
 
 /// Possible values which can be passed to the [`shutdown`] method of
diff --git a/sgx_tstd/src/os/fs.rs b/sgx_tstd/src/os/fs.rs
index c3bb25b..f899511 100644
--- a/sgx_tstd/src/os/fs.rs
+++ b/sgx_tstd/src/os/fs.rs
@@ -28,7 +28,10 @@
 
 use sgx_trts::libc;
 
+#[cfg(feature = "untrusted_fs")]
 use fs::Metadata;
+#[cfg(not(feature = "untrusted_fs"))]
+use untrusted::fs::Metadata;
 use sys_common::AsInner;
 
 use os::raw;
diff --git a/sgx_tstd/src/os/mod.rs b/sgx_tstd/src/os/mod.rs
index 8501496..dd8bc0e 100644
--- a/sgx_tstd/src/os/mod.rs
+++ b/sgx_tstd/src/os/mod.rs
@@ -28,5 +28,4 @@
 
 pub use sys::ext as unix;
 pub mod raw;
-#[cfg(feature = "untrusted_fs")]
 pub mod fs;
\ No newline at end of file
diff --git a/sgx_tstd/src/sgxfs.rs b/sgx_tstd/src/sgxfs.rs
index ab14e6e..c8fd3b6 100644
--- a/sgx_tstd/src/sgxfs.rs
+++ b/sgx_tstd/src/sgxfs.rs
@@ -320,7 +320,6 @@
 ///
 /// On success, the total number of bytes copied is returned.
 ///
-#[cfg(feature = "untrusted_fs")]
 pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<u64> {
     fs_imp::copy(from.as_ref(), to.as_ref())
 }
diff --git a/sgx_tstd/src/sys/ext/fs.rs b/sgx_tstd/src/sys/ext/fs.rs
index 338c017..2c6e229 100644
--- a/sgx_tstd/src/sys/ext/fs.rs
+++ b/sgx_tstd/src/sys/ext/fs.rs
@@ -27,7 +27,10 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 use sgx_trts::libc;
+#[cfg(feature = "untrusted_fs")]
 use fs::{self, Permissions, OpenOptions};
+#[cfg(not(feature = "untrusted_fs"))]
+use untrusted::fs::{self, Permissions, OpenOptions};
 use io;
 use path::Path;
 use sys;
diff --git a/sgx_tstd/src/sys/ext/io.rs b/sgx_tstd/src/sys/ext/io.rs
index f94e51a..f264f5c 100644
--- a/sgx_tstd/src/sys/ext/io.rs
+++ b/sgx_tstd/src/sys/ext/io.rs
@@ -31,6 +31,8 @@
 use sgx_trts::libc;
 #[cfg(feature = "untrusted_fs")]
 use fs;
+#[cfg(not(feature = "untrusted_fs"))]
+use untrusted::fs;
 use os::raw;
 use sys;
 use io;
@@ -83,21 +85,18 @@
     fn into_raw_fd(self) -> RawFd;
 }
 
-#[cfg(feature = "untrusted_fs")]
 impl AsRawFd for fs::File {
     fn as_raw_fd(&self) -> RawFd {
         self.as_inner().fd().raw()
     }
 }
 
-#[cfg(feature = "untrusted_fs")]
 impl FromRawFd for fs::File {
     unsafe fn from_raw_fd(fd: RawFd) -> fs::File {
         fs::File::from_inner(sys::fs::File::from_inner(fd))
     }
 }
 
-#[cfg(feature = "untrusted_fs")]
 impl IntoRawFd for fs::File {
     fn into_raw_fd(self) -> RawFd {
         self.into_inner().into_fd().into_raw()
diff --git a/sgx_tstd/src/sys/ext/mod.rs b/sgx_tstd/src/sys/ext/mod.rs
index a820717..3e2d74e 100644
--- a/sgx_tstd/src/sys/ext/mod.rs
+++ b/sgx_tstd/src/sys/ext/mod.rs
@@ -28,9 +28,8 @@
 
 pub mod io;
 pub mod ffi;
-#[cfg(feature = "untrusted_fs")]
 pub mod fs;
-#[cfg(feature = "untrusted_net")]
+#[cfg(feature = "net")]
 pub mod net;
 
 /// A prelude for conveniently writing platform-specific code.
@@ -39,8 +38,6 @@
 pub mod prelude {
     pub use super::io::{RawFd, AsRawFd, FromRawFd, IntoRawFd};
     pub use super::ffi::{OsStrExt, OsStringExt};
-    #[cfg(feature = "untrusted_fs")]
     pub use super::fs::{PermissionsExt, OpenOptionsExt, MetadataExt, FileTypeExt};
-    #[cfg(feature = "untrusted_fs")]
     pub use super::fs::FileExt;
 }
diff --git a/sgx_tstd/src/sys/fs.rs b/sgx_tstd/src/sys/fs.rs
index 03b8d3c..9e2a0b0 100644
--- a/sgx_tstd/src/sys/fs.rs
+++ b/sgx_tstd/src/sys/fs.rs
@@ -431,7 +431,16 @@
 }
 
 pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
-    use fs::{File, set_permissions};
+
+    cfg_if! {
+        if #[cfg(feature = "untrusted_fs")] {
+            use fs::{File, set_permissions};
+        } else {
+            use untrusted::fs::{File, set_permissions};
+            use untrusted::path::PathEx;
+        }
+    }
+
     if !from.is_file() {
         return Err(Error::new(ErrorKind::InvalidInput,
                               "the source path is not an existing regular file"))
diff --git a/sgx_tstd/src/sys/mod.rs b/sgx_tstd/src/sys/mod.rs
index 798a149..5c731e8 100644
--- a/sgx_tstd/src/sys/mod.rs
+++ b/sgx_tstd/src/sys/mod.rs
@@ -32,10 +32,9 @@
 pub use self::rand::hashmap_random_keys;
 
 pub mod fd;
-#[cfg(feature = "untrusted_fs")]
 pub mod fs;
 pub mod sgxfs;
-#[cfg(feature = "untrusted_net")]
+#[cfg(feature = "net")]
 pub mod net;
 pub mod os_str;
 pub mod path;
diff --git a/sgx_tstd/src/sys/sgxfs.rs b/sgx_tstd/src/sys/sgxfs.rs
index 1b8cc70..c6508f6 100644
--- a/sgx_tstd/src/sys/sgxfs.rs
+++ b/sgx_tstd/src/sys/sgxfs.rs
@@ -299,10 +299,17 @@
     }
 }
 
-#[cfg(feature = "untrusted_fs")]
 pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
+
     use sgxfs::SgxFile;
-    use fs;
+    cfg_if! {
+        if #[cfg(feature = "untrusted_fs")] {
+            use fs;
+        } else {
+            use untrusted::fs;
+            use untrusted::path::PathEx;
+        }
+    }
 
     let metadata = from.metadata()?;
     if !metadata.is_file() {
diff --git a/sgx_tstd/src/sys_common/mod.rs b/sgx_tstd/src/sys_common/mod.rs
index 92c7a68..ae33c6d 100644
--- a/sgx_tstd/src/sys_common/mod.rs
+++ b/sgx_tstd/src/sys_common/mod.rs
@@ -36,7 +36,7 @@
 pub mod poison;
 pub mod thread_info;
 pub mod wtf8;
-#[cfg(feature = "untrusted_net")]
+#[cfg(feature = "net")]
 pub mod net;
 pub mod bytestring;
 
diff --git a/sgx_tstd/src/untrusted/fs.rs b/sgx_tstd/src/untrusted/fs.rs
new file mode 100644
index 0000000..726dd97
--- /dev/null
+++ b/sgx_tstd/src/untrusted/fs.rs
@@ -0,0 +1,30 @@
+// Copyright (C) 2017-2018 Baidu, Inc. All Rights Reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in
+//    the documentation and/or other materials provided with the
+//    distribution.
+//  * Neither the name of Baidu, Inc., nor the names of its
+//    contributors may be used to endorse or promote products derived
+//    from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//! Filesystem manipulation operations.
+pub use fs::*;
\ No newline at end of file
diff --git a/sgx_tstd/src/untrusted/mod.rs b/sgx_tstd/src/untrusted/mod.rs
new file mode 100644
index 0000000..19b7a1d
--- /dev/null
+++ b/sgx_tstd/src/untrusted/mod.rs
@@ -0,0 +1,31 @@
+// Copyright (C) 2017-2018 Baidu, Inc. All Rights Reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in
+//    the documentation and/or other materials provided with the
+//    distribution.
+//  * Neither the name of Baidu, Inc., nor the names of its
+//    contributors may be used to endorse or promote products derived
+//    from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+pub mod fs;
+pub mod path;
+pub mod time;
diff --git a/sgx_tstd/src/untrusted/path.rs b/sgx_tstd/src/untrusted/path.rs
new file mode 100644
index 0000000..21b787b
--- /dev/null
+++ b/sgx_tstd/src/untrusted/path.rs
@@ -0,0 +1,124 @@
+// Copyright (C) 2017-2018 Baidu, Inc. All Rights Reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in
+//    the documentation and/or other materials provided with the
+//    distribution.
+//  * Neither the name of Baidu, Inc., nor the names of its
+//    contributors may be used to endorse or promote products derived
+//    from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use untrusted::fs;
+use io;
+use path::Path;
+use path::PathBuf;
+
+pub trait PathEx {
+    fn metadata(&self) -> io::Result<fs::Metadata>;
+    fn symlink_metadata(&self) -> io::Result<fs::Metadata>; 
+    fn canonicalize(&self) -> io::Result<PathBuf>;
+    fn read_link(&self) -> io::Result<PathBuf>;
+    fn exists(&self) -> bool;
+    fn is_file(&self) -> bool;
+    fn is_dir(&self) -> bool;
+}
+
+impl PathEx for Path { 
+    /// Queries the file system to get information about a file, directory, etc.
+    ///
+    /// This function will traverse symbolic links to query information about the
+    /// destination file.
+    ///
+    /// This is an alias to [`fs::metadata`].
+    ///
+    /// [`fs::metadata`]: ../fs/fn.metadata.html
+    ///
+    fn metadata(&self) -> io::Result<fs::Metadata> {
+        fs::metadata(self)
+    }
+
+    /// Queries the metadata about a file without following symlinks.
+    ///
+    /// This is an alias to [`fs::symlink_metadata`].
+    ///
+    /// [`fs::symlink_metadata`]: ../fs/fn.symlink_metadata.html
+    ///
+    fn symlink_metadata(&self) -> io::Result<fs::Metadata> {
+        fs::symlink_metadata(self)
+    }
+
+    /// Returns the canonical form of the path with all intermediate components
+    /// normalized and symbolic links resolved.
+    ///
+    /// This is an alias to [`fs::canonicalize`].
+    ///
+    /// [`fs::canonicalize`]: ../fs/fn.canonicalize.html
+    ///
+    fn canonicalize(&self) -> io::Result<PathBuf> {
+        fs::canonicalize(self)
+    }
+
+    /// Reads a symbolic link, returning the file that the link points to.
+    ///
+    /// This is an alias to [`fs::read_link`].
+    ///
+    /// [`fs::read_link`]: ../fs/fn.read_link.html
+    ///
+    fn read_link(&self) -> io::Result<PathBuf> {
+        fs::read_link(self)
+    }
+
+    /// Returns whether the path points at an existing entity.
+    ///
+    /// This function will traverse symbolic links to query information about the
+    /// destination file. In case of broken symbolic links this will return `false`.
+    ///
+    /// If you cannot access the directory containing the file, e.g. because of a
+    /// permission error, this will return `false`.
+    ///
+    fn exists(&self) -> bool {
+        fs::metadata(self).is_ok()
+    }
+
+    /// Returns whether the path exists on disk and is pointing at a regular file.
+    ///
+    /// This function will traverse symbolic links to query information about the
+    /// destination file. In case of broken symbolic links this will return `false`.
+    ///
+    /// If you cannot access the directory containing the file, e.g. because of a
+    /// permission error, this will return `false`.
+    ///
+    fn is_file(&self) -> bool {
+        fs::metadata(self).map(|m| m.is_file()).unwrap_or(false)
+    }
+
+    /// Returns whether the path exists on disk and is pointing at a directory.
+    ///
+    /// This function will traverse symbolic links to query information about the
+    /// destination file. In case of broken symbolic links this will return `false`.
+    ///
+    /// If you cannot access the directory containing the file, e.g. because of a
+    /// permission error, this will return `false`.
+    ///
+    fn is_dir(&self) -> bool {
+        fs::metadata(self).map(|m| m.is_dir()).unwrap_or(false)
+    }
+}
diff --git a/sgx_tstd/src/untrusted/time.rs b/sgx_tstd/src/untrusted/time.rs
new file mode 100644
index 0000000..99723a2
--- /dev/null
+++ b/sgx_tstd/src/untrusted/time.rs
@@ -0,0 +1,92 @@
+// Copyright (C) 2017-2018 Baidu, Inc. All Rights Reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in
+//    the documentation and/or other materials provided with the
+//    distribution.
+//  * Neither the name of Baidu, Inc., nor the names of its
+//    contributors may be used to endorse or promote products derived
+//    from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use core::mem;
+use sys::time;
+use time::{Instant, SystemTime, SystemTimeError, Duration};
+
+pub trait InstantEx {
+    fn now() -> Instant;
+    fn elapsed(&self) -> Duration;
+}
+
+impl InstantEx for Instant {
+    /// Returns an instant corresponding to "now".
+    ///
+    fn now() -> Instant {
+        let instant = inner::Instant(time::Instant::now());
+        unsafe { mem::transmute(instant) }
+    }
+
+    /// Returns the amount of time elapsed since this instant was created.
+    ///
+    /// # Panics
+    ///
+    /// This function may panic if the current time is earlier than this
+    /// instant, which is something that can happen if an `Instant` is
+    /// produced synthetically.
+    ///
+    fn elapsed(&self) -> Duration {
+        Instant::now() - *self
+    }
+}
+
+pub trait SystemTimeEx {
+    fn now() -> SystemTime;
+    fn elapsed(&self) -> Result<Duration, SystemTimeError>;
+}
+
+impl SystemTimeEx for SystemTime {
+    /// Returns the system time corresponding to "now".
+    ///
+    fn now() -> SystemTime {
+        let systemtime = inner::SystemTime(time::SystemTime::now());
+        unsafe { mem::transmute(systemtime) }
+    }
+
+    /// Returns the amount of time elapsed since this system time was created.
+    ///
+    /// This function may fail as the underlying system clock is susceptible to
+    /// drift and updates (e.g. the system clock could go backwards), so this
+    /// function may not always succeed. If successful, [`Ok`]`(`[`Duration`]`)` is
+    /// returned where the duration represents the amount of time elapsed from
+    /// this time measurement to the current time.
+    ///
+    /// Returns an [`Err`] if `self` is later than the current system time, and
+    /// the error contains how far from the current system time `self` is.
+    ///
+    fn elapsed(&self) -> Result<Duration, SystemTimeError> {
+        SystemTime::now().duration_since(*self)
+    }
+}
+
+mod inner {
+    use sys::time;
+    pub struct Instant(pub time::Instant);
+    pub struct SystemTime(pub time::SystemTime);
+}
\ No newline at end of file
diff --git a/sgx_tunittest/Cargo.toml b/sgx_tunittest/Cargo.toml
index 9a92e88..44e45bd 100644
--- a/sgx_tunittest/Cargo.toml
+++ b/sgx_tunittest/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tunittest"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_types/Cargo.toml b/sgx_types/Cargo.toml
index cc550e1..f7dfddb 100644
--- a/sgx_types/Cargo.toml
+++ b/sgx_types/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_types"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/sgx_urts/Cargo.toml b/sgx_urts/Cargo.toml
index 75840d7..8d2e699 100644
--- a/sgx_urts/Cargo.toml
+++ b/sgx_urts/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_urts"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/third_party/rulinalg/Cargo.toml b/third_party/rulinalg/Cargo.toml
index 76d8480..f0194db 100644
--- a/third_party/rulinalg/Cargo.toml
+++ b/third_party/rulinalg/Cargo.toml
@@ -15,7 +15,7 @@
 io = ["csv", "rustc-serialize"]
 
 [target.'cfg(not(target_env = "sgx"))'.dependencies]
-sgx_tstd = { path =  "../../sgx_tstd", features = ["untrusted_fs"] }
+sgx_tstd = { path =  "../../sgx_tstd" }
 
 [dependencies]
 num = {path = "../num", default-features = false }
diff --git a/third_party/rulinalg/Xargo.toml b/third_party/rulinalg/Xargo.toml
index 01d5cb0..ff44231 100644
--- a/third_party/rulinalg/Xargo.toml
+++ b/third_party/rulinalg/Xargo.toml
@@ -10,7 +10,6 @@
 
 [dependencies.std]
 path = "../../xargo/sgx_tstd"
-features = ["untrusted_fs"]
 stage = 2
 
 [dependencies.sgx_rand]
diff --git a/third_party/rust-csv/Cargo.toml b/third_party/rust-csv/Cargo.toml
index 17a7b23..b7b97fb 100644
--- a/third_party/rust-csv/Cargo.toml
+++ b/third_party/rust-csv/Cargo.toml
@@ -19,7 +19,7 @@
 bench = false
 
 [target.'cfg(not(target_env = "sgx"))'.dependencies]
-sgx_tstd = { path =  "../../sgx_tstd", features = ["untrusted_fs"] }
+sgx_tstd = { path =  "../../sgx_tstd" }
 
 [dependencies]
 csv-core = { path = "csv-core", version = "0.1.3" }
diff --git a/third_party/rust-csv/Xargo.toml b/third_party/rust-csv/Xargo.toml
index 01d5cb0..ff44231 100644
--- a/third_party/rust-csv/Xargo.toml
+++ b/third_party/rust-csv/Xargo.toml
@@ -10,7 +10,6 @@
 
 [dependencies.std]
 path = "../../xargo/sgx_tstd"
-features = ["untrusted_fs"]
 stage = 2
 
 [dependencies.sgx_rand]
diff --git a/third_party/rust-csv/src/reader.rs b/third_party/rust-csv/src/reader.rs
index 98ad538..8035bee 100644
--- a/third_party/rust-csv/src/reader.rs
+++ b/third_party/rust-csv/src/reader.rs
@@ -1,4 +1,4 @@
-use std::fs::File;
+use std::untrusted::fs::File;
 use std::boxed::*;
 use std::io::{self, BufRead, Seek};
 use std::marker::PhantomData;
diff --git a/third_party/rust-csv/src/writer.rs b/third_party/rust-csv/src/writer.rs
index 020e5b8..cbfceca 100644
--- a/third_party/rust-csv/src/writer.rs
+++ b/third_party/rust-csv/src/writer.rs
@@ -1,4 +1,4 @@
-use std::fs::File;
+use std::untrusted::fs::File;
 use std::io;
 use std::path::Path;
 use std::result;
diff --git a/third_party/rustls/Cargo.toml b/third_party/rustls/Cargo.toml
index 9af0b31..4ff7e9c 100644
--- a/third_party/rustls/Cargo.toml
+++ b/third_party/rustls/Cargo.toml
@@ -10,7 +10,7 @@
 categories = ["network-programming", "cryptography"]
 
 [target.'cfg(not(target_env = "sgx"))'.dependencies]
-sgx_tstd = { path =  "../../sgx_tstd", features = ["untrusted_time"] }
+sgx_tstd = { path =  "../../sgx_tstd" }
 
 [dependencies]
 untrusted = { version = "0.6", path = "../untrusted" }
diff --git a/third_party/rustls/Xargo.toml b/third_party/rustls/Xargo.toml
index ad7f49c..ff44231 100644
--- a/third_party/rustls/Xargo.toml
+++ b/third_party/rustls/Xargo.toml
@@ -10,7 +10,6 @@
 
 [dependencies.std]
 path = "../../xargo/sgx_tstd"
-features = ["untrusted_time"]
 stage = 2
 
 [dependencies.sgx_rand]
diff --git a/third_party/rustls/src/ticketer.rs b/third_party/rustls/src/ticketer.rs
index bf3b041..ef3d415 100644
--- a/third_party/rustls/src/ticketer.rs
+++ b/third_party/rustls/src/ticketer.rs
@@ -9,6 +9,7 @@
 use std::mem;
 use std::sync::{SgxMutex, Arc};
 use std::time;
+use std::untrusted::time::SystemTimeEx;
 use ring::aead;
 
 /// The timebase for expiring and rolling tickets and ticketing
diff --git a/third_party/rustls/src/verify.rs b/third_party/rustls/src/verify.rs
index e7d5036..2ec2a1c 100644
--- a/third_party/rustls/src/verify.rs
+++ b/third_party/rustls/src/verify.rs
@@ -6,6 +6,7 @@
 use sct;
 use std;
 use std::sync::Arc;
+use std::untrusted::time::SystemTimeEx;
 
 use key::Certificate;
 use msgs::handshake::DigitallySignedStruct;
diff --git a/third_party/rusty-machine/Cargo.toml b/third_party/rusty-machine/Cargo.toml
index 5c7382d..f741d0f 100644
--- a/third_party/rusty-machine/Cargo.toml
+++ b/third_party/rusty-machine/Cargo.toml
@@ -16,7 +16,7 @@
 datasets = []
 
 [target.'cfg(not(target_env = "sgx"))'.dependencies]
-sgx_tstd = { path =  "../../sgx_tstd", features = ["untrusted_fs"] }
+sgx_tstd = { path =  "../../sgx_tstd" }
 sgx_rand = { path = "../../sgx_rand"}
 
 [dependencies]
diff --git a/third_party/rusty-machine/Xargo.toml b/third_party/rusty-machine/Xargo.toml
index 01d5cb0..ff44231 100644
--- a/third_party/rusty-machine/Xargo.toml
+++ b/third_party/rusty-machine/Xargo.toml
@@ -10,7 +10,6 @@
 
 [dependencies.std]
 path = "../../xargo/sgx_tstd"
-features = ["untrusted_fs"]
 stage = 2
 
 [dependencies.sgx_rand]
diff --git a/third_party/webpki/Cargo.toml b/third_party/webpki/Cargo.toml
index a782235..c1c1dc3 100644
--- a/third_party/webpki/Cargo.toml
+++ b/third_party/webpki/Cargo.toml
@@ -63,7 +63,7 @@
 std = []
 
 [target.'cfg(not(target_env = "sgx"))'.dependencies]
-sgx_tstd = { path =  "../../sgx_tstd", features = ["untrusted_time"] }
+sgx_tstd = { path =  "../../sgx_tstd" }
 
 [dependencies]
 ring = { path = "../ring" }
diff --git a/third_party/webpki/Xargo.toml b/third_party/webpki/Xargo.toml
index ad7f49c..ff44231 100644
--- a/third_party/webpki/Xargo.toml
+++ b/third_party/webpki/Xargo.toml
@@ -10,7 +10,6 @@
 
 [dependencies.std]
 path = "../../xargo/sgx_tstd"
-features = ["untrusted_time"]
 stage = 2
 
 [dependencies.sgx_rand]
diff --git a/xargo/sgx_rand/Cargo.toml b/xargo/sgx_rand/Cargo.toml
index b14cdbf..fd9c13f 100644
--- a/xargo/sgx_rand/Cargo.toml
+++ b/xargo/sgx_rand/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_rand"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/xargo/sgx_serialize/Cargo.toml b/xargo/sgx_serialize/Cargo.toml
index e0ea5a2..39d7ffd 100644
--- a/xargo/sgx_serialize/Cargo.toml
+++ b/xargo/sgx_serialize/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_serialize"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]
diff --git a/xargo/sgx_tstd/Cargo.toml b/xargo/sgx_tstd/Cargo.toml
index 84a8a4d..1892eaf 100644
--- a/xargo/sgx_tstd/Cargo.toml
+++ b/xargo/sgx_tstd/Cargo.toml
@@ -13,8 +13,8 @@
 default = ["stdio"]
 backtrace = ["stdio"]
 stdio = []
+net = []
 untrusted_fs = []
-untrusted_net = []
 untrusted_time = []
 
 [build-dependencies]
diff --git a/xargo/sgx_tunittest/Cargo.toml b/xargo/sgx_tunittest/Cargo.toml
index 8de1cd7..2b11b6e 100644
--- a/xargo/sgx_tunittest/Cargo.toml
+++ b/xargo/sgx_tunittest/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "sgx_tunittest"
-version = "0.9.6"
+version = "0.9.7"
 authors = ["Baidu"]
 
 [lib]