The rlm_eap module provides the below functions to interact with the `3GPP` and `SIM` protocols.
-### %3gpp_temporary_id_decrypt('...)
+### %3gpp_temporary_id.decrypt('...)
TODO
TODO
```
-### %3gpp_temporary_id_encrypt(...)
+### %3gpp_temporary_id.encrypt(...)
TODO
TODO
```
-### %3gpp_temporary_id_key_index(...)
+### %3gpp_temporary_id.key_index(...)
TODO
values:
- The encrypt expansions of the `rlm_cipher` module.
-- The `%3gpp_temporary_id_encrypt()` expansion.
+- The `%3gpp_temporary_id.encrypt()` expansion.
- The `%str.rand()` expansion.
NOTE: Add a `reply.Next-Pseudonym-Id` attribute in this section to
#
# The rlm_eap module provides the below functions to interact with the `3GPP` and `SIM` protocols.
#
-# ### %3gpp_temporary_id_decrypt('...)
+# ### %3gpp_temporary_id.decrypt('...)
#
# TODO
#
# TODO
# ```
#
-# ### %3gpp_temporary_id_encrypt(...)
+# ### %3gpp_temporary_id.encrypt(...)
#
# TODO
#
# TODO
# ```
#
-# ### %3gpp_temporary_id_key_index(...)
+# ### %3gpp_temporary_id.key_index(...)
#
# TODO
#
# values:
#
# - The encrypt expansions of the `rlm_cipher` module.
- # - The `%3gpp_temporary_id_encrypt()` expansion.
+ # - The `%3gpp_temporary_id.encrypt()` expansion.
# - The `%str.rand()` expansion.
#
# NOTE: Add a `reply.Next-Pseudonym-Id` attribute in this section to
/** Returns the key index from a 3gpp temporary id
*
@verbatim
-%3gpp_temporary_id_key_index(%{id_attr})
+%3gpp_temporary_id.key_index(%{id_attr})
@endverbatim
*
* @ingroup xlat_functions
/** Decrypt a 3gpp temporary id
*
@verbatim
- %3gpp_temporary_id_decrypt(<id> <key>)
+ %3gpp_temporary_id.decrypt(<id> <key>)
@endverbatim
*
* The pseudonym is in the format
/** Encrypts a 3gpp pseudonym
*
@verbatim
-%3gpp_temporary_id_encrypt(<id>, <key>, <index>, [(pseudonym|fastauth)])
+%3gpp_temporary_id.encrypt(<id>, <key>, <index>, [(pseudonym|fastauth)])
@endverbatim
*
* @ingroup xlat_functions
xlat_func_args_set(xlat, aka_sim_xlat_id_type_xlat_args);
if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id_key_index", aka_sim_id_3gpp_temporary_id_key_index_xlat, FR_TYPE_UINT8)) == NULL)) return -1;
xlat_func_args_set(xlat, aka_sim_id_3gpp_temporary_id_key_index_xlat_args);
+ if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id.key_index", aka_sim_id_3gpp_temporary_id_key_index_xlat, FR_TYPE_UINT8)) == NULL)) return -1;
+ xlat_func_args_set(xlat, aka_sim_id_3gpp_temporary_id_key_index_xlat_args);
+
if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id_decrypt", aka_sim_3gpp_temporary_id_decrypt_xlat, FR_TYPE_STRING)) == NULL)) return -1;
xlat_func_args_set(xlat, aka_sim_3gpp_temporary_id_decrypt_xlat_args);
+
+ if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id.decrypt", aka_sim_3gpp_temporary_id_decrypt_xlat, FR_TYPE_STRING)) == NULL)) return -1;
+ xlat_func_args_set(xlat, aka_sim_3gpp_temporary_id_decrypt_xlat_args);
+
if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id_encrypt", aka_sim_3gpp_temporary_id_encrypt_xlat, FR_TYPE_STRING)) == NULL)) return -1;
xlat_func_args_set(xlat, aka_sim_3gpp_temporary_id_encrypt_xlat_args);
+ if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id.encrypt", aka_sim_3gpp_temporary_id_encrypt_xlat, FR_TYPE_STRING)) == NULL)) return -1;
+ xlat_func_args_set(xlat, aka_sim_3gpp_temporary_id_encrypt_xlat_args);
+
aka_sim_xlat_refs = 1;
return 0;
}
delay delay_10s {
- delay = 10
+ delay = "%{10 + Tmp-String-0}"
}
#
#
# PRE: timeout
#
+Tmp-String-0 := "xxx"
+
#
# @todo - we have to add a leading '0' here, otherwise cf_file.c complains
# Encrypt the permanent ID
#
test_string := '1420032219455258'
-control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{test_string},6)
+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}, %{test_string}, 6) != '') {
+if (%3gpp_temporary_id.encrypt(%{control.User-Name}, %{test_string}, 6) != '') {
test_fail
}
#
# 0.5 - Get the original IMSI back again
#
-result_string := %3gpp_temporary_id_decrypt(%{control.User-Name},%{test_string})
+result_string := %3gpp_temporary_id.decrypt(%{control.User-Name},%{test_string})
if (result_string != User-Name) {
test_fail
#
test_string := '1420032219455259'
control += {
- User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]}, %{test_string}, 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]},%{test_string},6) != '') {
+if (%3gpp_temporary_id.encrypt(%{control.User-Name[1]},%{test_string},6) != '') {
test_fail
}
#
# 1.4 - Get the original IMSI back again
#
-result_string := %3gpp_temporary_id_decrypt(%{control.User-Name[1]},%{test_string})
+result_string := %3gpp_temporary_id.decrypt(%{control.User-Name[1]},%{test_string})
if (result_string != "0%{User-Name[1]}") {
test_fail
#
test_string := '1420032219455259'
control += {
- User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{test_string},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]}, %{test_string}, 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
#
-result_string := %3gpp_temporary_id_decrypt(%{control.User-Name[2]}, %{test_string})
+result_string := %3gpp_temporary_id.decrypt(%{control.User-Name[2]}, %{test_string})
if (result_string != "0%{User-Name[1]}") {
test_fail
# 1.1 - Encrypt the permanent ID
#
test_string := '1420032219455259'
-control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{test_string},6)
+control.User-Name := %3gpp_temporary_id.encrypt(%{User-Name},%{test_string},6)
#
# 1.2 - Get the original IMSI back again sans tag
#
-result_string := %3gpp_temporary_id_decrypt(%{control.User-Name}, %{test_string}, 'false')
+result_string := %3gpp_temporary_id.decrypt(%{control.User-Name}, %{test_string}, 'false')
if ("%{User-Name}" =~ /^0(.*)/) {
if (!result_string || (result_string == '') || (%{result_string} != "%{1}")) {
# Encrypt the permanent ID
#
test_string := '1234567812345678'
-control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{test_string},6)
+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},%{test_string},6) {
+if %3gpp_temporary_id.encrypt(%{control.User-Name},%{test_string},6) {
test_fail
}