SKALE-3951 cleanup

parent b128bca4
......@@ -49,6 +49,12 @@
#include "Log.h"
#ifdef SGX_HW_SIM
#define NUM_THREADS 16
#else
#define NUM_THREADS 200
#endif
using namespace std;
std::shared_timed_mutex sgxInitMutex;
......@@ -111,20 +117,12 @@ void SGXWalletServer::printDB() {
LevelDB::getLevelDb()->visitKeys(&v, 100000000);
}
#ifdef SGX_HW_SIM
#define NUM_THREADS 16
#else
#define NUM_THREADS 200
#endif
bool SGXWalletServer::verifyCert(string &_certFileName) {
string rootCAPath = string(SGXDATA_FOLDER) + "cert_data/rootCA.pem";
string verifyCert = "cert/verify_client_cert " + rootCAPath + " " + _certFileName;
return system(verifyCert.c_str()) == 0;
}
void SGXWalletServer::createCertsIfNeeded() {
string rootCAPath = string(SGXDATA_FOLDER) + "cert_data/rootCA.pem";
......@@ -170,7 +168,6 @@ void SGXWalletServer::createCertsIfNeeded() {
}
}
void SGXWalletServer::initHttpsServer(bool _checkCerts) {
COUNT_STATISTICS
spdlog::info("Entering {}", __FUNCTION__);
......@@ -214,15 +211,15 @@ void SGXWalletServer::initHttpServer() { //without ssl
}
int SGXWalletServer::exitServer() {
spdlog::info("Stoping sgx server");
spdlog::info("Stoping sgx server");
if (server && !server->StopListening()) {
spdlog::error("Sgx server could not be stopped. Will forcefully terminate the app");
} else {
spdlog::info("Sgx server stopped");
}
if (server && !server->StopListening()) {
spdlog::error("Sgx server could not be stopped. Will forcefully terminate the app");
} else {
spdlog::info("Sgx server stopped");
}
return 0;
return 0;
}
Json::Value
......@@ -269,7 +266,6 @@ SGXWalletServer::importBLSKeyShareImpl(const string &_keyShare, const string &_k
RETURN_SUCCESS(result);
}
map <string, string> SGXWalletServer::blsRequests;
recursive_mutex SGXWalletServer::blsRequestsLock;
......@@ -288,7 +284,6 @@ void SGXWalletServer::checkForDuplicate(map <string, string> &_map, recursive_mu
_map[_key] = _value;
}
Json::Value
SGXWalletServer::blsSignMessageHashImpl(const string &_keyShareName, const string &_messageHash, int t, int n) {
spdlog::trace("Entering {}", __FUNCTION__);
......@@ -305,10 +300,8 @@ SGXWalletServer::blsSignMessageHashImpl(const string &_keyShareName, const strin
shared_ptr <string> value = nullptr;
checkForDuplicate(blsRequests, blsRequestsLock, _keyShareName, _messageHash);
try {
if (!checkName(_keyShareName, "BLS_KEY")) {
throw SGXException(BLS_SIGN_INVALID_KS_NAME, string(__FUNCTION__) + ":Invalid BLSKey name");
......@@ -342,9 +335,7 @@ SGXWalletServer::blsSignMessageHashImpl(const string &_keyShareName, const strin
result["signatureShare"] = string(signature.data());
RETURN_SUCCESS(result);
}
Json::Value SGXWalletServer::importECDSAKeyImpl(const string &_keyShare,
......@@ -648,7 +639,6 @@ SGXWalletServer::createBLSPrivateKeyImpl(const string &_blsKeyName, const string
string(__FUNCTION__) + ":Error while creating BLS key share");
}
for (int i = 0; i < _n; i++) {
string name = _polyName + "_" + to_string(i) + ":";
LevelDB::getLevelDb()->deleteDHDKGKey(name);
......@@ -978,7 +968,6 @@ SGXWalletServer::createBLSPrivateKeyV2Impl(const string &_blsKeyName, const stri
string(__FUNCTION__) + ":Error while creating BLS key share");
}
for (int i = 0; i < _n; i++) {
string name = _polyName + "_" + to_string(i) + ":";
LevelDB::getLevelDb()->deleteDHDKGKey(name);
......@@ -987,7 +976,6 @@ SGXWalletServer::createBLSPrivateKeyV2Impl(const string &_blsKeyName, const stri
}
LevelDB::getLevelDb()->deleteKey(_polyName);
string encryptedSecretShareName = "encryptedSecretShare:" + _polyName;
LevelDB::getLevelDb()->deleteKey(encryptedSecretShareName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment