| 85 | } |
| 86 | |
| 87 | static 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 | |
| 99 | static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &) |
| 100 | { |
no test coverage detected