mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Make DecodeBase{32,64} always return vector, not string
Base32/base64 are mechanisms for encoding binary data. That they'd decode to a string is just bizarre. The fact that they'd do that based on the type of input arguments even more so.
This commit is contained in:
parent
a4377a0843
commit
a65931e3ce
13 changed files with 31 additions and 30 deletions
|
|
@ -133,8 +133,9 @@ static bool RPCAuthorized(const std::string& strAuth, std::string& strAuthUserna
|
|||
return false;
|
||||
std::string strUserPass64 = TrimString(strAuth.substr(6));
|
||||
bool invalid;
|
||||
std::string strUserPass = DecodeBase64(strUserPass64, &invalid);
|
||||
std::vector<unsigned char> userpass_data = DecodeBase64(strUserPass64, &invalid);
|
||||
if (invalid) return false;
|
||||
std::string strUserPass(userpass_data.begin(), userpass_data.end());
|
||||
|
||||
if (strUserPass.find(':') != std::string::npos)
|
||||
strAuthUsernameOut = strUserPass.substr(0, strUserPass.find(':'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue