MCPcopy Create free account
hub / github.com/LUX-Core/lux / RPCAuthorized

Function RPCAuthorized

src/httprpc.cpp:87–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static bool RPCAuthorized(const std::string& strAuth)
88{
89 if (strRPCUserColonPass.empty()) // Belt-and-suspenders measure if InitRPCAuthentication was not called
90 return false;
91 if (strAuth.substr(0, 6) != "Basic ")
92 return false;
93 std::string strUserPass64 = strAuth.substr(6);
94 boost::trim(strUserPass64);
95 std::string strUserPass = DecodeBase64(strUserPass64);
96 return TimingResistantEqual(strUserPass, strRPCUserColonPass);
97}
98
99static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
100{

Callers 1

HTTPReq_JSONRPCFunction · 0.85

Calls 3

DecodeBase64Function · 0.85
TimingResistantEqualFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected