mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Indentation after 'Remove redundant calls to gArgs.IsArgSet()'
This commit is contained in:
@@ -94,31 +94,31 @@ static bool multiUserAuthorized(std::string strUserPass)
|
||||
|
||||
for (const std::string& strRPCAuth : gArgs.GetArgs("-rpcauth")) {
|
||||
//Search for multi-user login/pass "rpcauth" from config
|
||||
std::vector<std::string> vFields;
|
||||
boost::split(vFields, strRPCAuth, boost::is_any_of(":$"));
|
||||
if (vFields.size() != 3) {
|
||||
//Incorrect formatting in config file
|
||||
continue;
|
||||
}
|
||||
std::vector<std::string> vFields;
|
||||
boost::split(vFields, strRPCAuth, boost::is_any_of(":$"));
|
||||
if (vFields.size() != 3) {
|
||||
//Incorrect formatting in config file
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string strName = vFields[0];
|
||||
if (!TimingResistantEqual(strName, strUser)) {
|
||||
continue;
|
||||
}
|
||||
std::string strName = vFields[0];
|
||||
if (!TimingResistantEqual(strName, strUser)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string strSalt = vFields[1];
|
||||
std::string strHash = vFields[2];
|
||||
std::string strSalt = vFields[1];
|
||||
std::string strHash = vFields[2];
|
||||
|
||||
static const unsigned int KEY_SIZE = 32;
|
||||
unsigned char out[KEY_SIZE];
|
||||
static const unsigned int KEY_SIZE = 32;
|
||||
unsigned char out[KEY_SIZE];
|
||||
|
||||
CHMAC_SHA256(reinterpret_cast<const unsigned char*>(strSalt.c_str()), strSalt.size()).Write(reinterpret_cast<const unsigned char*>(strPass.c_str()), strPass.size()).Finalize(out);
|
||||
std::vector<unsigned char> hexvec(out, out+KEY_SIZE);
|
||||
std::string strHashFromPass = HexStr(hexvec);
|
||||
CHMAC_SHA256(reinterpret_cast<const unsigned char*>(strSalt.c_str()), strSalt.size()).Write(reinterpret_cast<const unsigned char*>(strPass.c_str()), strPass.size()).Finalize(out);
|
||||
std::vector<unsigned char> hexvec(out, out+KEY_SIZE);
|
||||
std::string strHashFromPass = HexStr(hexvec);
|
||||
|
||||
if (TimingResistantEqual(strHashFromPass, strHash)) {
|
||||
return true;
|
||||
}
|
||||
if (TimingResistantEqual(strHashFromPass, strHash)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user