Skip to content

Commit

Permalink
Merge pull request #320 from llly/remergePR
Browse files Browse the repository at this point in the history
Remerge PR #304 #308 #309 #310 #313
  • Loading branch information
andyzyb authored Sep 28, 2018
2 parents 12223e5 + d9ba97c commit 03f1bef
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions common/inc/internal/mini_snprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#include <stdarg.h>
#include <limits.h>

#include "sl_util.h"

/*===========================================================================
* Interface
*===========================================================================*/
Expand Down
1 change: 0 additions & 1 deletion common/inc/sgx_uswitchless.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
#include "sgx_error.h"
#include "sgx_eid.h"
#include "sgx_defs.h"
#include "sgx_urts.h"

/*
* A worker can be either trusted (executed inside enclave) or untrusted
Expand Down
2 changes: 1 addition & 1 deletion linux/installer/bin/build-installpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BUILD_DIR=${ROOT_DIR}/build/linux
# Get the architecture of the build from generated binary
get_arch()
{
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '/:/{print $6}')
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '{print $6}')
test $a = 02 && echo 'x86_64' || echo 'x86'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ rm -fr ${INSTALL_PATH}
# Get the architecture of the build from generated binary
get_arch()
{
local a=$(readelf -h $(find ${BUILD_DIR} -name "*.so*" |head -n 1) | sed -n '2p' | awk '/:/{print $6}')
local a=$(readelf -h $(find ${BUILD_DIR} -name "*.so*" |head -n 1) | sed -n '2p' | awk '{print $6}')
test $a = 02 && echo 'x64' || echo 'x86'
}

Expand Down
2 changes: 1 addition & 1 deletion linux/installer/common/psw/createTarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ rm -fr ${INSTALL_PATH}
# Get the architecture of the build from generated binary
get_arch()
{
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '/:/{print $6}')
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '{print $6}')
test $a = 02 && echo 'x64' || echo 'x86'
}

Expand Down
2 changes: 1 addition & 1 deletion linux/installer/common/sdk/createTarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ rm -fr ${INSTALL_PATH}
# Get the architecture of the build from generated binary
get_arch()
{
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '/:/{print $6}')
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '{print $6}')
test $a = 02 && echo 'x64' || echo 'x86'
}

Expand Down
4 changes: 3 additions & 1 deletion sdk/simulation/urtssim/enclave_creator_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ int EnclaveCreatorSim::initialize(sgx_enclave_id_t enclave_id)
assert(global_data_sim_ptr != NULL);

// Initialize the `seed' to `g_global_data_sim'.
global_data_sim_ptr->seed = (uint64_t)time(NULL);
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
global_data_sim_ptr->seed = (uint64_t)ts.tv_sec * 1000000000ULL + (uint64_t)ts.tv_nsec;

global_data_sim_ptr->secs_ptr = ce->get_secs();
sgx_cpu_svn_t temp_cpusvn = {{0}};
Expand Down
6 changes: 3 additions & 3 deletions sdk/tseal/tSeal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ extern "C" sgx_status_t sgx_unseal_data(const sgx_sealed_data_t *p_sealed_data,
{
return SGX_ERROR_INVALID_PARAMETER;
}
if (!sgx_is_within_enclave(p_decrypted_text_length, sizeof(p_decrypted_text_length)))
if (!sgx_is_within_enclave(p_decrypted_text_length, sizeof(*p_decrypted_text_length)))
{
return SGX_ERROR_INVALID_PARAMETER;
}
Expand All @@ -217,8 +217,8 @@ extern "C" sgx_status_t sgx_unseal_data(const sgx_sealed_data_t *p_sealed_data,
}

if((p_additional_MACtext_length != NULL) &&
(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)))))
(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)))))
{
return SGX_ERROR_INVALID_PARAMETER;
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/tseal/tSeal_aad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ extern "C" sgx_status_t sgx_unmac_aadata(const sgx_sealed_data_t *p_sealed_data,
{
return SGX_ERROR_INVALID_PARAMETER;
}
if(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length))))
if(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length))))
{
return SGX_ERROR_INVALID_PARAMETER;
}
Expand Down

0 comments on commit 03f1bef

Please sign in to comment.