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
f5d217ae
Unverified
Commit
f5d217ae
authored
Jul 23, 2020
by
Oleh Nikolaiev
Committed by
GitHub
Jul 23, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into bug/SKALE-2830-tests-fail-after-longrun
parents
cde81090
135dd788
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
70 additions
and
90 deletions
+70
-90
BLSCrypto.cpp
BLSCrypto.cpp
+5
-5
BLSPrivateKeyShareSGX.cpp
BLSPrivateKeyShareSGX.cpp
+7
-7
LevelDB.cpp
LevelDB.cpp
+1
-1
SGXWalletServer.cpp
SGXWalletServer.cpp
+18
-13
SGXWalletServer.h
SGXWalletServer.h
+2
-4
docker-compose.yml
run_sgx_sim/docker-compose.yml
+2
-2
DHDkg.c
secure_enclave/DHDkg.c
+0
-1
EnclaveCommon.cpp
secure_enclave/EnclaveCommon.cpp
+0
-3
secure_enclave.c
secure_enclave/secure_enclave.c
+14
-25
sgxwall.cpp
sgxwall.cpp
+16
-4
sgxwallet.h
sgxwallet.h
+2
-0
tests.bash
tests.bash
+0
-22
testw.cpp
testw.cpp
+3
-3
No files found.
BLSCrypto.cpp
View file @
f5d217ae
...
...
@@ -215,13 +215,13 @@ bool sign_aes(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, siz
sz
,
xStrArg
,
yStrArg
,
signature
);
if
(
status
!=
SGX_SUCCESS
)
{
cerr
<<
"SGX enclave call
to trustedBlsSignMessage failed
:"
<<
status
<<
std
::
endl
;
BOOST_THROW_EXCEPTION
(
runtime_error
(
"SGX enclave call
to trustedBlsSignMessage failed"
));
cerr
<<
"SGX enclave call
to trustedBlsSignMessage failed with status
:"
<<
status
<<
std
::
endl
;
BOOST_THROW_EXCEPTION
(
runtime_error
(
"SGX enclave call to trustedBlsSignMessage failed"
));
}
if
(
errStatus
!=
0
)
{
cerr
<<
"SGX enclave call
to trustedBlsSignMessage failed
:"
<<
errStatus
<<
std
::
endl
;
BOOST_THROW_EXCEPTION
(
runtime_error
(
"SGX enclave call
to trustedBlsSignMessage failed"
));
cerr
<<
"SGX enclave call
to trustedBlsSignMessage failed with errStatus
:"
<<
errStatus
<<
std
::
endl
;
BOOST_THROW_EXCEPTION
(
runtime_error
(
"SGX enclave call to trustedBlsSignMessage failed"
));
}
std
::
string
hint
=
BLSutils
::
ConvertToString
(
hash_with_hint
.
first
.
Y
)
+
":"
+
hash_with_hint
.
second
;
...
...
@@ -256,7 +256,7 @@ std::string encryptBLSKeyShare2Hex(int *errStatus, char *err_string, const char
status
=
trustedEncryptKeyAES
(
eid
,
errStatus
,
errMsg
->
data
(),
keyArray
->
data
(),
encryptedKey
->
data
(),
&
encryptedLen
);
spdlog
::
debug
(
"errStatus is {}"
,
*
errStatus
);
spdlog
::
debug
(
"
errMsg is "
,
errMsg
->
data
());
spdlog
::
debug
(
"errMsg is "
,
errMsg
->
data
());
if
(
*
errStatus
!=
0
)
{
throw
SGXException
(
-
666
,
errMsg
->
data
());
...
...
BLSPrivateKeyShareSGX.cpp
View file @
f5d217ae
/*
Copyright (C) 2018-2019 SKALE Labs
This file is part of
libBLS
.
This file is part of
sgxwallet
.
libBLS
is free software: you can redistribute it and/or modify
sgxwallet
is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
libBLS
is distributed in the hope that it will be useful,
sgxwallet
is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with
libBLS
. If not, see <https://www.gnu.org/licenses/>.
along with
sgxwallet
. If not, see <https://www.gnu.org/licenses/>.
@file BLSPrivateKeyShare.cpp
@author Stan Kladko
...
...
@@ -94,7 +94,7 @@ std::string BLSPrivateKeyShareSGX::signWithHelperSGXstr(
shared_ptr
<
signatures
::
Bls
>
obj
;
if
(
hash_byte_arr
==
nullptr
)
{
std
::
cerr
<<
"Hash is null"
<<
std
::
endl
;
std
::
cerr
<<
"Hash is null"
<<
std
::
endl
;
BOOST_THROW_EXCEPTION
(
runtime_error
(
"Hash is null"
));
}
...
...
@@ -109,14 +109,14 @@ std::string BLSPrivateKeyShareSGX::signWithHelperSGXstr(
string
*
xStr
=
stringFromFq
(
&
(
hash_with_hint
.
first
.
X
));
if
(
xStr
==
nullptr
)
{
std
::
cerr
<<
"Null xStr"
<<
std
::
endl
;
std
::
cerr
<<
"Null xStr"
<<
std
::
endl
;
BOOST_THROW_EXCEPTION
(
runtime_error
(
"Null xStr"
));
}
string
*
yStr
=
stringFromFq
(
&
(
hash_with_hint
.
first
.
Y
));
if
(
yStr
==
nullptr
)
{
std
::
cerr
<<
"Null yStr"
<<
std
::
endl
;
std
::
cerr
<<
"Null yStr"
<<
std
::
endl
;
BOOST_THROW_EXCEPTION
(
runtime_error
(
"Null yStr"
));
}
...
...
LevelDB.cpp
View file @
f5d217ae
...
...
@@ -53,7 +53,7 @@ std::shared_ptr<string> LevelDB::readString(const string &_key) {
throw
SGXException
(
NULL_DATABASE
,
"Null db"
);
}
spdlog
::
info
(
"key to read from db: {}"
,
_key
);
spdlog
::
debug
(
"key to read from db: {}"
,
_key
);
auto
status
=
db
->
Get
(
readOptions
,
_key
,
&*
result
);
...
...
SGXWalletServer.cpp
View file @
f5d217ae
...
...
@@ -29,6 +29,8 @@
#include <stdio.h>
#include "sgxwallet_common.h"
#include "sgxwallet.h"
#include "SGXException.h"
#include "LevelDB.h"
...
...
@@ -50,27 +52,30 @@
#include "Log.h"
void
setFullOptions
(
int
_printDebugInfo
,
int
_printTraceInfo
,
int
_useHTTPS
,
int
_autoconfirm
,
int
_encryptKeys
)
{
if
(
_printDebugInfo
)
spdlog
::
set_level
(
spdlog
::
level
::
debug
);
else
if
(
_printTraceInfo
)
{
using
namespace
std
;
void
setFullOptions
(
uint64_t
_logLevel
,
int
_useHTTPS
,
int
_autoconfirm
,
int
_encryptKeys
)
{
CHECK_STATE
(
_logLevel
<=
2
)
if
(
_logLevel
==
L_TRACE
)
{
spdlog
::
set_level
(
spdlog
::
level
::
trace
);
}
else
if
(
_printTraceInfo
)
{
}
else
if
(
_logLevel
==
L_DEBUG
)
{
spdlog
::
set_level
(
spdlog
::
level
::
debug
);
}
else
{
spdlog
::
set_level
(
spdlog
::
level
::
info
);
}
useHTTPS
=
_useHTTPS
;
spdlog
::
info
(
"useHTTPS set to "
+
std
::
to_string
(
_useHTTPS
));
spdlog
::
info
(
"useHTTPS set to "
+
to_string
(
_useHTTPS
));
autoconfirm
=
_autoconfirm
;
spdlog
::
info
(
"autoconfirm set to "
+
std
::
to_string
(
autoconfirm
));
spdlog
::
info
(
"autoconfirm set to "
+
to_string
(
autoconfirm
));
encryptKeys
=
_encryptKeys
;
spdlog
::
info
(
"encryptKeys set to "
+
std
::
to_string
(
encryptKeys
));
spdlog
::
info
(
"encryptKeys set to "
+
to_string
(
encryptKeys
));
}
void
setOptions
(
int
_printDebugInfo
,
int
_printTraceInfo
,
int
_useHTTPS
,
int
_autoconfirm
)
{
setFullOptions
(
_printDebugInfo
,
_printTraceInfo
,
_useHTTPS
,
_autoconfirm
,
false
);
void
setOptions
(
uint64_t
_logLevel
,
int
_useHTTPS
,
int
_autoconfirm
)
{
setFullOptions
(
_logLevel
,
_useHTTPS
,
_autoconfirm
,
false
);
}
bool
isStringDec
(
const
string
&
_str
)
{
...
...
SGXWalletServer.h
View file @
f5d217ae
...
...
@@ -30,11 +30,9 @@
#define EXTERNC
#endif
EXTERNC
void
setFullOptions
(
int
_printDebugInfo
,
int
_printTraceInfo
,
int
_useHTTPS
,
int
_autoconfirm
,
int
_encryptKeys
);
EXTERNC
void
setFullOptions
(
uint64_t
_logLevel
,
int
_useHTTPS
,
int
_autoconfirm
,
int
_encryptKeys
);
EXTERNC
void
setOptions
(
int
_printDebugInfo
,
int
_printTraceInfo
,
int
_useHTTPS
,
int
_autoconfirm
);
EXTERNC
void
setOptions
(
uint64_t
_logLevel
,
int
_useHTTPS
,
int
_autoconfirm
);
#endif //SGXWALLET_SGXWALLETSERVER_H
run_sgx_sim/docker-compose.yml
View file @
f5d217ae
version
:
'
3'
services
:
sgxwallet
:
image
:
skalenetwork/sgxwalletsim:latest
image
:
skalenetwork/sgxwallet
_
sim:latest
ports
:
-
"
1026:1026"
-
"
1027:1027"
...
...
@@ -16,5 +16,5 @@ services:
max-size
:
"
10m"
max-file
:
"
4"
restart
:
unless-stopped
command
:
-s -y
-d
command
:
-s -y
secure_enclave/DHDkg.c
View file @
f5d217ae
...
...
@@ -179,4 +179,3 @@ void xor_decrypt(char* key, char* cypher, char* message) {
free
(
key_bin
);
}
secure_enclave/EnclaveCommon.cpp
View file @
f5d217ae
...
...
@@ -101,8 +101,6 @@ void enclave_init() {
bool
enclave_sign
(
const
char
*
_keyString
,
const
char
*
_hashXString
,
const
char
*
_hashYString
,
char
*
sig
)
{
auto
key
=
keyFromString
(
_keyString
);
if
(
key
==
nullptr
)
{
...
...
@@ -235,4 +233,3 @@ EXTERNC void LOG_DEBUG(const char* _msg) {
EXTERNC
void
LOG_TRACE
(
const
char
*
_msg
)
{
logMsg
(
L_TRACE
,
_msg
);
};
secure_enclave/secure_enclave.c
View file @
f5d217ae
...
...
@@ -90,7 +90,7 @@ void trustedEnclaveInit(uint32_t _logLevel) {
enclave_init
();
LOG_
DEBUG
(
"SUCCESS
"
);
LOG_
INFO
(
"Successfully inited enclave
"
);
}
void
free_function
(
void
*
ptr
,
size_t
sz
)
{
...
...
@@ -194,7 +194,7 @@ void trustedGenerateEcdsaKey(int *errStatus, char *errString,
strncpy
(
pub_key_y
+
n_zeroes
,
arr_y
,
1024
-
n_zeroes
);
char
skey_str
[
mpz_sizeinbase
(
skey
,
ECDSA_SKEY_BASE
)
+
2
];
mpz_get_str
(
skey_str
,
ECDSA_SKEY_BASE
,
skey
);
snprintf
(
errString
,
BUF_LEN
,
"skey
is %s len %d
\n
"
,
skey_str
,
strlen
(
skey_str
));
snprintf
(
errString
,
BUF_LEN
,
"skey
len is %d
\n
"
,
strlen
(
skey_str
));
uint32_t
sealedLen
=
sgx_calc_sealed_data_size
(
0
,
ECDSA_SKEY_LEN
);
...
...
@@ -331,7 +331,7 @@ void trustedEcdsaSign(int *errStatus, char *errString, uint8_t *encryptedPrivate
if
(
mpz_set_str
(
msgMpz
,
hash
,
16
)
==
-
1
)
{
*
errStatus
=
1
;
snprintf
(
errString
,
BUF_LEN
,
"invalid message hash %s"
,
hash
);
LOG_
WARN
(
errString
);
LOG_
ERROR
(
errString
);
goto
clean
;
}
...
...
@@ -369,7 +369,7 @@ void trustedEcdsaSign(int *errStatus, char *errString, uint8_t *encryptedPrivate
if
(
!
signature_verify
(
msgMpz
,
sign
,
publicKey
,
curve
))
{
*
errStatus
=
2
;
snprintf
(
errString
,
BUF_LEN
,
"ECDSA signature is not verified"
);
LOG_
WARN
(
errString
);
LOG_
ERROR
(
errString
);
goto
clean
;
}
...
...
@@ -534,8 +534,6 @@ void trustedGenDkgSecret(int *errStatus, char *errString, uint8_t *encrypted_dkg
return
;
}
snprintf
(
errString
,
BUF_LEN
,
"poly is %s "
,
dkg_secret
);
uint32_t
sealedLen
=
sgx_calc_sealed_data_size
(
0
,
DKG_BUFER_LENGTH
);
sgx_status_t
status
=
sgx_seal_data
(
0
,
NULL
,
DKG_BUFER_LENGTH
,
(
uint8_t
*
)
dkg_secret
,
sealedLen
,
...
...
@@ -655,7 +653,6 @@ void trustedGetEncryptedSecretShare(int *errStatus, char *errString, uint8_t *en
*
errStatus
=
status
;
return
;
}
snprintf
(
errString
,
BUF_LEN
,
"unsealed random skey is %s
\n
"
,
skey
);
char
*
common_key
[
ECDSA_SKEY_LEN
];
gen_session_key
(
skey
,
pub_keyB
,
common_key
);
...
...
@@ -666,7 +663,6 @@ void trustedGetEncryptedSecretShare(int *errStatus, char *errString, uint8_t *en
snprintf
(
errString
,
BUF_LEN
,
"
\n
t does not match poly degree
\n
"
);
return
;
}
snprintf
(
errString
+
88
,
BUF_LEN
,
"
\n
secret share is %s"
,
s_share
);
if
(
calc_secret_shareG2
(
s_share
,
s_shareG2
)
!=
0
)
{
*
errStatus
=
-
1
;
...
...
@@ -826,7 +822,6 @@ void trustedCreateBlsKey(int *errStatus, char *errString, const char *s_shares,
char
key_share
[
mpz_sizeinbase
(
bls_key
,
16
)
+
2
];
mpz_get_str
(
key_share
,
16
,
bls_key
);
snprintf
(
errString
,
BUF_LEN
,
" bls private key is %s"
,
key_share
);
uint32_t
sealedLen
=
sgx_calc_sealed_data_size
(
0
,
ECDSA_SKEY_LEN
);
status
=
sgx_seal_data
(
0
,
NULL
,
ECDSA_SKEY_LEN
,
(
uint8_t
*
)
key_share
,
sealedLen
,
...
...
@@ -986,7 +981,7 @@ void trustedGenerateEcdsaKeyAES(int *errStatus, char *errString,
}
strncpy
(
skey_str
+
n_zeroes
,
arr_skey_str
,
65
-
n_zeroes
);
skey_str
[
ECDSA_SKEY_LEN
-
1
]
=
0
;
snprintf
(
errString
,
BUF_LEN
,
"skey
is %s len %d
\n
"
,
skey_str
,
strlen
(
skey_str
));
snprintf
(
errString
,
BUF_LEN
,
"skey
len is %d
\n
"
,
strlen
(
skey_str
));
int
stat
=
AES_encrypt
(
skey_str
,
encryptedPrivateKey
);
...
...
@@ -1049,7 +1044,7 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
mpz_t
privateKeyMpz
;
mpz_init
(
privateKeyMpz
);
if
(
mpz_set_str
(
privateKeyMpz
,
skey
,
ECDSA_SKEY_BASE
)
==
-
1
)
{
snprintf
(
errString
,
BUF_LEN
,
"wrong string to init private key
- %s"
,
skey
);
snprintf
(
errString
,
BUF_LEN
,
"wrong string to init private key
"
);
*
errStatus
=
-
10
;
mpz_clear
(
privateKeyMpz
);
...
...
@@ -1130,7 +1125,7 @@ void trustedEcdsaSignAES(int *errStatus, char *errString, uint8_t *encryptedPriv
skey
[
enc_len
-
SGX_AESGCM_MAC_SIZE
-
SGX_AESGCM_IV_SIZE
]
=
'\0'
;
snprintf
(
errString
,
BUF_LEN
,
"pr key
is %s length %d "
,
skey
,
strlen
(
skey
));
snprintf
(
errString
,
BUF_LEN
,
"pr key
length is %zu "
,
strlen
(
skey
));
mpz_t
privateKeyMpz
;
mpz_init
(
privateKeyMpz
);
if
(
mpz_set_str
(
privateKeyMpz
,
skey
,
ECDSA_SKEY_BASE
)
==
-
1
)
{
...
...
@@ -1314,8 +1309,6 @@ trustedGenDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_dkg_s
return
;
}
snprintf
(
errString
,
BUF_LEN
,
"poly is %s "
,
dkg_secret
);
int
status
=
AES_encrypt
(
dkg_secret
,
encrypted_dkg_secret
);
if
(
status
!=
SGX_SUCCESS
)
{
...
...
@@ -1331,13 +1324,12 @@ trustedGenDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_dkg_s
status
=
AES_decrypt
(
encrypted_dkg_secret
,
*
enc_len
,
decr_dkg_secret
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
errString
,
BUF_LEN
,
"aes decrypt
dkg poly failed"
);
snprintf
(
errString
,
BUF_LEN
,
"aes decrypt dkg poly failed"
);
*
errStatus
=
status
;
return
;
}
if
(
strcmp
(
dkg_secret
,
decr_dkg_secret
)
!=
0
)
{
snprintf
(
errString
,
BUF_LEN
,
"poly is %s "
,
dkg_secret
);
snprintf
(
errString
+
strlen
(
dkg_secret
)
+
8
,
BUF_LEN
-
strlen
(
dkg_secret
)
-
8
,
"encrypted poly is not equal to decrypted poly"
);
*
errStatus
=
-
333
;
...
...
@@ -1395,12 +1387,11 @@ void trustedGetEncryptedSecretShareAES(int *errStatus, char *errString, uint8_t
skey
[
ECDSA_SKEY_LEN
-
1
]
=
0
;
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
errString
,
BUF_LEN
,
"AES_decrypt failed (in trustedGetEncryptedSecretShareAES)
with status %d"
,
snprintf
(
errString
,
BUF_LEN
,
"AES_decrypt failed (in trustedGetEncryptedSecretShareAES) with status %d"
,
status
);
*
errStatus
=
status
;
return
;
}
snprintf
(
errString
,
BUF_LEN
,
"unsealed random skey is %s
\n
"
,
skey
);
*
dec_len
=
enc_len
;
...
...
@@ -1412,10 +1403,9 @@ void trustedGetEncryptedSecretShareAES(int *errStatus, char *errString, uint8_t
if
(
calc_secret_share
(
decryptedDkgPoly
,
s_share
,
_t
,
_n
,
ind
)
!=
0
)
{
*
errStatus
=
-
1
;
snprintf
(
errString
,
BUF_LEN
,
decryptedDkgPoly
);
snprintf
(
errString
,
BUF_LEN
,
"calc secret share failed"
);
return
;
}
snprintf
(
errString
+
88
,
BUF_LEN
,
"
\n
secret share is %s"
,
s_share
);
if
(
calc_secret_shareG2
(
s_share
,
s_shareG2
)
!=
0
)
{
*
errStatus
=
-
1
;
...
...
@@ -1472,7 +1462,7 @@ void trustedDkgVerifyAES(int *errStatus, char *errString, const char *public_sha
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
enc_len
,
skey
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
errString
,
BUF_LEN
,
"AES_decrypt failed (in trustedDkgVerifyAES)
with status %d"
,
status
);
snprintf
(
errString
,
BUF_LEN
,
"AES_decrypt failed (in trustedDkgVerifyAES) with status %d"
,
status
);
*
errStatus
=
status
;
return
;
}
...
...
@@ -1513,7 +1503,7 @@ void trustedDkgVerifyAES(int *errStatus, char *errString, const char *public_sha
*
result
=
Verification
(
public_shares
,
s
,
_t
,
_ind
);
mpz_clear
(
s
);
snprintf
(
errString
,
BUF_LEN
,
"
secret share dec
%s"
,
public_shares
);
snprintf
(
errString
,
BUF_LEN
,
"
public shares
%s"
,
public_shares
);
}
void
trustedCreateBlsKeyAES
(
int
*
errStatus
,
char
*
errString
,
const
char
*
s_shares
,
...
...
@@ -1577,8 +1567,8 @@ void trustedCreateBlsKeyAES(int *errStatus, char *errString, const char *s_share
mpz_init
(
decr_secret_share
);
if
(
mpz_set_str
(
decr_secret_share
,
decr_sshare
,
16
)
==
-
1
)
{
*
errStatus
=
111
;
snprintf
(
errString
,
BUF_LEN
,
decr_sshare
);
LOG_ERROR
(
decr_sshare
);
snprintf
(
errString
,
BUF_LEN
,
"invalid decrypted secret share"
);
LOG_ERROR
(
errString
);
mpz_clear
(
decr_secret_share
);
mpz_clear
(
sum
);
...
...
@@ -1608,7 +1598,6 @@ void trustedCreateBlsKeyAES(int *errStatus, char *errString, const char *s_share
}
strncpy
(
key_share
+
n_zeroes
,
arr_skey_str
,
65
-
n_zeroes
);
key_share
[
BLS_KEY_LENGTH
-
1
]
=
0
;
snprintf
(
errString
,
BUF_LEN
,
" bls private key is %s"
,
key_share
);
status
=
AES_encrypt
(
key_share
,
encr_bls_key
);
...
...
sgxwall.cpp
View file @
f5d217ae
...
...
@@ -56,7 +56,7 @@ void SGXWallet::printUsage() {
cerr
<<
"-T Generate test keys
\n
"
;
}
enum
log_level
{
L_TRACE
=
0
,
L_DEBUG
=
1
,
L_INFO
=
2
,
L_WARNING
=
3
,
L_ERROR
=
4
};
void
SGXWallet
::
serializeKeys
(
const
vector
<
string
>&
_ecdsaKeyNames
,
const
vector
<
string
>&
_blsKeyNames
,
const
string
&
_fileName
)
{
Json
::
Value
top
(
Json
::
objectValue
);
...
...
@@ -149,14 +149,26 @@ int main(int argc, char *argv[]) {
}
}
setFullOptions
(
printDebugInfoOption
,
printTraceInfoOption
,
useHTTPSOption
,
autoconfirmOption
,
encryptKeysOption
);
uint64_t
logLevel
=
L_INFO
;
if
(
printDebugInfoOption
)
{
logLevel
=
L_DEBUG
;
}
if
(
printTraceInfoOption
)
{
logLevel
=
L_TRACE
;
}
setFullOptions
(
logLevel
,
useHTTPSOption
,
autoconfirmOption
,
encryptKeysOption
);
uint32_t
enclaveLogLevel
=
L_INFO
;
if
(
printDebugInfoOption
)
{
enclaveLogLevel
=
L_DEBUG
;
}
if
(
printTraceInfoOption
)
{
enclaveLogLevel
=
L_TRACE
;
}
else
if
(
printDebugInfoOption
)
{
enclaveLogLevel
=
L_DEBUG
;
}
initAll
(
enclaveLogLevel
,
checkClientCertOption
,
autoSignClientCertOption
);
...
...
sgxwallet.h
View file @
f5d217ae
...
...
@@ -51,4 +51,6 @@ extern sgx_status_t status;
#define ENCLAVE_NAME "secure_enclave.signed.so"
enum
log_level
{
L_TRACE
=
0
,
L_DEBUG
=
1
,
L_INFO
=
2
,
L_WARNING
=
3
,
L_ERROR
=
4
};
#endif //SGXWALLET_SGXWALLET_H
tests.bash
deleted
100755 → 0
View file @
cde81090
#!/bin/bash
set
-e
./testw
[
bls-key-encrypt]
./testw
[
bls-key-encrypt-decrypt]
./testw
[
dkg-gen]
./testw
[
dkg-pub_shares]
#./testw [dkg-encr_sshares]
./testw
[
dkg-verify]
./testw
[
ecdsa_test]
./testw
[
test_test]
./testw
[
get_pub_ecdsa_key_test]
./testw
[
bls_dkg]
./testw
[
api_test]
./testw
[
getServerStatus_test]
./testw
[
many_threads_test]
./testw
[
ecdsa_api_test]
./testw
[
dkg_api_test]
./testw
[
is_poly_test]
./testw
[
aes_dkg]
#./testw [bls_sign]
./testw
[
AES-encrypt-decrypt]
testw.cpp
View file @
f5d217ae
...
...
@@ -70,8 +70,8 @@ class TestFixture {
public
:
TestFixture
()
{
TestUtils
::
resetDB
();
setOptions
(
false
,
false
,
false
,
true
);
initAll
(
2
,
false
,
true
);
setOptions
(
L_INFO
,
false
,
true
);
initAll
(
L_INFO
,
false
,
true
);
}
~
TestFixture
()
{
...
...
@@ -83,7 +83,7 @@ class TestFixtureHTTPS {
public
:
TestFixtureHTTPS
()
{
TestUtils
::
resetDB
();
setOptions
(
false
,
false
,
true
,
true
);
setOptions
(
L_INFO
,
true
,
true
);
initAll
(
0
,
false
,
true
);
}
...
...
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