New config file structure. (#201)

This commit is contained in:
Savinda Senevirathne
2020-12-23 18:52:58 +05:30
committed by GitHub
parent 1a954ad96e
commit e835e18d18
22 changed files with 450 additions and 393 deletions

View File

@@ -64,11 +64,11 @@ namespace msg::usrmsg::json
msg += SEP_COMMA;
msg += msg::usrmsg::FLD_CONTRACT_ID;
msg += SEP_COLON;
msg += conf::cfg.contractid;
msg += conf::cfg.contract.id;
msg += SEP_COMMA;
msg += msg::usrmsg::FLD_CONTRACT_VERSION;
msg += SEP_COLON;
msg += conf::cfg.contractversion;
msg += conf::cfg.contract.version;
msg += SEP_COMMA;
msg += msg::usrmsg::FLD_CHALLENGE;
msg += SEP_COLON;
@@ -93,8 +93,8 @@ namespace msg::usrmsg::json
void create_server_challenge_response(std::vector<uint8_t> &msg, const std::string &original_challenge)
{
// Generate signature of challenge + contract id + contract version.
const std::string content = original_challenge + conf::cfg.contractid + conf::cfg.contractversion;
const std::string sig_hex = crypto::sign_hex(content, conf::cfg.seckeyhex);
const std::string content = original_challenge + conf::cfg.contract.id + conf::cfg.contract.version;
const std::string sig_hex = crypto::sign_hex(content, conf::cfg.node.private_key_hex);
// Since we know the rough size of the challenge message we reserve adequate amount for the holder.
msg.reserve(1024);
@@ -109,7 +109,7 @@ namespace msg::usrmsg::json
msg += SEP_COMMA;
msg += msg::usrmsg::FLD_PUBKEY;
msg += SEP_COLON;
msg += conf::cfg.pubkeyhex;
msg += conf::cfg.node.pub_key_hex;
msg += SEP_COMMA;
msg += msg::usrmsg::FLD_UNL;
msg += "\":[";