aboutsummaryrefslogtreecommitdiff
path: root/src/httprpc.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2022-04-04 13:19:49 -0400
committerMacroFake <falke.marco@gmail.com>2022-04-27 14:12:55 +0200
commita65931e3ce66d87b8f83d67ecdbb46f137e6a670 (patch)
tree1cdbaa2a15af7b87d7a963c4c759c2a29ddbe437 /src/httprpc.cpp
parenta4377a0843636eae0aaf698510fc6518582545db (diff)
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.
Diffstat (limited to 'src/httprpc.cpp')
-rw-r--r--src/httprpc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
index 5d62568343..96cccd8de9 100644
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -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(':'));