Unverified Commit 6abbcc3e authored by kladko's avatar kladko

Revert "SKALE-3067-cleanup-sgx"

This reverts commit 16e1dd98.
parent 16e1dd98
......@@ -187,7 +187,10 @@ SGXWalletServer::importBLSKeyShareImpl(const string &_keyShare, const string &_k
result["encryptedKeyShare"] = encryptedKeyShareHex;
writeKeyShare(_keyShareName, encryptedKeyShareHex, _index, n, t);
} HANDLE_SGX_EXCEPTION(result)
} catch (SGXException &_e) {
result["status"] = _e.status;
result["errorMessage"] = _e.errString;
}
RETURN_SUCCESS(result);
}
......@@ -391,7 +394,6 @@ Json::Value SGXWalletServer::generateDKGPolyImpl(const string &_polyName, int _t
Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName, int _t, int _n) {
INIT_RESULT(result)
result["verificationVector"] = "";
vector <vector<string>> verifVector;
try {
......@@ -412,7 +414,12 @@ Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName,
result["verificationVector"][i][j] = currentCoef.at(j);
}
}
} HANDLE_SGX_EXCEPTION(result)
} catch (SGXException &_e) {
cerr << " err str " << _e.errString << endl;
result["status"] = _e.status;
result["errorMessage"] = _e.errString;
result["verificationVector"] = "";
}
return result;
}
......@@ -420,9 +427,6 @@ Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName,
Json::Value SGXWalletServer::getSecretShareImpl(const string &_polyName, const Json::Value &_pubKeys, int _t, int _n) {
INIT_RESULT(result);
result["secretShare"] = "";
result["SecretShare"] = "";
try {
if (_pubKeys.size() != (uint64_t) _n) {
throw SGXException(INVALID_DKG_PARAMS, "invalid number of public keys");
......@@ -446,7 +450,12 @@ Json::Value SGXWalletServer::getSecretShareImpl(const string &_polyName, const J
string s = trustedGetSecretShares(_polyName, encrPoly->c_str(), pubKeysStrs, _t, _n);
result["secretShare"] = s;
} HANDLE_SGX_EXCEPTION(result);
} catch (SGXException &_e) {
result["status"] = _e.status;
result["errorMessage"] = _e.errString;
result["secretShare"] = "";
result["SecretShare"] = "";
}
return result;
}
......@@ -454,9 +463,7 @@ Json::Value SGXWalletServer::getSecretShareImpl(const string &_polyName, const J
Json::Value SGXWalletServer::dkgVerificationImpl(const string &_publicShares, const string &_ethKeyName,
const string &_secretShare, int _t, int _n, int _index) {
INIT_RESULT(result)
result["result"] = false;
result["result"] = true;
try {
if (!checkECDSAKeyName(_ethKeyName)) {
......@@ -477,9 +484,12 @@ Json::Value SGXWalletServer::dkgVerificationImpl(const string &_publicShares, co
if (!verifyShares(_publicShares.c_str(), _secretShare.c_str(), encryptedKeyHex_ptr->c_str(), _t, _n, _index)) {
result["result"] = false;
}
} HANDLE_SGX_EXCEPTION(result)
} catch (SGXException &_e) {
result["status"] = _e.status;
result["errorMessage"] = _e.errString;
result["result"] = false;
}
result["result"] = true;
return result;
}
......
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