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
7da4edf6
Unverified
Commit
7da4edf6
authored
Feb 11, 2020
by
svetaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2003 Fix docker test
parent
193cfb6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
DockerfileSimulation
DockerfileSimulation
+1
-1
SEKManager.cpp
SEKManager.cpp
+14
-8
docker_test.py
scripts/docker_test.py
+1
-1
No files found.
DockerfileSimulation
View file @
7da4edf6
...
...
@@ -35,4 +35,4 @@ RUN make
RUN mkdir /usr/src/sdk/sgx_data
COPY docker/start.sh ./
ENTRYPOINT ["/usr/src/sdk/start.sh"]
ENTRYPOINT ["/usr/src/sdk/start.sh"]
\ No newline at end of file
SEKManager.cpp
View file @
7da4edf6
...
...
@@ -55,16 +55,21 @@ void create_test_key(){
status
=
encrypt_key_aes
(
eid
,
&
errStatus
,
errMsg
.
data
(),
key
.
c_str
(),
encrypted_key
,
&
enc_len
);
if
(
status
!=
0
){
std
::
cerr
<<
"encrypt test key failed with status "
<<
status
<<
std
::
endl
;
throw
RPCException
(
status
,
errMsg
.
data
())
;
}
//std::cerr << "enc len is " << enc_len << std::endl;
vector
<
char
>
hexEncrKey
(
2
*
enc_len
+
1
,
0
);
carray2Hex
(
encrypted_key
,
enc_len
,
hexEncrKey
.
data
());
std
::
cerr
<<
"encr test key is "
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
2
*
enc_len
+
1
;
i
++
)
std
::
cerr
<<
(
int
)
hexEncrKey
[
i
]
<<
" "
;
// std::cerr << "encr test key is " << std::endl;
// for (int i = 0; i < 2 * enc_len + 1; i++)
// std::cerr << (int)hexEncrKey[i] << " ";
LevelDB
::
getLevelDb
()
->
writeDataUnique
(
"TEST_KEY"
,
hexEncrKey
.
data
());
}
...
...
@@ -107,16 +112,17 @@ bool check_SEK(std::string SEK){
// std::cerr << (int)encr_SEK[i] << " ";
// }
status
=
decrypt_key_aes
(
eid
,
&
err_status
,
errMsg
.
data
(),
encr_test_key
.
data
(),
len
,
decr_key
.
data
());
if
(
status
!=
0
){
spdlog
::
error
(
"failed to decrypt test key"
);
exit
(
-
1
);
}
std
::
cerr
<<
"decr test key is "
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
BUF_LEN
;
i
++
){
std
::
cerr
<<
(
int
)
decr_key
[
i
]
<<
" "
;
}
//
std::cerr << "decr test key is " << std::endl;
//
for ( int i = 0; i < BUF_LEN; i++ ){
//
std::cerr << (int)decr_key[i] << " ";
//
}
std
::
string
test_key
=
TEST_VALUE
;
std
::
cerr
<<
"test key is "
<<
test_key
<<
std
::
endl
;
...
...
@@ -247,6 +253,6 @@ void init_SEK(){
}
}
//ef6fdc31d93f9ec926f64c42278f34cc
//1e6a4c0bcc1ddad3508b7182a0d893d5
scripts/docker_test.py
View file @
7da4edf6
...
...
@@ -31,7 +31,7 @@ assert subprocess.call(["docker", "image", "inspect", FULL_IMAGE_NAME]) == 0;
#assert subprocess.call(["docker", "run", "-v", topDir + "/sgx_data:/usr/src/sdk/sgx_data",
# "-d", "--network=host", "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX]) == 0
obj
=
subprocess
.
Popen
([
"docker"
,
"run"
,
"-v"
,
topDir
+
"/sgx_data:/usr/src/sdk/sgx_data"
,
"-d"
,
"-
f"
,
"-y"
,
"--network=host"
,
"skalenetwork/"
+
IMAGE_NAME
+
":"
+
TAG_POSTFIX
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
obj
=
subprocess
.
Popen
([
"docker"
,
"run"
,
"-v"
,
topDir
+
"/sgx_data:/usr/src/sdk/sgx_data"
,
"-d"
,
"-
-network=host"
,
"skalenetwork/"
+
IMAGE_NAME
+
":"
+
TAG_POSTFIX
,
"-y"
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
obj
.
communicate
(
input
=
b
"i confirm"
,
timeout
=
5
)
obj
.
terminate
()
obj
.
wait
()
...
...
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