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
8a11d1f9
Unverified
Commit
8a11d1f9
authored
Jul 20, 2021
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-4262 add -e flag
parent
72bb58de
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
15 deletions
+21
-15
ServerInit.cpp
ServerInit.cpp
+2
-2
ServerInit.h
ServerInit.h
+1
-1
start.sh
docker/start.sh
+1
-1
docker-compose.yml
run_sgx/docker-compose.yml
+1
-1
docker-compose.yml
run_sgx_sim/docker-compose.yml
+1
-1
sgxwall.cpp
sgxwall.cpp
+9
-3
testw.cpp
testw.cpp
+5
-5
ReqMessage.cpp
zmq_src/ReqMessage.cpp
+1
-1
No files found.
ServerInit.cpp
View file @
8a11d1f9
...
...
@@ -160,7 +160,7 @@ uint64_t initEnclave() {
}
void
initAll
(
uint32_t
_logLevel
,
bool
_checkCert
,
bool
_checkZMQSig
,
bool
_autoSign
,
bool
_generateTestKeys
)
{
bool
_checkZMQSig
,
bool
_autoSign
,
bool
_generateTestKeys
,
bool
_checkKeyOwnership
)
{
static
atomic
<
bool
>
sgxServerInited
(
false
);
static
mutex
initMutex
;
...
...
@@ -209,7 +209,7 @@ void initAll(uint32_t _logLevel, bool _checkCert,
SGXRegistrationServer
::
initRegistrationServer
(
_autoSign
);
CSRManagerServer
::
initCSRManagerServer
();
SGXInfoServer
::
initInfoServer
(
_logLevel
,
_checkCert
,
_autoSign
,
_generateTestKeys
);
ZMQServer
::
initZMQServer
(
_checkZMQSig
,
useHTTPS
);
ZMQServer
::
initZMQServer
(
_checkZMQSig
,
_checkKeyOwnership
);
sgxServerInited
=
true
;
}
catch
(
SGXException
&
_e
)
{
...
...
ServerInit.h
View file @
8a11d1f9
...
...
@@ -32,7 +32,7 @@
#define EXTERNC
#endif
EXTERNC
void
initAll
(
uint32_t
_logLevel
,
bool
_checkCert
,
bool
_checkZMQSig
,
bool
_autoSign
,
bool
_generateTestKeys
);
EXTERNC
void
initAll
(
uint32_t
_logLevel
,
bool
_checkCert
,
bool
_checkZMQSig
,
bool
_autoSign
,
bool
_generateTestKeys
,
bool
_checkKeyOwnership
);
void
exitAll
();
...
...
docker/start.sh
View file @
8a11d1f9
...
...
@@ -47,6 +47,6 @@ sleep 5
./testw.py
else
sleep
3
./sgxwallet
$1
$2
$3
$4
$5
./sgxwallet
$1
$2
$3
$4
$5
$6
fi
run_sgx/docker-compose.yml
View file @
8a11d1f9
...
...
@@ -21,7 +21,7 @@ services:
options
:
max-size
:
"
10m"
max-file
:
"
4"
command
:
-s -y -d
command
:
-s -y -d
-e
healthcheck
:
test
:
[
"
CMD"
,
"
ls"
,
"
/dev/isgx"
,
"
/dev/mei0"
]
run_sgx_sim/docker-compose.yml
View file @
8a11d1f9
...
...
@@ -18,4 +18,4 @@ services:
options
:
max-size
:
"
10m"
max-file
:
"
4"
command
:
-s -y
command
:
-s -y
-e
sgxwall.cpp
View file @
8a11d1f9
...
...
@@ -55,6 +55,7 @@ void SGXWallet::printUsage() {
cerr
<<
" -n Use http instead of https. Default is to use https with a selg-signed server cert. Insecure!
\n
"
;
cerr
<<
" -c Disable client authentication using certificates. Insecure!
\n
"
;
cerr
<<
" -s Sign client certificates without human confirmation. Insecure!
\n
"
;
cerr
<<
" -e Only owner of the key can access it.
\n
"
;
}
...
...
@@ -100,6 +101,7 @@ int main(int argc, char *argv[]) {
bool
checkClientCertOption
=
true
;
bool
autoSignClientCertOption
=
false
;
bool
generateTestKeys
=
false
;
bool
checkKeyOwnership
=
true
;
std
::
signal
(
SIGABRT
,
SGXWallet
::
signalHandler
);
...
...
@@ -110,7 +112,7 @@ int main(int argc, char *argv[]) {
exit
(
-
21
);
}
while
((
opt
=
getopt
(
argc
,
argv
,
"cshd0abyvVnT"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"cshd0abyvVn
e
T"
))
!=
-
1
)
{
switch
(
opt
)
{
case
'h'
:
SGXWallet
::
printUsage
();
...
...
@@ -136,6 +138,10 @@ int main(int argc, char *argv[]) {
break
;
case
'n'
:
useHTTPSOption
=
false
;
checkKeyOwnership
=
false
;
break
;
case
'e'
:
checkKeyOwnership
=
true
;
break
;
case
'a'
:
enterBackupKeyOption
=
false
;
...
...
@@ -179,7 +185,7 @@ int main(int argc, char *argv[]) {
}
cerr
<<
"Calling initAll ..."
<<
endl
;
initAll
(
enclaveLogLevel
,
checkClientCertOption
,
checkClientCertOption
,
autoSignClientCertOption
,
generateTestKeys
);
initAll
(
enclaveLogLevel
,
checkClientCertOption
,
checkClientCertOption
,
autoSignClientCertOption
,
generateTestKeys
,
checkKeyOwnership
);
cerr
<<
"Completed initAll."
<<
endl
;
//check if test keys already exist
...
...
testw.cpp
View file @
8a11d1f9
...
...
@@ -73,7 +73,7 @@ public:
TestFixture
()
{
TestUtils
::
resetDB
();
setOptions
(
L_INFO
,
false
,
true
);
initAll
(
L_INFO
,
false
,
false
,
true
,
false
);
initAll
(
L_INFO
,
false
,
false
,
true
,
false
,
false
);
}
~
TestFixture
()
{
...
...
@@ -87,7 +87,7 @@ public:
TestFixtureHTTPS
()
{
TestUtils
::
resetDB
();
setOptions
(
L_INFO
,
true
,
true
);
initAll
(
L_INFO
,
false
,
true
,
true
,
false
);
initAll
(
L_INFO
,
false
,
true
,
true
,
false
,
true
);
}
~
TestFixtureHTTPS
()
{
...
...
@@ -101,7 +101,7 @@ public:
TestFixtureZMQSign
()
{
TestUtils
::
resetDB
();
setOptions
(
L_INFO
,
false
,
true
);
initAll
(
L_INFO
,
false
,
true
,
true
,
false
);
initAll
(
L_INFO
,
false
,
true
,
true
,
false
,
false
);
}
~
TestFixtureZMQSign
()
{
...
...
@@ -114,7 +114,7 @@ class TestFixtureNoResetFromBackup {
public
:
TestFixtureNoResetFromBackup
()
{
setFullOptions
(
L_INFO
,
false
,
true
,
true
);
initAll
(
L_INFO
,
false
,
false
,
true
,
false
);
initAll
(
L_INFO
,
false
,
false
,
true
,
false
,
false
);
}
~
TestFixtureNoResetFromBackup
()
{
...
...
@@ -128,7 +128,7 @@ class TestFixtureNoReset {
public
:
TestFixtureNoReset
()
{
setOptions
(
L_INFO
,
false
,
true
);
initAll
(
L_INFO
,
false
,
false
,
true
,
false
);
initAll
(
L_INFO
,
false
,
false
,
true
,
false
,
false
);
}
~
TestFixtureNoReset
()
{
...
...
zmq_src/ReqMessage.cpp
View file @
8a11d1f9
...
...
@@ -155,7 +155,7 @@ Json::Value createBLSPrivateKeyReqMessage::process() {
auto
secretShare
=
getStringRapid
(
"secretShare"
);
auto
t
=
getInt64Rapid
(
"t"
);
auto
n
=
getInt64Rapid
(
"n"
);
if
(
checkKeyOwnership
&&
!
isKeyByOwner
(
ethKeyName
,
getStringRapid
(
"cert"
))
||
!
isKeyByOwner
(
polyName
,
getStringRapid
(
"cert"
)))
{
if
(
checkKeyOwnership
&&
(
!
isKeyByOwner
(
ethKeyName
,
getStringRapid
(
"cert"
))
||
!
isKeyByOwner
(
polyName
,
getStringRapid
(
"cert"
)
)))
{
throw
std
::
invalid_argument
(
"Only owner of the key can access it"
);
}
auto
result
=
SGXWalletServer
::
createBLSPrivateKeyV2Impl
(
blsKeyName
,
ethKeyName
,
polyName
,
secretShare
,
t
,
n
);
...
...
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