Tmp-String-1 := "%{request:3GPP-IMSI}"
}
-update reply {
- Filter-Id := "filter"
-}
\ No newline at end of file
+success
# Static if condition
#
if (1) {
- update reply {
- Filter-Id := "filter"
- }
-
#
# We're not running the 'pap' module, so
# we have to set this ourselves.
# Static if condition
#
if (1) {
- update reply {
- Filter-Id := "filter"
- }
+ success
#
# We're not running the 'pap' module, so
#
# Tests for dereferencing the Nth attribute
#
-update reply {
- Filter-Id := "filter"
-}
-
update request {
Class := 0x01020304
Class += 0x05060708
Filter-Id += "fail 4"
}
}
+
+success
#
# PRE: hex
#
-update reply {
- Filter-Id := "filter"
-}
-
update request {
Tmp-String-0 := '9870'
Tmp-Octets-0 := 0x39383731
Filter-Id += 'fail 12'
}
}
+
+success
Cleartext-Password := 'hello'
}
-update reply {
- Filter-Id := "filter"
-}
-
if (User-Name == "bob") {
break # ERROR
}
# PRE: switch
#
-update reply {
- Filter-Id := "filter"
-}
-
switch &reply:Filter-Id {
# deliberately empty
case "filter" {
}
case {
- update reply {
- Filter-Id := "default"
- }
+ success
}
}
switch &Filter-Id {
case "" {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
case "doug" {
}
if (<byte>Class == 173) {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
if (<byte>Class < 173) {
}
if (<integer>Class == 257) {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
if (<integer>Class < 256) {
}
if (<short>Class == 257) {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
if (<short>Class < 256) {
# Check attribute references
#
if (Called-Station-Id == &Calling-Station-Id) {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
#
# PRE: update
#
-update reply {
- Filter-Id := "filter"
-}
update control {
Cleartext-Password := 'hello'
}
Filter-Id += "fail"
}
}
+
+success
Cleartext-Password := 'hello'
}
-update reply {
- Filter-Id := "filter"
-}
-
update request {
Tmp-String-0 := &reply:Filter-Id[#] # ERROR
}
#
if (&User-Name == 'bob') {
- update reply {
- Filter-Id := "filter"
- }
+ ok
}
else { # ERROR
# empty is not allowed
# "else" has to be preceded by an "if" or "elsif"
#
if (1) {
- update reply {
- Filter-Id := "filter"
+ update control {
+ Cleartext-Password := "fail"
}
else { # ERROR
#
update request {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := "filter"
Tmp-String-0 := '@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /'
Tmp-String-1 := '±§#$%^&+={[}];<,>?`|"'
}
}
+success
Tmp-String-2 := 'i have scary embedded things\000 inside me'
Tmp-String-2 += "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°"
-
- reply:Filter-Id := "filter"
}
Filter-Id += 'fail 9'
}
}
+
+success
Cleartext-Password := 'hello'
}
-update reply {
- Filter-Id := "filter"
-}
-
#
# Simple
#
}
}
+success
update request {
Called-Station-Id := "%{1}"
}
- update reply {
- Filter-Id := "filter"
- }
-
+ success
break
}
elsif ("%{Foreach-Variable-0}" == '9') {
foreach &control:Calling-Station-Id {
if (&request:Calling-Station-Id == "%{Foreach-Variable-0}") {
- update reply {
- Filter-Id := "filter"
- }
-
+ success
break
}
elsif ("%{Foreach-Variable-0}" == '9') {
foreach &control:Calling-Station-Id {
if (&request:Calling-Station-Id == "%{Foreach-Variable-0}") {
- update reply {
- Filter-Id := "filter"
- }
-
+ success
break
}
elsif ("%{Foreach-Variable-0}" == '9') {
#
update {
- &reply:Filter-Id := 'filter'
&control:Tmp-String-0 := '0'
&control:Tmp-String-0 += '1'
&control:Tmp-String-0 += '2'
Filter-Id += 'Fail 2'
}
}
+
+success
foreach &Filter-Id {
if ("%{Foreach-Variable-0}" == "3") {
- update reply {
- Filter-Id := "filter"
- }
+ success
#
# We need this because the "return" below
update {
control:Tmp-String-0 := "ssid=ABCDEF"
control:Tmp-String-0 += "ssid=GHIJKL"
- reply:Filter-Id := "filter"
}
if (User-Name) {
update control {
Tmp-String-1 !* ANY
}
+
+success
#
# PRE: update
#
-update reply {
- Filter-Id := "filter"
-}
-
update request {
Tmp-String-0 := '9870'
Tmp-Octets-0 := 0x39383731
Filter-Id += 'fail 14'
}
}
+
+success
# Static if condition
#
if (1) {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
# Matching "if" conditions
#
if (User-Name == "bob") {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
if (User-Name != "bob") {
update reply {
Filter-Id := "not bob"
}
-}
\ No newline at end of file
+}
}
}
else {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
}
}
elsif (User-Name == "bob") {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
else {
update reply {
# we allow empty 'elsif' conditions
}
-update reply {
- Filter-Id := "filter"
-}
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update request {
Filter-Id += 'fail 16'
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
#
Filter-Id += 'fail 2'
}
}
+
+success
# return code in an "if" section.
#
if (User-Name == "bob") {
- update reply {
- Filter-Id := "filter"
- }
+ success
ok = reject # ERROR
}
# This should parse
#
if (&User-Name =~ /%{User-Name}/) {
- update reply {
- Filter-Id := "filter"
- }
+ ok
}
#
# Check regexes which refer to unknown attributes
#
if (&User-Name =~ /%{What-The-Heck-Is-This-Thing}/) { # ERROR
- update reply {
- Filter-Id := "filter"
- }
+ ok
}
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
if (control:Cleartext-Password !~ /hell(o)(.*)/) {
Filter-Id += 'Fail 5'
}
}
+
+success
# Check that bad regular expressions will fail
#
if (&User-Name =~ /[a-3]/) { # ERROR
- update reply {
- Filter-Id := "filter"
- }
+ ok
}
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update request {
Filter-Id += 'Fail 2'
}
}
+
+success
no-such-module
}
-update reply {
- Filter-Id := "filter"
-}
+success
#
# PRE: update
#
-update reply {
- Filter-Id := "filter"
-}
-
update request {
Tmp-String-0 := '9870'
Tmp-String-1 := '98709870'
}
}
-
-
-
+success
#
update control {
Cleartext-Password := 'hello'
- reply:Filter-Id := "filter"
}
update request {
Filter-Id += "fail 5"
}
}
+
+success
#
update control {
Cleartext-Password := 'hello'
- reply:Filter-Id := "filter"
}
#
Filter-Id := "filter"
}
}
-}
\ No newline at end of file
+}
+
+success
Cleartext-Password := 'hello'
}
-update reply {
- Filter-Id := "filter"
-}
-
update control {
Tmp-Cast-IPv4Prefix := 198.51.100.255/16
Tmp-Cast-IPv6Prefix := ::198.51.100.255/112
Filter-Id += "Fail 5"
}
}
+
+success
#
# PRE: hex
#
-update reply {
- Filter-Id := "filter"
-}
-
update request {
Tmp-String-0 := '\
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\
Filter-Id += 'fail 15'
}
}
+
+success
}
}
else {
- update reply {
- Filter-Id := 'filter'
- }
+ success
}
Cleartext-Password := 'hello'
}
-update reply {
- Filter-Id := "filter"
-}
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := "filter"
}
update {
Filter-Id += 'Fail 1'
}
}
+
+success
#
# PRE: update if
#
-update reply {
- Filter-Id := "filter"
-}
-
update {
control:Cleartext-Password := 'hello'
request:Tmp-String-0 := "This is a string\n"
Filter-Id += 'fail 6'
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
test
Filter-Id += 'Fail 4'
}
}
+
+success
return
}
-update reply {
- Filter-Id := "filter"
-}
-
+success
request:Tmp-Octets-0 := 0x000504030201
request:Tmp-Integer-0 := 7331
request:Tunnel-Private-Group-Id:5 = 127.0.0.1
- reply:Filter-Id = 'filter'
}
if ("%{pairs:request:[*]}" != "User-Name = \"bob\", User-Password = \"hello\", Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331, Tunnel-Private-Group-Id:5 = \"127.0.0.1\"") {
Filter-Id += 'fail 5'
}
}
+
+success
# PRE: update if
#
update {
- reply:Filter-Id := 'filter'
control: !* ANY
request:Tmp-String-0 := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK" # 60 byte salt
}
update control {
Auth-Type := Accept
}
+
+success
}
update {
- reply:Filter-Id := 'filter'
control: !* ANY
request:Tmp-String-0 := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK" # 60 byte salt
}
update control {
Auth-Type := Accept
}
+
+success
}
group {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
}
}
}
else {
- update reply {
- Filter-Id := 'filter'
- }
+ success
}
}
if (noop || (&Tmp-Integer-0 == 4294967295)) {
- update reply {
- Filter-Id := "filter"
- }
+ success
} else {
fail
}
return
}
-update reply {
- Filter-Id := "filter"
-}
\ No newline at end of file
+success
}
}
else {
- update reply {
- Filter-Id := "filter"
- }
-}
\ No newline at end of file
+ success
+}
Filter-Id := "fail 1"
}
} else {
- update reply {
- Filter-Id := "filter"
- }
-}
\ No newline at end of file
+ success
+}
}
if (User-Name == "bob") {
- update reply {
- Filter-Id := "filter"
- }
+ success
#
# We need this because the "return" below
}
if (User-Name == "bob") {
- update reply {
- Filter-Id := "filter"
- }
+ ok
#
# We need this because the "return" below
request:Tmp-String-2 := "Jefe"
}
-update reply {
- Filter-Id := 'filter'
-}
-
#
# Put "This is a string" into a file and call "sha1sum" on it.
# You should get this string.
Filter-Id += 'fail 6'
}
}
+
+success
request:Tmp-Octets-0 := 0x000504030201
}
-update reply {
- Filter-Id := 'filter'
-}
-
#
# Put "This is a string" into a file and call "sha256sum" on it.
# You should get this string.
Filter-Id := 'filter'
}
}
+
+success
#
# This gives the game away.
#
-update { control:Cleartext-Password := 'hello', reply:Filter-Id := "filter" }
+update { control:Cleartext-Password := 'hello', request:Reply-Message := "foo" }
+
+success
# %{string:...} is explicitly not binary safe
#
if ("%{string:Tmp-String-0}" == "this") {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
switch &User-Name {
case "bob" {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
case "doug" {
# and then that compared to the input Service-Type
#
case &Filter-Id {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
case {
#
switch &User-Name {
case &Tmp-String-0 {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
case "bob" {
}
case {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
-}
\ No newline at end of file
+}
switch "%{tolower:%{request:Tmp-String-0}}" {
case 'foo' {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
case '' {
}
}
else {
- update reply {
- Filter-Id := "filter"
- }
-}
\ No newline at end of file
+ success
+}
#
switch &Packet-Type {
case Access-Request {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
case {
Filter-Id := "fail"
}
}
-}
\ No newline at end of file
+}
# cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-f0-9' | head -c <n>
-update reply {
- Filter-Id := "filter"
-}
-
# 8192 - 0x (2) - '' (2) there are unlikely to be any static buffers this big outside of the conffile parser
update request {
Tmp-Octets-0 := '0x\
}
# We can't do any more until all the xlat code uses dynamically allocated buffers
+success
Cleartext-Password := 'hello'
}
-update reply {
- Filter-Id := "filter"
-}
-
update request {
FreeRADIUS-Proxied-To := 127.0.0.2
}
update reply {
Filter-Id += 'Fail 9'
}
-}
\ No newline at end of file
+}
+
+success
Cleartext-Password := 'hello'
}
-update reply {
- Filter-Id := "filter"
-}
+success
#
update request {
- reply:Filter-Id := "filter"
Class := 0x01020304
Class += 0x05060708
Class += 0x090a0b0c
Filter-Id += "fail 4b"
}
}
+
+success
#
update request {
- reply:Filter-Id := "filter"
request:Tunnel-Server-Endpoint += '192.0.1.1'
request:Tunnel-Server-Endpoint += '192.0.1.2'
request:Tunnel-Server-Endpoint:1 += '192.0.1.1'
Filter-Id := "fail 4"
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := "filter"
}
+
+success
}
}
-#
-# The test passes only if no test above
-# added a Filter-Id
-#
-if (!reply:Filter-Id) {
- update reply {
- Filter-Id := "filter"
- }
-}
\ No newline at end of file
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update request {
update request {
User-Password := 'hello'
}
+
+success
#
update no-such-list { # ERROR
control:Cleartext-Password := 'hello'
- reply:Filter-Id := "filter"
}
#
update {
no-such-list:Cleartext-Password := 'hello' # ERROR
- reply:Filter-Id := "filter"
}
#
update {
Service-Type := 'hello' # ERROR
- reply:Filter-Id := "filter"
}
Cleartext-Password := 'hello'
}
-update reply {
- Filter-Id := "filter"
-}
-
#
# Exec with script output to attribute
#
}
}
+success
update control {
Auth-Type := Accept
- reply:Filter-Id := 'filter'
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := "filter"
}
update {
Filter-Id += 'Fail 1'
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := "filter"
}
update {
}
}
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update {
reply:Filter-Id += 'fail 4'
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update {
Filter-Id += 'fail 6'
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update request {
update request {
User-Password := 'hello'
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update {
}
}
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update {
Filter-Id += 'fail 7'
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update request {
reply:Filter-Id += 'fail 21'
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
}
} # XXX
+
+success
request:Tmp-String-3 := '%C2%B1%C2%A7%21%40%23%24%25%5E%26%2A%28%29%2B%3D%7B%5B%7D%5D%3A%3B%22%27%7C%5C%3C%2C%3E%3F%2F%60'
request:Tmp-String-4 := '%E2%84%A2%C5%93%C2%A5%C2%A4'
- reply:Filter-ID := 'filter'
}
Filter-Id += 'Fail 6'
}
}
+
+success
}
}
else {
- update reply {
- Filter-Id := "filter"
- }
-}
\ No newline at end of file
+ success
+}
}
if (request:Packet-Type == Access-Request) {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
}
if (&Client-Shortname) {
- update reply {
- Filter-Id := "filter"
- }
+ success
}
virtual_instantiate
virtual_instantiate.post-auth
-update reply {
- Filter-Id := 'filter'
-}
+success
virtual_policy
virtual_policy.post-auth
-update reply {
- Filter-Id := 'filter'
-}
+success
}
}
-if (!reply:Filter-Id) {
- update reply {
- Filter-Id := "filter"
- }
-}
\ No newline at end of file
+success
Cleartext-Password := 'hello'
}
-update reply {
- Filter-Id := "filter"
-}
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update request {
Filter-Id += 'Fail 8'
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update request {
reply:Filter-Id += 'fail 4'
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update request {
reply:Filter-Id += 'fail 23'
}
}
+
+success
control:User-Name += '|hello|goodbye'
control:User-Name += '|morning|night|1|'
control:Reply-Message := 'Can\'t touch this'
- reply:Filter-Id = 'filter'
}
if ("%{explode:&Class |}" != 3) {
}
debug_all
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
#
reply:Filter-Id += 'fail 3'
}
}
+
+success
# PRE: if
#
-update reply {
- Filter-Id := "filter"
-}
-
if ("%{Client-Shortname}" != 'test') {
update reply {
Filter-Id += "fail 0"
Filter-Id += "fail 16"
}
}
+
+success
#
update {
control:Cleartext-Password := 'hello'
- reply:Filter-Id := 'filter'
}
update request {
Filter-Id += "fail 4"
}
}
+
+success