From 90433d85fdb2b22a9a61b81069bb239c9075acff Mon Sep 17 00:00:00 2001 From: TomL94 Date: Mon, 31 Aug 2020 19:59:11 +0300 Subject: [PATCH] Iteration #1 --- cosmwasm/packages/wasmi-runtime/src/exports.rs | 6 +++--- cosmwasm/packages/wasmi-runtime/src/utils.rs | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cosmwasm/packages/wasmi-runtime/src/exports.rs b/cosmwasm/packages/wasmi-runtime/src/exports.rs index dea6fafbe..826d8cc16 100644 --- a/cosmwasm/packages/wasmi-runtime/src/exports.rs +++ b/cosmwasm/packages/wasmi-runtime/src/exports.rs @@ -141,7 +141,7 @@ pub unsafe extern "C" fn ecall_init( err: EnclaveError::OutOfMemory, } } else { - error!("Call ecall_init panic'd unexpectedly!"); + error!("Call ecall_init panicked unexpectedly!"); InitResult::Failure { err: EnclaveError::Panic, } @@ -225,7 +225,7 @@ pub unsafe extern "C" fn ecall_handle( err: EnclaveError::OutOfMemory, } } else { - error!("Call ecall_handle panic'd unexpectedly!"); + error!("Call ecall_handle panicked unexpectedly!"); HandleResult::Failure { err: EnclaveError::Panic, } @@ -287,7 +287,7 @@ pub unsafe extern "C" fn ecall_query( err: EnclaveError::OutOfMemory, } } else { - error!("Call ecall_query panic'd unexpectedly!"); + error!("Call ecall_query panicked unexpectedly!"); QueryResult::Failure { err: EnclaveError::Panic, } diff --git a/cosmwasm/packages/wasmi-runtime/src/utils.rs b/cosmwasm/packages/wasmi-runtime/src/utils.rs index ec726efd7..0dbb7c237 100644 --- a/cosmwasm/packages/wasmi-runtime/src/utils.rs +++ b/cosmwasm/packages/wasmi-runtime/src/utils.rs @@ -37,7 +37,7 @@ impl UnwrapOrSgxErrorUnexpected for Result { pub fn validate_mut_ptr(ptr: *mut u8, ptr_len: usize) -> SgxResult<()> { if rsgx_raw_is_outside_enclave(ptr, ptr_len) { - error!("Tried to access memory outside enclave -- rsgx_slice_is_outside_enclave"); + warn!("Tried to access memory outside enclave -- rsgx_slice_is_outside_enclave"); return Err(sgx_status_t::SGX_ERROR_UNEXPECTED); } rsgx_sfence(); @@ -46,7 +46,7 @@ pub fn validate_mut_ptr(ptr: *mut u8, ptr_len: usize) -> SgxResult<()> { pub fn validate_const_ptr(ptr: *const u8, ptr_len: usize) -> SgxResult<()> { if ptr.is_null() || ptr_len == 0 { - error!("Tried to access an empty pointer - ptr.is_null()"); + warn!("Tried to access an empty pointer - ptr.is_null()"); return Err(sgx_status_t::SGX_ERROR_UNEXPECTED); } rsgx_lfence(); @@ -55,7 +55,7 @@ pub fn validate_const_ptr(ptr: *const u8, ptr_len: usize) -> SgxResult<()> { pub fn validate_mut_slice(mut_slice: &mut [u8]) -> SgxResult<()> { if rsgx_slice_is_outside_enclave(mut_slice) { - error!("Tried to access memory outside enclave -- rsgx_slice_is_outside_enclave"); + warn!("Tried to access memory outside enclave -- rsgx_slice_is_outside_enclave"); return Err(sgx_status_t::SGX_ERROR_UNEXPECTED); } rsgx_sfence(); @@ -80,7 +80,6 @@ pub fn attest_from_key( } Ok(res) => res, }; - // info!("private key {:?}, cert: {:?}", private_key_der, cert); if let Err(status) = write_to_untrusted(cert.as_slice(), save_path) { return Err(status);