mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28: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.
19 lines
710 B
Text
19 lines
710 B
Text
# @TEST-EXEC: bro -b %INPUT >out
|
|
# @TEST-EXEC: btest-diff out
|
|
|
|
global default_alphabet: string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
|
|
global my_alphabet: string = "!#$%&/(),-.:;<>@[]^ `_{|}~abcdefghijklmnopqrstuvwxyz0123456789+?";
|
|
|
|
print encode_base64("bro");
|
|
print encode_base64("bro", default_alphabet);
|
|
print encode_base64("bro", ""); # should use default alpabet
|
|
print encode_base64("bro", my_alphabet);
|
|
|
|
print encode_base64_custom("bro", default_alphabet);
|
|
print encode_base64_custom("bro", ""); # should use default alpabet
|
|
print encode_base64_custom("bro", my_alphabet);
|
|
|
|
print encode_base64("padding");
|
|
print encode_base64("padding1");
|
|
print encode_base64("padding12");
|