From 6e96913e3256e1c337ae3b2dd628a41a06e8333b Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 4 Jun 2020 09:28:12 +0300 Subject: [PATCH 1/3] SKALE-2002 add logic to -n flag --- ECDSACrypto.cpp | 3 --- SEKManager.cpp | 1 - SGXWalletServer.cpp | 3 +++ scripts/calculate_version.sh | 9 ++------- sgxwallet.c | 4 +++- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ECDSACrypto.cpp b/ECDSACrypto.cpp index 673dda0c..3f3efab3 100644 --- a/ECDSACrypto.cpp +++ b/ECDSACrypto.cpp @@ -144,7 +144,6 @@ string getECDSAPubKey(const char *_encryptedKeyHex) { bool verifyECDSASig(string& pubKeyStr, const char *hashHex, const char *signatureR, const char *signatureS) { - bool result = false; signature sig = signature_init(); @@ -158,8 +157,6 @@ bool verifyECDSASig(string& pubKeyStr, const char *hashHex, const char *signatur mpz_t msgMpz; mpz_init(msgMpz); - - if (mpz_set_str(msgMpz, hashHex, 16) == -1) { spdlog::error("invalid message hash {}", hashHex); goto clean; diff --git a/SEKManager.cpp b/SEKManager.cpp index 0bc110e6..613b0407 100644 --- a/SEKManager.cpp +++ b/SEKManager.cpp @@ -123,7 +123,6 @@ bool check_SEK(std::string SEK){ } void gen_SEK(){ - vector errMsg(1024,0); int err_status = 0; vector encr_SEK(1024, 0); diff --git a/SGXWalletServer.cpp b/SGXWalletServer.cpp index 0e6d4683..85c7373f 100644 --- a/SGXWalletServer.cpp +++ b/SGXWalletServer.cpp @@ -53,8 +53,11 @@ void setFullOptions(int _printDebugInfo, spdlog::set_level(spdlog::level::info); } useHTTPS = _useHTTPS; + spdlog::info("useHTTPS set to " + std::to_string(_useHTTPS)); autoconfirm = _autoconfirm; + spdlog::info("autoconfirm set to " + std::to_string(autoconfirm)); encryptKeys = _encryptKeys; + spdlog::info("encryptKeys set to " + std::to_string(encryptKeys)); } diff --git a/scripts/calculate_version.sh b/scripts/calculate_version.sh index 3c4b004d..98ba49da 100755 --- a/scripts/calculate_version.sh +++ b/scripts/calculate_version.sh @@ -34,14 +34,9 @@ fi for (( VERSION_NUMBER=0; ; VERSION_NUMBER++ )) do - if [ "$VERSION" = "1.49" ] && [ "$VERSION_NUMBER" -lt 4 ] - then - VERSION_NUMBER=4 - fi RESULT_VERSION="$VERSION-$LABEL.$VERSION_NUMBER" - if ! [ $(git tag -l ?$RESULT_VERSION) ] - then - echo "$RESULT_VERSION" + if ! [[ $(git tag -l | grep $RESULT_VERSION) ]]; then + echo "$RESULT_VERSION" | tr / - break fi done diff --git a/sgxwallet.c b/sgxwallet.c index 9bd04651..b8b2aacf 100644 --- a/sgxwallet.c +++ b/sgxwallet.c @@ -113,6 +113,8 @@ int main(int argc, char *argv[]) { break; case 'n': useHTTPSOption = false; + checkClientCertOption = false; + autoSignClientCertOption = true; break; case 'a': encryptKeysOption = false; @@ -132,7 +134,7 @@ int main(int argc, char *argv[]) { setFullOptions(printDebugInfoOption, printTraceInfoOption, useHTTPSOption, autoconfirmOption, encryptKeysOption); - uint32_t enclaveLogLevel = L_INFO; + uint32_t enclaveLogLevel = L_INFO; if (printTraceInfoOption) { enclaveLogLevel = L_TRACE; From 8a27f01a34289b632dc0b7dff7b21596dbe97176 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 4 Jun 2020 10:34:29 +0300 Subject: [PATCH 2/3] SKALE-2686 open http port --- run_sgx/docker-compose.yml | 1 + run_sgx_sim/docker-compose.yml | 1 + scripts/build_deps.py | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/run_sgx/docker-compose.yml b/run_sgx/docker-compose.yml index 6582221f..6dfbb2a5 100644 --- a/run_sgx/docker-compose.yml +++ b/run_sgx/docker-compose.yml @@ -6,6 +6,7 @@ services: - "1026:1026" - "1027:1027" - "1028:1028" + - "1029:1029" devices: - "/dev/isgx" - "/dev/mei0" diff --git a/run_sgx_sim/docker-compose.yml b/run_sgx_sim/docker-compose.yml index a9d0438c..e8b5dc12 100644 --- a/run_sgx_sim/docker-compose.yml +++ b/run_sgx_sim/docker-compose.yml @@ -6,6 +6,7 @@ services: - "1026:1026" - "1027:1027" - "1028:1028" + - "1029:1029" volumes: - ./sgx_data:/usr/src/sdk/sgx_data - /dev/urandom:/dev/random diff --git a/scripts/build_deps.py b/scripts/build_deps.py index 4726ca11..e06bc046 100755 --- a/scripts/build_deps.py +++ b/scripts/build_deps.py @@ -46,8 +46,6 @@ BLS_BUILD_DIR = BLS_DIR + "/build" JSON_LIBS_DIR = topDir + "/jsonrpc" -#subprocess.call(["git", "submodule", "update", "--init"]) - print("Cleaning") subprocess.call(["rm", "-f", "install-sh"]) From 523ed1b68d821b33968bc2fdd79de11cf8281e46 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 4 Jun 2020 10:57:35 +0300 Subject: [PATCH 3/3] SKALE-2686 remove redunant initialization --- sgxwallet.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sgxwallet.c b/sgxwallet.c index b8b2aacf..6a20f72b 100644 --- a/sgxwallet.c +++ b/sgxwallet.c @@ -113,8 +113,6 @@ int main(int argc, char *argv[]) { break; case 'n': useHTTPSOption = false; - checkClientCertOption = false; - autoSignClientCertOption = true; break; case 'a': encryptKeysOption = false;