From 50b37d4a27d3295a29afca2286f1a5a086142cec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:49:46 +0200 Subject: Adding upstream version 3.2.1+dfsg. Signed-off-by: Daniel Baumann --- src/tests/keywords/escape | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/tests/keywords/escape (limited to 'src/tests/keywords/escape') diff --git a/src/tests/keywords/escape b/src/tests/keywords/escape new file mode 100644 index 0000000..5d0b3bc --- /dev/null +++ b/src/tests/keywords/escape @@ -0,0 +1,67 @@ +# +# PRE: update if xlat-attr-index +# +update request { + control:Cleartext-Password := 'hello' + reply:Filter-Id := "filter" + + Tmp-String-0 := '@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /' + Tmp-String-1 := '±§#$%^&+={[}];<,>?`|"' + Tmp-String-2 := '™¥¤' + Tmp-String-3 := '=C2=B1=C2=A7=23=24=25=5E=26=2B=3D=7B=5B=7D=5D=3B=3C=2C=3E=3F=60=7C=22' + Tmp-String-4 := '=E2=84=A2=C2=A5=C2=A4' + Tmp-String-5 := '=40=61=62=63=64=65=66=67' + + # Mixture of safe and unsafe chars + Tmp-String-6 := 'ŒČÿ' + Tmp-String-7 := 'Œ=C4=8Cÿ' +} + +if ("%{escape:%{request:Tmp-String-0}}" != &Tmp-String-0) { + update reply { + Filter-Id += 'Fail 1' + } +} + +if ("%{escape:%{request:Tmp-String-1}}" != &Tmp-String-3) { + update reply { + Filter-Id += 'Fail 2' + } +} + +if ("%{escape:%{request:Tmp-String-2}}" != &Tmp-String-4) { + update reply { + Filter-Id += 'Fail 3' + } +} + +if ("%{unescape:%{request:Tmp-String-0}}" != &Tmp-String-0) { + update reply { + Filter-Id += 'Fail 4' + } +} + +if ("%{unescape:%{request:Tmp-String-3}}" != "%{Tmp-String-1}") { + update reply { + Filter-Id += 'Fail 5' + } +} + +if ("%{unescape:%{request:Tmp-String-4}}" != &Tmp-String-2) { + update reply { + Filter-Id += 'Fail 6' + } +} + +if ("%{escape:%{request:Tmp-String-6}}" != &Tmp-String-7) { + update reply { + Filter-Id += 'Fail 7' + } +} + +if ("%{unescape:%{request:Tmp-String-7}}" != &Tmp-String-6) { + update reply { + Filter-Id += 'Fail 8' + } +} + -- cgit v1.2.3