broken compilation
This commit is contained in:
parent
540578dcf7
commit
7c193877f2
@ -31,7 +31,7 @@ lazy_static = "1.5"
|
||||
#sgx_tse = { version = "1.1", features = ["capi"] }
|
||||
#sgx_tse = "1.1"
|
||||
#sgx_types = "1.1"
|
||||
sgx_tseal = "1.1"
|
||||
#sgx_tseal = "1.1"
|
||||
|
||||
[dependencies.tonic]
|
||||
version = "0.12"
|
||||
@ -96,3 +96,6 @@ required-features = ["tonic"]
|
||||
[[example]]
|
||||
name = "mratls_grpcs_client"
|
||||
required-features = ["tonic"]
|
||||
|
||||
[[example]]
|
||||
name = "sealing"
|
||||
|
12
build.rs
12
build.rs
@ -10,12 +10,16 @@ fn main() {
|
||||
};
|
||||
|
||||
// Doesn't use standard C library, safe to compile with both musl and glibc
|
||||
println!("cargo:rustc-link-search=crate=/opt/intel/sgxsdk/lib64");
|
||||
println!("cargo:rustc-link-search=crate={}", dcap_lib_path);
|
||||
//println!("cargo:rustc-link-search=/opt/intel/sgxsdk/lib64");
|
||||
//println!("cargo:rustc-link-lib=sgx_tservice");
|
||||
//println!("cargo:rustc-link-lib=sgx_tcrypto");
|
||||
//println!("cargo:rustc-link-lib=sgx_trts");
|
||||
//println!("cargo:rustc-link-lib=sgx_pthread");
|
||||
//println!("cargo:rustc-link-lib=sgx_tstdc");
|
||||
|
||||
// Cargo will look for `libocclum_dcap.a` and `libsgx_tservice.a`
|
||||
// Cargo will look for `libocclum_dcap.a`
|
||||
println!("cargo:rustc-link-search={}", dcap_lib_path);
|
||||
println!("cargo:rustc-link-lib=static:+whole-archive=occlum_dcap");
|
||||
println!("cargo:rustc-link-lib=static:+whole-archive=sgx_tservice");
|
||||
}
|
||||
|
||||
#[cfg(feature = "tonic")]
|
||||
|
@ -1,12 +1,12 @@
|
||||
use sgx_tseal::SgxSealedData;
|
||||
//use sgx_tseal::SgxSealedData;
|
||||
|
||||
fn main() {
|
||||
println!("Example of sealing");
|
||||
let text = "sealed text";
|
||||
let additional_text = "additional";
|
||||
let sealed_data =
|
||||
SgxSealedData::<[u8]>::seal_data(additional_text.as_bytes(), text.as_bytes()).unwrap();
|
||||
let unsealed_data = SgxSealedData::unseal_data(&sealed_data).unwrap();
|
||||
let text: &str = unsealed_data.get_decrypt_text();
|
||||
println!("Unsealed text: {}", text);
|
||||
//let text = "sealed text";
|
||||
//let additional_text = "additional";
|
||||
//let sealed_data =
|
||||
// SgxSealedData::<[u8]>::seal_data(additional_text.as_bytes(), text.as_bytes()).unwrap();
|
||||
//let unsealed_data = SgxSealedData::<[u8]>::unseal_data(&sealed_data).unwrap();
|
||||
//let text: &str = &String::from_utf8_lossy(unsealed_data.get_decrypt_txt());
|
||||
//println!("Unsealed text: {}", text);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ impl InstanceMeasurement {
|
||||
let quote = Self::generate_static_empty_quote()?;
|
||||
let mrsigner_from_quote = quote.mrsigner().into();
|
||||
|
||||
if let Some(mrsigners) = self.mrsigners {
|
||||
if let Some(ref mrsigners) = self.mrsigners {
|
||||
if mrsigners.contains(&mrsigner_from_quote) {
|
||||
// already contains the mrsigner
|
||||
Ok(self)
|
||||
@ -81,7 +81,7 @@ impl InstanceMeasurement {
|
||||
let quote = Self::generate_static_empty_quote()?;
|
||||
let mrenclave_from_quote = quote.mrenclave().into();
|
||||
|
||||
if let Some(mrenclaves) = self.mrenclaves {
|
||||
if let Some(ref mrenclaves) = self.mrenclaves {
|
||||
if mrenclaves.contains(&mrenclave_from_quote) {
|
||||
// already contains the mrenclave
|
||||
Ok(self)
|
||||
|
Loading…
Reference in New Issue
Block a user