Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
28616a45
Unverified
Commit
28616a45
authored
Sep 10, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2741
parent
d1af3589
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
ServerInit.cpp
ServerInit.cpp
+17
-4
ServerInit.h
ServerInit.h
+1
-1
start.sh
docker/start.sh
+1
-1
No files found.
ServerInit.cpp
View file @
28616a45
...
...
@@ -68,7 +68,7 @@ void initUserSpace() {
LevelDB
::
initDataFolderAndDBs
();
}
void
initEnclave
()
{
uint64_t
initEnclave
()
{
#ifndef SGX_HW_SIM
...
...
@@ -85,12 +85,12 @@ void initEnclave() {
sgx_status_t
status
=
SGX_SUCCESS
;
{
WRITE_LOCK
(
initMutex
);
if
(
eid
!=
0
)
{
if
(
sgx_destroy_enclave
(
eid
)
!=
SGX_SUCCESS
)
{
spdlog
::
error
(
"Could not destroy enclave"
);
return
;
}
}
...
...
@@ -117,10 +117,12 @@ void initEnclave() {
if
(
status
!=
SGX_SUCCESS
)
{
spdlog
::
error
(
"trustedEnclaveInit failed: {}"
,
status
);
exit
(
1
)
;
return
status
;
}
spdlog
::
info
(
"Enclave libtgmp library and logging initialized successfully"
);
return
SGX_SUCCESS
;
}
...
...
@@ -144,7 +146,18 @@ void initAll(uint32_t _logLevel, bool _checkCert, bool _autoSign) {
CHECK_STATE
(
sgxServerInited
!=
1
)
sgxServerInited
=
1
;
initEnclave
();
uint64_t
counter
=
0
;
uint64_t
initResult
=
0
;
while
((
initResult
=
initEnclave
())
!=
0
&&
counter
<
10
){
sleep
(
1
);
counter
++
;
}
if
(
initResult
!=
0
)
{
spdlog
::
error
(
"Coult not init enclave"
);
}
initUserSpace
();
initSEK
();
...
...
ServerInit.h
View file @
28616a45
...
...
@@ -36,7 +36,7 @@ EXTERNC void initAll(uint32_t _logLevel, bool _checkCert, bool _autoSign);
EXTERNC
void
initUserSpace
();
EXTERNC
void
initEnclave
();
EXTERNC
uint64_t
initEnclave
();
...
...
docker/start.sh
View file @
28616a45
...
...
@@ -43,7 +43,7 @@ fi
if
[[
"
$1
"
==
"-t"
]]
;
then
echo
"Test run requested"
sleep
5
##sleep 0
./testw.py
else
./sgxwallet
$1
$2
$3
$4
$5
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment