mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00

Base64Converter now uses a connection directly, instead of an analyzer redirecting to the underlying connection for reporting to Weird. The new built-in functions en-/decode_base64_intern make use of this to send encoding-errors to Weird instead of Reporter. According to the documentation, using the empty string as alphabet in the built-in functions, will use the default alphabet. Therefore the built-in functions can now use default arguments and en-/decode_base64_custom is deprecated. The tests have been updated accordingly.
22 lines
969 B
Text
22 lines
969 B
Text
# @TEST-EXEC: bro -b %INPUT >out
|
|
# @TEST-EXEC: btest-diff out
|
|
|
|
global default_alphabet: string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
|
|
global my_alphabet: string = "!#$%&/(),-.:;<>@[]^ `_{|}~abcdefghijklmnopqrstuvwxyz0123456789+?";
|
|
|
|
print decode_base64("YnJv");
|
|
print decode_base64("YnJv", default_alphabet);
|
|
print decode_base64("YnJv", ""); # should use default alpabet
|
|
print decode_base64("}n-v", my_alphabet);
|
|
print decode_base64_custom("YnJv", default_alphabet);
|
|
print decode_base64_custom("YnJv", ""); # should use default alpabet
|
|
print decode_base64_custom("}n-v", my_alphabet);
|
|
|
|
print decode_base64("YnJv");
|
|
print decode_base64("YnJv", default_alphabet);
|
|
print decode_base64("YnJv", ""); # should use default alpabet
|
|
print decode_base64("}n-v", my_alphabet);
|
|
print decode_base64_custom("YnJv", default_alphabet);
|
|
print decode_base64_custom("YnJv", ""); # should use default alpabet
|
|
print decode_base64_custom("}n-v", my_alphabet);
|