]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove Tmp- attributes from eap_sim module tests
authorNick Porter <nick@portercomputing.co.uk>
Mon, 8 Jan 2024 11:45:19 +0000 (11:45 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 8 Jan 2024 11:45:19 +0000 (11:45 +0000)
src/tests/modules/eap_sim/sim_xlat_id_aka.unlang
src/tests/modules/eap_sim/sim_xlat_id_aka_decrypt_no_tag.unlang
src/tests/modules/eap_sim/sim_xlat_id_sim.unlang

index 569b7526cb56a69416dbd6be3601e8eae977fc39..7459ab9f9a7ddc0be25c7ab4a0fcd07c98dd22e8 100644 (file)
@@ -1,3 +1,6 @@
+string test_string
+string result_string
+
 if (%aka_sim_id_method("%{User-Name}") != 'AKA') {
        test_fail
 }
@@ -9,8 +12,8 @@ if (%aka_sim_id_type("%{User-Name}") != 'permanent') {
 #
 #  Encrypt the permanent ID
 #
-&control.Tmp-String-0 := '1420032219455258'
-&control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{control.Tmp-String-0},6)
+&test_string := '1420032219455258'
+&control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{test_string},6)
 
 #
 #  0.2 - Can we get the EAP method from the encrypted blob correctly?
@@ -29,16 +32,16 @@ if (%aka_sim_id_type("%{control.User-Name}") != 'pseudonym') {
 #
 #  0.4 - We should refuse to re-encrypt an encrypted NAI
 #
-if ("%3gpp_temporary_id_encrypt(%{control.User-Name},%{control.Tmp-String-0},6)" != '') {
+if ("%3gpp_temporary_id_encrypt(%{control.User-Name},%{test_string},6)" != '') {
        test_fail
 }
 
 #
 #  0.5 - Get the original IMSI back again
 #
-&control.Tmp-String-1 := %3gpp_temporary_id_decrypt(%{control.User-Name},%{control.Tmp-String-0})
+&result_string := %3gpp_temporary_id_decrypt(%{control.User-Name},%{test_string})
 
-if (&control.Tmp-String-1 != &User-Name) {
+if (&result_string != &User-Name) {
        test_fail
 }
 
@@ -55,9 +58,9 @@ if (&User-Name =~ /^[0-9](.*)/) {
 #
 #  1.1 - Encrypt the permanent ID
 #
-&control.Tmp-String-0 := '1420032219455259'
+&test_string := '1420032219455259'
 &control += {
-       &User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{control.Tmp-String-0},6)
+       &User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{test_string},6)
 }
 
 #
@@ -70,25 +73,25 @@ if (%aka_sim_id_type("%{control.User-Name[1]}") != 'pseudonym') {
 #
 #  1.3 - We should refuse to re-encrypt an encrypted NAI
 #
-if ("%3gpp_temporary_id_encrypt(%{control.User-Name[1]},%{control.Tmp-String-0},6)" != '') {
+if ("%3gpp_temporary_id_encrypt(%{control.User-Name[1]},%{test_string},6)" != '') {
        test_fail
 }
 
 #
 #  1.4 - Get the original IMSI back again
 #
-&control.Tmp-String-1 := %3gpp_temporary_id_decrypt(%{control.User-Name[1]},%{control.Tmp-String-0})
+&result_string := %3gpp_temporary_id_decrypt(%{control.User-Name[1]},%{test_string})
 
-if (&control.Tmp-String-1 != "0%{User-Name[1]}") {
+if (&result_string != "0%{User-Name[1]}") {
        test_fail
 }
 
 #
 #  2.1 - Encrypt the permanent ID for fastauth
 #
-&control.Tmp-String-0 := '1420032219455259'
+&test_string := '1420032219455259'
 &control += {
-       &User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{control.Tmp-String-0},6,fastauth)
+       &User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{test_string},6,fastauth)
 }
 
 #
@@ -101,16 +104,16 @@ if (%aka_sim_id_type("%{control.User-Name[2]}") != 'fastauth') {
 #
 #  2.3 - We should refuse to re-encrypt an encrypted NAI
 #
-if ("%3gpp_temporary_id_encrypt(%{control.User-Name[2]},%{control.Tmp-String-0},6,fastauth)" != '') {
+if ("%3gpp_temporary_id_encrypt(%{control.User-Name[2]},%{test_string},6,fastauth)" != '') {
        test_fail
 }
 
 #
 #  2.4 - Get the original IMSI back again
 #
-&control.Tmp-String-1 := %3gpp_temporary_id_decrypt(%{control.User-Name[2]},%{control.Tmp-String-0})
+&result_string := %3gpp_temporary_id_decrypt(%{control.User-Name[2]},%{test_string})
 
-if (&control.Tmp-String-1 != "0%{User-Name[1]}") {
+if (&result_string != "0%{User-Name[1]}") {
        test_fail
 }
 
index 43d8c746d448c9eeb483d07fd8750baef6e2ac49..fdfc88a45314b8d1d9bbd85a64fc2ab190b0501b 100644 (file)
@@ -1,3 +1,6 @@
+string test_string
+string result_string
+
 if (%aka_sim_id_method(%{User-Name}) != 'AKA') {
        test_fail
 }
@@ -9,16 +12,16 @@ if (%aka_sim_id_type(%{User-Name}) != 'permanent') {
 #
 #  1.1 - Encrypt the permanent ID
 #
-&control.Tmp-String-0 := '1420032219455259'
-&control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{control.Tmp-String-0},6)
+&test_string := '1420032219455259'
+&control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{test_string},6)
 
 #
 #  1.2 - Get the original IMSI back again sans tag
 #
-&control.Tmp-String-1 := %3gpp_temporary_id_decrypt(%{control.User-Name}, %{control.Tmp-String-0}, 'false')
+&result_string := %3gpp_temporary_id_decrypt(%{control.User-Name}, %{test_string}, 'false')
 
 if ("%{User-Name}" =~ /^0(.*)/) {
-       if (!&control.Tmp-String-1 || (&control.Tmp-String-1 == '') || (%{control.Tmp-String-1} != "%{1}")) {
+       if (!&result_string || (&result_string == '') || (%{result_string} != "%{1}")) {
                test_fail
        }
 }
index 4c99d918a43b7eb20632e3a239a672974dbbe539..03bf88b6d465a9d235ab35fbaa8d9c52e735d221 100644 (file)
@@ -1,3 +1,5 @@
+string test_string
+
 if (%aka_sim_id_method(%{User-Name}) != 'SIM') {
        test_fail
 }
@@ -9,8 +11,8 @@ if (%aka_sim_id_type(%{User-Name}) != 'permanent') {
 #
 #  Encrypt the permanent ID
 #
-&control.Tmp-String-0 := '1234567812345678'
-&control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{control.Tmp-String-0},6)
+&test_string := '1234567812345678'
+&control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{test_string},6)
 
 #
 #  Can we get the EAP method from the encrypted blob correctly?
@@ -29,7 +31,7 @@ if (%aka_sim_id_type(%{control.User-Name}) != 'pseudonym') {
 #
 #  We should refuse to re-encrypt an encrypted NAI
 #
-if %3gpp_temporary_id_encrypt(%{control.User-Name},%{control.Tmp-String-0},6) {
+if %3gpp_temporary_id_encrypt(%{control.User-Name},%{test_string},6) {
        test_fail
 }