diff options
Diffstat (limited to 'libbbot/manifest.cxx')
-rw-r--r-- | libbbot/manifest.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libbbot/manifest.cxx b/libbbot/manifest.cxx index 06399f2..02a5b05 100644 --- a/libbbot/manifest.cxx +++ b/libbbot/manifest.cxx @@ -14,6 +14,7 @@ #include <cstdint> // uint64_t #include <stdexcept> // invalid_argument +#include <libbutl/base64.hxx> #include <libbutl/utility.hxx> // digit() #include <libbutl/tab-parser.hxx> #include <libbutl/string-parser.hxx> @@ -999,7 +1000,14 @@ namespace bbot if (v.empty ()) bad_value ("empty result request challenge"); - challenge = move (v); + try + { + challenge = base64_decode (v); + } + catch (const invalid_argument&) + { + bad_value ("invalid result request challenge"); + } } else if (!iu) bad_name ("unknown name '" + n + "' in result request manifest"); @@ -1034,7 +1042,7 @@ namespace bbot s.next ("session", session); if (challenge) - s.next ("challenge", *challenge); + s.next ("challenge", base64_encode (*challenge)); s.next ("", ""); // End of manifest. |