aboutsummaryrefslogtreecommitdiff
path: root/src/util/strencodings.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2022-04-08 23:17:01 -0400
committerMacroFake <falke.marco@gmail.com>2022-04-27 14:12:55 +0200
commita4377a0843636eae0aaf698510fc6518582545db (patch)
treeb89dfb8794880401981929fef7e1e6b211ad46e6 /src/util/strencodings.h
parentd648b5120b2fefa9e599898bd26f05ecf4428fac (diff)
downloadbitcoin-a4377a0843636eae0aaf698510fc6518582545db.tar.xz
Reject incorrect base64 in HTTP auth
In addition, to make sure that no call site ignores the invalid decoding status, make the pf_invalid argument mandatory.
Diffstat (limited to 'src/util/strencodings.h')
-rw-r--r--src/util/strencodings.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/strencodings.h b/src/util/strencodings.h
index 82645c6bf0..c87b2d2415 100644
--- a/src/util/strencodings.h
+++ b/src/util/strencodings.h
@@ -64,13 +64,13 @@ bool IsHex(std::string_view str);
* Return true if the string is a hex number, optionally prefixed with "0x"
*/
bool IsHexNumber(std::string_view str);
-std::vector<unsigned char> DecodeBase64(const char* p, bool* pf_invalid = nullptr);
-std::string DecodeBase64(const std::string& str, bool* pf_invalid = nullptr);
+std::vector<unsigned char> DecodeBase64(const char* p, bool* pf_invalid);
+std::string DecodeBase64(const std::string& str, bool* pf_invalid);
std::string EncodeBase64(Span<const unsigned char> input);
inline std::string EncodeBase64(Span<const std::byte> input) { return EncodeBase64(MakeUCharSpan(input)); }
inline std::string EncodeBase64(const std::string& str) { return EncodeBase64(MakeUCharSpan(str)); }
-std::vector<unsigned char> DecodeBase32(const char* p, bool* pf_invalid = nullptr);
-std::string DecodeBase32(const std::string& str, bool* pf_invalid = nullptr);
+std::vector<unsigned char> DecodeBase32(const char* p, bool* pf_invalid);
+std::string DecodeBase32(const std::string& str, bool* pf_invalid);
/**
* Base32 encode.