]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Only parse the username portion of the identity string in fr_sim_id_type
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 31 Jan 2018 18:14:54 +0000 (11:14 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 31 Jan 2018 18:14:54 +0000 (11:14 -0700)
src/modules/rlm_eap/lib/sim/id.c

index 10e978e3329e4ba33f78e1ca010f8a84ff926d50..0dd6960057c9a8dc0faaf9a1c6e7a4fd283d49f5 100644 (file)
@@ -152,8 +152,7 @@ ssize_t fr_sim_3gpp_root_nai_domain_mcc_mnc(uint16_t *mnc, uint16_t *mcc,
   *    - 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.
   * @param[in] id      the NAI string provided.
-  * @param[in] id_len  the length of the user portion of the NAI string.
-  *                    See #fr_sim_id_user_len.
+  * @param[in] id_len  the length of the NAI string.
   * @return
   *    - 0 on success.
   *    - -1 on failure.
@@ -169,6 +168,14 @@ int fr_sim_id_type(fr_sim_id_type_t *type, fr_sim_method_hint_t *hint, char cons
                return -1;
        }
 
+       /*
+        *      Just get the length of the ID between the start
+        *      and the first '@'.  Returns the length of the
+        *      entire string if no '@' found, so works with
+        *      full NAI strings and Stripped-User-Name.
+        */
+       id_len = fr_sim_id_user_len(id, id_len);
+
        /*
         *      Permanent ID format check
         */