]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more convert to new function syntax
authorAlan T. DeKok <aland@freeradius.org>
Thu, 23 Nov 2023 12:42:30 +0000 (07:42 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 23 Nov 2023 12:46:40 +0000 (07:46 -0500)
15 files changed:
src/tests/auth/chap
src/tests/auth/chap_header
src/tests/eapol_test/config/aka-prime/sites-enabled/aka-prime
src/tests/eapol_test/config/aka/sites-enabled/aka
src/tests/eapol_test/config/sim/sites-enabled/sim
src/tests/keywords/md5-error
src/tests/keywords/pap
src/tests/keywords/pap-ssha2
src/tests/keywords/sha1-error
src/tests/keywords/timeout
src/tests/keywords/xlat-alternation-fail-then-func
src/tests/keywords/xlat-delay
src/tests/modules/always/set_rcode.unlang
src/tests/modules/always/set_status_dead.unlang
src/tests/modules/always/set_status_revive.unlang

index 9f53bed3fb4b067675082a834b38982741b429a4..f0b1f9c63ff7b6f0d4c0e5ec1aa9fe16f239fafa 100644 (file)
@@ -5,4 +5,4 @@
 #
 #  Set CHAP-Password
 #
-&CHAP-Password := "%(chap.password:%{CHAP-Password})"
+&CHAP-Password := %chap.password("%{CHAP-Password}")
index ec3e4507bed73fc00e2c96f3c9a5f8ad9c7ef830..c8d5a0856a6467b7009e53160e5a5e261569ada8 100644 (file)
@@ -8,4 +8,4 @@
 #
 #  Set CHAP-Password
 #
-&request.CHAP-Password := %(chap.password:%{request.CHAP-Password})
+&request.CHAP-Password := %chap.password("%{request.CHAP-Password}")
index a7580d9f5ba5959b9908d9f6ee21ebed1d903d3c..e4ccb177dc4f45411f80b24b808e8fe0de98eaed 100644 (file)
@@ -6,7 +6,7 @@ server eap-aka-prime {
        }
 
        recv Identity-Response {
-               "%(debug_attr:&session-state.)"
+#              %debug_attr(&session-state.)
                if (!&session-state.Tmp-String-0) {
                        &reply.Any-ID-Req := yes
                        &session-state.Tmp-String-0 := yes
index c5d03e6202e21b8ff0a161f6e6e9fe7db6cd8b42..213b45c51b2a61680eaa27e6478806e82d82dcb7 100644 (file)
@@ -7,7 +7,7 @@ server eap-aka {
        }
 
        recv Identity-Response {
-               "%(debug_attr:&session-state.)"
+#              %debug_attr(&session-state.)
                if (!&session-state.Tmp-String-0) {
                        &reply.Any-ID-Req := yes
                        &session-state.Tmp-String-0 := yes
index 8028affe7f3cb9feac6c90fdab3a8a5762636220..9bcf302fa805277b13713a1900fc4a3f95f52fa4 100644 (file)
@@ -2,7 +2,7 @@ server eap-sim {
        namespace = eap-sim
 
        recv Identity-Response {
-               "%(debug_attr:&session-state.)"
+#              %debug_attr(&session-state.)
                if (!&session-state.Tmp-String-0) {
                        &reply.Any-ID-Req := yes
                        &session-state.Tmp-String-0 := yes
index f04f980ea8b25e6d374d5df4a2f5bd76e1e8abba..309f4a7f575c0612094b161faf5bc05b9fa6f0f0 100644 (file)
@@ -7,6 +7,8 @@
 #
 #  MD5 HMAC with missing key should fail
 #
-&Tmp-Octets-1 := "%(hmacmd5:%{Tmp-String-1} )" # ERROR
-
-test_fail
+&Tmp-Octets-1 := %hmacmd5(%{Tmp-String-1}, )
+if &Tmp-Octets-1 {
+       test_fail
+}
+success
index 205c25c0bd0aaff0539eaf20e4e0cb3b41ed33b7..9e802bb1a9405cc94467dae3aa81129bfb8e0284 100644 (file)
@@ -24,7 +24,7 @@ if (reject) {
 #
 &Tmp-String-1 := "{clear}%{User-Password}"
 &control := {
-       &Password.With-Header = "%(base64.encode:%{Tmp-String-1})"
+       &Password.With-Header = %base64.encode(%{Tmp-String-1})
 }
 
 pap.authorize
index 74c3bf85069c84c837bc4d039b5381ed729b5f27..0919ac7d467628b57d7a98b8a3933f2c2210dc1b 100644 (file)
@@ -68,7 +68,7 @@ if (reject) {
 &control.Tmp-Octets-0 := "%bin(%{control.Tmp-String-1})"
 
 # To Base64
-&control.Tmp-String-1 := "{ssha512}%(base64.encode:%{control.Tmp-Octets-0})"
+&control.Tmp-String-1 := "{ssha512}%base64.encode(%{control.Tmp-Octets-0})"
 
 &control += {
        &Password.With-Header = "%base64.encode(%{control.Tmp-String-1})"
index 828ffb5837cb08a5dc57e9f4180e6826521df699..ed54f99c37753c05fa8e11ba122f0f3d9fc5f989 100644 (file)
@@ -3,7 +3,8 @@
 #
 #  SHA1 HMAC with missing key should fail
 #
-&Tmp-Octets-1 := "%(hmacsha1:%{Tmp-String-1} )" # ERROR
-
-
-test_fail
+&Tmp-Octets-1 := %hmacsha1(%{Tmp-String-1}, ) # ERROR
+if &Tmp-Octets-1 {
+       test_fail
+}
+success
index 278860f1490b0864bf78f32efbef6cd8e9dd07e9..54b1e2d4b891c85c7ab26300c3cdc8350133f1f1 100644 (file)
@@ -7,7 +7,7 @@
 #
 redundant {
        timeout 0.01s {
-               &Tmp-Float-0 := "%(delay_10s:0.1)"
+               &Tmp-Float-0 := %delay_10s(0.1)
                test_fail
        }
 
@@ -18,7 +18,7 @@ redundant {
 
 redundant {
        timeout "0.01" {
-               &Tmp-Float-0 := "%(delay_10s:0.1)"
+               &Tmp-Float-0 := %delay_10s(0.1)
                test_fail
        }
 
index 4729389a05af9c8815e61da0dfb94bb99746c2c1..a4acb78f349f321ba113dbca9505c7772d090757 100644 (file)
@@ -4,6 +4,6 @@
 &request -= &Tmp-String-0[*]
 &request -= &Tmp-String-1[*]
 
-&Tmp-String-2 := "%{&Tmp-String-0[0] || &Tmp-String-1[0]}%(delay_10s:)"
+&Tmp-String-2 := "%{&Tmp-String-0[0] || &Tmp-String-1[0]}%delay_10s()"
 
 success
index abeb73cbf1fe2f4e2586e66b844f7f7c993b758e..bd6ff59fdf47ebd97f33096917f7b4b0697cf058 100644 (file)
@@ -4,9 +4,9 @@
 
 # This is mainly a smoke test... i.e. if it crashes there's smoke
 
-"%(delay_10s:)"        # Should 'blip' the request
+%delay_10s()   # Should 'blip' the request
 
-&Tmp-Float-0 := "%(delay_10s:0.1)"
+&Tmp-Float-0 := %delay_10s(0.1)
 if (!&Tmp-Float-0) {
        fail
 }
index 977157727d98a68a8fb70747f518b4ac2879e7ad..f6807490f445693cd198a82d5a87de7d9ddbbdc8 100644 (file)
@@ -1,9 +1,9 @@
 #
 #  Set status to "notfound". xlat should expand to previous status, "alive"
 #
-if ("%(db_status:notfound)" != "alive") {
+if (%db_status('notfound') != "alive") {
        &reply += {
-               &Reply-Message = "Failure in test at line %(interpreter:...line)"
+               &Reply-Message = "Failure in test at line %interpreter(...line)"
        }
 }
 
@@ -13,7 +13,7 @@ if ("%(db_status:notfound)" != "alive") {
 db_status
 if (!notfound) {
        &reply += {
-               &Reply-Message = "Failure in test at line %(interpreter:...line)"
+               &Reply-Message = "Failure in test at line %interpreter(...line)"
        }
 }
 
@@ -21,9 +21,9 @@ if (!notfound) {
 #
 #  Fetch status using xlat without setting the status
 #
-if ("%(db_status:)" != "notfound") {
+if (%db_status() != "notfound") {
        &reply += {
-               &Reply-Message = "Failure in test at line %(interpreter:...line)"
+               &Reply-Message = "Failure in test at line %interpreter(...line)"
        }
 }
 
index 99dbd5f450dd53c18adf1485f53d6f32f9073748..bf8a2392dc75aee5d8b60dacaa91bd89dafa61b4 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Set the module status to dead, call it and check that it fails
 #
-%(db_status:fail)
+%db_status('fail')
 
 db_status {
        fail = 1
index 03af845236fdb67aeb152fdfd994a398e757f000..a8ec38d5230fc2b2746d642722cae178cbadbadd 100644 (file)
@@ -1,13 +1,13 @@
 #
 #  Fail a module...
 #
-%(db_status:fail)
+%db_status('fail')
 db_status {
        fail = 1
 }
 if (!fail) {
        &reply += {
-               &Reply-Message = "Failure in test at line %(interpreter:...line)"
+               &Reply-Message = "Failure in test at line %interpreter(...line)"
        }
 }
 
@@ -15,7 +15,7 @@ if (!fail) {
 #
 #  ... Now revive it
 #
-%(db_status:alive)
+%db_status('alive')
 db_status
 if (ok) {
        &reply += {