aboutsummaryrefslogtreecommitdiff
path: root/src/test/base64_tests.cpp
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/test/base64_tests.cpp
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/test/base64_tests.cpp')
-rw-r--r--src/test/base64_tests.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/base64_tests.cpp b/src/test/base64_tests.cpp
index 6ee1b83691..04b5185653 100644
--- a/src/test/base64_tests.cpp
+++ b/src/test/base64_tests.cpp
@@ -19,7 +19,9 @@ BOOST_AUTO_TEST_CASE(base64_testvectors)
{
std::string strEnc = EncodeBase64(vstrIn[i]);
BOOST_CHECK_EQUAL(strEnc, vstrOut[i]);
- std::string strDec = DecodeBase64(strEnc);
+ bool invalid;
+ std::string strDec = DecodeBase64(strEnc, &invalid);
+ BOOST_CHECK(!invalid);
BOOST_CHECK_EQUAL(strDec, vstrIn[i]);
}