+string test_string
+string result_string
+
if (%aka_sim_id_method("%{User-Name}") != 'AKA') {
test_fail
}
#
# 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?
#
# 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
}
#
# 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)
}
#
#
# 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)
}
#
#
# 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
}
+string test_string
+string result_string
+
if (%aka_sim_id_method(%{User-Name}) != 'AKA') {
test_fail
}
#
# 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
}
}
+string test_string
+
if (%aka_sim_id_method(%{User-Name}) != 'SIM') {
test_fail
}
#
# 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?
#
# 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
}