VALUE SIM-Method-Hint Unknown 0
VALUE SIM-Method-Hint SIM 1
VALUE SIM-Method-Hint AKA 2
+VALUE SIM-Method-Hint AKA-Prime 3
ATTRIBUTE SIM-Identity-Type 1204 integer
VALUE SIM-Identity-Type Unknown 0
VALUE SIM-Identity-Type Permanent 1
VALUE SIM-Identity-Type Pseudonym 2
-VALUE SIM-Identity-Type 3GPP-Pseudonym 3
-VALUE SIM-Identity-Type Fastauth 4
+VALUE SIM-Identity-Type Fastauth 3
#
# Range: 1210-1219
* this ID or which one to start.
* @param[out] type What type of identity this is:
* - SIM_ID_TYPE_PERMANENT if the ID is an IMSI.
- * - SIM_ID_TYPE_3GPP_PSEUDONYM if the ID is a 3GPP pseudonym (not validated).
* - SIM_ID_TYPE_PSEUDONYM if the ID is a freeform pseudonym.
* - SIM_ID_TYPE_FASTAUTH if the ID is a fastauth identity.
* - SIM_ID_TYPE_UNKNOWN if we can't determine what sort of ID this is.
if (i == id_len) {
switch (id[0]) {
- case SIM_ID_TAG_PERMANENT_AKA:
- *hint = SIM_METHOD_HINT_AKA;
- *type = SIM_ID_TYPE_PERMANENT; /* All digits */
- return 0;
+
case SIM_ID_TAG_PERMANENT_SIM:
*hint = SIM_METHOD_HINT_SIM;
*type = SIM_ID_TYPE_PERMANENT; /* All digits */
return 0;
- default:
- break;
- }
-
- }
- }
-
- /*
- * 3GPP Pseudonym
- */
- if (id_len == SIM_3GPP_PSEUDONYM_LEN) {
- for (i = 1; i < id_len; i++) if (!fr_is_base64(id[i])) break;
-
- if (i == id_len) {
- switch (id[0]) {
- case SIM_ID_TAG_3GPP_PSEUDONYM_AKA:
+ case SIM_ID_TAG_PERMANENT_AKA:
*hint = SIM_METHOD_HINT_AKA;
- *type = SIM_ID_TYPE_3GPP_PSEUDONYM;
+ *type = SIM_ID_TYPE_PERMANENT; /* All digits */
return 0;
- case SIM_ID_TAG_3GPP_PSEUDONYM_SIM:
- *hint = SIM_METHOD_HINT_SIM;
- *type = SIM_ID_TYPE_3GPP_PSEUDONYM;
+ case SIM_ID_TAG_PERMANENT_AKA_PRIME:
+ *hint = SIM_METHOD_HINT_AKA_PRIME;
+ *type = SIM_ID_TYPE_PERMANENT; /* All Digits */
return 0;
default:
break;
}
+
}
}
/*
- * User assigned pseudonym
+ * Pseudonym
*/
switch (id[0]) {
+ case SIM_ID_TAG_PSEUDONYM_SIM:
+ *hint = SIM_METHOD_HINT_SIM;
+ *type = SIM_ID_TYPE_PSEUDONYM;
+ return 0;
+
case SIM_ID_TAG_PSEUDONYM_AKA:
*hint = SIM_METHOD_HINT_AKA;
*type = SIM_ID_TYPE_PSEUDONYM;
return 0;
- case SIM_ID_TAG_PSEUDONYM_SIM:
- *hint = SIM_METHOD_HINT_SIM;
+ case SIM_ID_TAG_PSEUDONYM_AKA_PRIME:
+ *hint = SIM_METHOD_HINT_AKA_PRIME;
*type = SIM_ID_TYPE_PSEUDONYM;
return 0;
/*
* Fast reauth identity
*/
+ case SIM_ID_TAG_FASTAUTH_SIM:
+ *hint = SIM_METHOD_HINT_SIM;
+ *type = SIM_ID_TYPE_FASTAUTH;
+ return 0;
+
case SIM_ID_TAG_FASTAUTH_AKA:
*hint = SIM_METHOD_HINT_AKA;
*type = SIM_ID_TYPE_FASTAUTH;
return 0;
- case SIM_ID_TAG_FASTAUTH_SIM:
- *hint = SIM_METHOD_HINT_SIM;
+ case SIM_ID_TAG_FASTAUTH_AKA_PRIME:
+ *hint = SIM_METHOD_HINT_AKA_PRIME;
*type = SIM_ID_TYPE_FASTAUTH;
return 0;
SIM_METHOD_HINT_UNKNOWN = 0, //!< We don't know what method the identity hints at.
SIM_METHOD_HINT_SIM = 1, //!< The identity hints the supplicant wants to use
///< EAP-SIM.
- SIM_METHOD_HINT_AKA = 2 //!< The identity hints the supplicant wants to use
+ SIM_METHOD_HINT_AKA = 2, //!< The identity hints the supplicant wants to use
///< EAP-AKA.
+ SIM_METHOD_HINT_AKA_PRIME = 3
} fr_sim_method_hint_t;
/** SIM/AKA identity type hints
SIM_ID_TYPE_UNKNOWN = 0, //!< We don't know what type of identity this is.
SIM_ID_TYPE_PERMANENT = 1, //!< This is a permanent identity (the IMSI of the SIM).
SIM_ID_TYPE_PSEUDONYM = 2, //!< This is a custom pseudonym.
- SIM_ID_TYPE_3GPP_PSEUDONYM = 3, //!< This is a reversibly encrypted 3gpp pseudonym.
- SIM_ID_TYPE_FASTAUTH = 4 //!< This is a fastauth (session-resumption) id.
+ SIM_ID_TYPE_FASTAUTH = 5 //!< This is a fastauth (session-resumption) id.
} fr_sim_id_type_t;
typedef enum {
- SIM_ID_TAG_PERMANENT_AKA = '0',
- SIM_ID_TAG_PERMANENT_SIM = '1',
- SIM_ID_TAG_PSEUDONYM_AKA = '2',
- SIM_ID_TAG_PSEUDONYM_SIM = '3',
- SIM_ID_TAG_3GPP_PSEUDONYM_AKA = '6',
- SIM_ID_TAG_3GPP_PSEUDONYM_SIM = '7',
- SIM_ID_TAG_FASTAUTH_AKA = '4',
- SIM_ID_TAG_FASTAUTH_SIM = '5'
+ SIM_ID_TAG_PERMANENT_SIM = '1', //!< IMSI, and hint that client wants to do EAP-SIM
+ SIM_ID_TAG_PSEUDONYM_SIM = '4', //!< Pseudonym, continue EAP-SIM
+ SIM_ID_TAG_FASTAUTH_SIM = '5', //!< Fastauth, continue EAP-SIM
+
+ SIM_ID_TAG_PERMANENT_AKA = '0', //!< IMSI, and hint that client wants to do EAP-AKA
+ SIM_ID_TAG_PSEUDONYM_AKA = '2', //!< Pseudonym, continue EAP-AKA
+ SIM_ID_TAG_FASTAUTH_AKA = '3', //!< Fastauth, continue EAP-AKA
+
+ SIM_ID_TAG_PERMANENT_AKA_PRIME = '6', //!< IMSI, and hint that client wants to do EAP-AKA-Prime.
+ SIM_ID_TAG_PSEUDONYM_AKA_PRIME = '7', //!< Pseudonym, continue EAP-AKA-Prime
+ SIM_ID_TAG_FASTAUTH_AKA_PRIME = '8' //!< Fastuath, continue EAP-AKA-Prime
} fr_sim_id_tag_t;
+#define SIM_ID_TAG_PSEUDONYM_SIM_B64 56
+#define SIM_ID_TAG_PSEUDONYM_AKA_B64 54
+#define SIM_ID_TAG_PSEUDONYM_AKA_PRIME_B64 59
+
size_t fr_sim_id_user_len(char const *nai, size_t nai_len);
char const *fr_sim_domain(char const *nai, size_t nai_len);
tag = fr_sim_id_3gpp_pseudonym_tag(id);
switch (tag) {
- case 59: /* 7 in the base64 alphabet (SIM) */
+ case SIM_ID_TAG_PSEUDONYM_SIM_B64:
out_tag = SIM_ID_TAG_PERMANENT_SIM;
break;
- case 58: /* 6 in the base64 alphabet (AKA) */
+ case SIM_ID_TAG_PSEUDONYM_AKA_B64:
out_tag = SIM_ID_TAG_PERMANENT_AKA;
break;
+ case SIM_ID_TAG_PSEUDONYM_AKA_PRIME_B64:
+ out_tag = SIM_ID_TAG_PERMANENT_AKA_PRIME;
+ break;
+
default:
REDEBUG2("Unexpected tag value (%u) in SIM ID \"%pS\"", tag, id);
return -1;
switch (method_hint) {
case SIM_METHOD_HINT_SIM:
- tag = 59; /* 7 in the base64 alphabet */
+ tag = SIM_ID_TAG_PSEUDONYM_SIM_B64;
break;
case SIM_METHOD_HINT_AKA:
- tag = 58; /* 6 in the base64 alphabet */
+ tag = SIM_ID_TAG_PSEUDONYM_AKA_B64;
+ break;
+
+ case SIM_METHOD_HINT_AKA_PRIME:
+ tag = SIM_ID_TAG_PSEUDONYM_AKA_PRIME_B64;
break;
case SIM_METHOD_HINT_UNKNOWN:
* These types need to be transformed into something
* usable before we can do anything.
*/
- case SIM_ID_TYPE_3GPP_PSEUDONYM:
case SIM_ID_TYPE_PSEUDONYM:
case SIM_ID_TYPE_FASTAUTH:
case SIM_ID_TYPE_UNKNOWN:
#
# Can we identify the encrypted blob correctly?
#
-if ("%{sim_id_type:&control:User-Name}" != '3GPP-Pseudonym') {
+if ("%{sim_id_type:&control:User-Name}" != 'Pseudonym') {
test_fail
} else {
test_pass
#
# Can we identify the encrypted blob correctly?
#
-if ("%{sim_id_type:&control:User-Name}" != '3GPP-Pseudonym') {
+if ("%{sim_id_type:&control:User-Name}" != 'Pseudonym') {
test_fail
} else {
test_pass