Unverified Commit 05501034 authored by Stan Kladko's avatar Stan Kladko Committed by GitHub

Merge pull request #244 from skalenetwork/develop

Intel submission 3
parents 94f14747 fff33a87
...@@ -19,9 +19,9 @@ jobs: ...@@ -19,9 +19,9 @@ jobs:
- name: submodule update - name: submodule update
run: git submodule update --init --recursive run: git submodule update --init --recursive
- name: build container for testing - name: build container for testing
run: python3 scripts/docker_build.py DockerfileSimulation sgxwalletsim ${GITHUB_SHA} run: python3 scripts/docker_build.py DockerfileSimulation sgxwallet_sim ${GITHUB_SHA}
- name: test - name: test
run: python3 scripts/docker_test.py DockerfileSimulation sgxwalletsim run: python3 scripts/docker_test.py DockerfileSimulation sgxwallet_sim
- name: build and deploy docker image - name: build and deploy docker image
if: | if: |
contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'develop') || contains(github.ref, 'beta') ||
......
...@@ -77,3 +77,6 @@ s3.connect((address, 1028)) ...@@ -77,3 +77,6 @@ s3.connect((address, 1028))
s1.close() s1.close()
s2.close() s2.close()
s3.close() s3.close()
assert subprocess.call(["docker", "rm", "-f", "sgxwallet"]) == 0
assert subprocess.call(["rm", "-rf", "sgx_data"]) == 0
...@@ -210,6 +210,8 @@ void *reallocate_function(void *ptr, size_t osize, size_t nsize) { ...@@ -210,6 +210,8 @@ void *reallocate_function(void *ptr, size_t osize, size_t nsize) {
return (void *) nptr; return (void *) nptr;
} }
volatile uint64_t counter;
void get_global_random(unsigned char *_randBuff, uint64_t _size) { void get_global_random(unsigned char *_randBuff, uint64_t _size) {
char errString[BUF_LEN]; char errString[BUF_LEN];
int status; int status;
...@@ -220,10 +222,11 @@ void get_global_random(unsigned char *_randBuff, uint64_t _size) { ...@@ -220,10 +222,11 @@ void get_global_random(unsigned char *_randBuff, uint64_t _size) {
CHECK_STATE(_size <= 32) CHECK_STATE(_size <= 32)
CHECK_STATE(_randBuff); CHECK_STATE(_randBuff);
counter++;
sgx_sha_state_handle_t shaStateHandle; sgx_sha_state_handle_t shaStateHandle;
CHECK_STATE(sgx_sha256_init(&shaStateHandle) == SGX_SUCCESS); CHECK_STATE(sgx_sha256_init(&shaStateHandle) == SGX_SUCCESS);
CHECK_STATE(sgx_sha256_update(globalRandom, 32, shaStateHandle) == SGX_SUCCESS); CHECK_STATE(sgx_sha256_update(globalRandom, 32, shaStateHandle) == SGX_SUCCESS);
CHECK_STATE(sgx_sha256_update(&counter, sizeof(counter), shaStateHandle) == SGX_SUCCESS);
CHECK_STATE(sgx_sha256_get_hash(shaStateHandle, (sgx_sha256_hash_t *)globalRandom) == SGX_SUCCESS); CHECK_STATE(sgx_sha256_get_hash(shaStateHandle, (sgx_sha256_hash_t *)globalRandom) == SGX_SUCCESS);
CHECK_STATE(sgx_sha256_close(shaStateHandle) == SGX_SUCCESS); CHECK_STATE(sgx_sha256_close(shaStateHandle) == SGX_SUCCESS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment