#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/rand.h>
#include <freeradius-devel/util/sha1.h>
+#include <freeradius-devel/util/value.h>
#ifdef HAVE_OPENSSL_EVP_H
# include <freeradius-devel/tls/openssl_user_macros.h>
XLAT_ARGS(args, &in);
+ /*
+ * Pass empty arguments through
+ *
+ * FR_BASE64_DEC_LENGTH produces 2 for empty strings...
+ */
+ if (in->vb_length == 0) {
+ fr_value_box_list_remove(args, in);
+ fr_dcursor_append(out, in);
+ return XLAT_ACTION_DONE;
+ }
+
alen = FR_BASE64_DEC_LENGTH(in->vb_length);
MEM(vb = fr_value_box_alloc_null(ctx));
if (alen > 0) {
test_fail
}
+# Something weird causes this test not to parse
+# &test_octets := %base64.decode("")
+#if (!(&test_octets == "")) {
+# test_fail
+#}
+
+# Regression test, this used to crash...
&test_octets := %base64.decode(Zm9v)
if (!(&test_octets == "foo")) {
debug_request