aboutsummaryrefslogtreecommitdiff
path: root/src/test/base32_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/base32_tests.cpp
parentd648b5120b2fefa9e599898bd26f05ecf4428fac (diff)
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/base32_tests.cpp')
-rw-r--r--src/test/base32_tests.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/base32_tests.cpp b/src/test/base32_tests.cpp
index 5fab7f0d1e..8a44e65165 100644
--- a/src/test/base32_tests.cpp
+++ b/src/test/base32_tests.cpp
@@ -22,7 +22,9 @@ BOOST_AUTO_TEST_CASE(base32_testvectors)
BOOST_CHECK_EQUAL(strEnc, vstrOut[i]);
strEnc = EncodeBase32(vstrIn[i], false);
BOOST_CHECK_EQUAL(strEnc, vstrOutNoPadding[i]);
- std::string strDec = DecodeBase32(vstrOut[i]);
+ bool invalid;
+ std::string strDec = DecodeBase32(vstrOut[i], &invalid);
+ BOOST_CHECK(!invalid);
BOOST_CHECK_EQUAL(strDec, vstrIn[i]);
}