]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Toggle whether we send protected success messages
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 14 Dec 2017 13:01:48 +0000 (13:01 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 14 Dec 2017 14:17:53 +0000 (14:17 +0000)
src/modules/rlm_eap/types/rlm_eap_aka/eap_aka.h
src/modules/rlm_eap/types/rlm_eap_aka/rlm_eap_aka.c
src/modules/rlm_eap/types/rlm_eap_sim/eap_sim.h
src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c

index c72bc7c5bdfb35bacd6337d202885b692bbdceda..13b29e867c2c57ec6e7109395d39f77b6becb621 100644 (file)
@@ -81,8 +81,9 @@ typedef struct {
 } eap_aka_session_t;
 
 typedef struct {
-       char const                      *virtual_server;        //!< Virtual server for HLR integration.
        char const                      *network_id;            //!< Network ID as described by RFC 5448.
        bool                            request_identity;       //!< Whether we always request the identity of
                                                                ///< the subscriber.
+       char const                      *virtual_server;        //!< Virtual server for HLR integration.
+       bool                            protected_success;
 } rlm_eap_aka_t;
index f95dd93cdfd9f4dbea57a43b8f9d0fe4a1cb164d..5c3a55705c89004c3142a29938e4ffba4060fcf4 100644 (file)
@@ -51,7 +51,8 @@ static rlm_rcode_t mod_process(UNUSED void *arg, eap_session_t *eap_session);
 
 static CONF_PARSER submodule_config[] = {
        { FR_CONF_OFFSET("network_id", FR_TYPE_STRING | FR_TYPE_REQUIRED, rlm_eap_aka_t, network_id ) },
-       { FR_CONF_OFFSET("request_identity", FR_TYPE_BOOL, rlm_eap_aka_t, request_identity ), .dflt = "yes" },
+       { FR_CONF_OFFSET("request_identity", FR_TYPE_BOOL, rlm_eap_aka_t, request_identity ), .dflt = "no" },
+       { FR_CONF_OFFSET("protected_success", FR_TYPE_BOOL, rlm_eap_aka_t, protected_success ), .dflt = "no" },
        { FR_CONF_OFFSET("virtual_server", FR_TYPE_STRING, rlm_eap_aka_t, virtual_server) },
        CONF_PARSER_TERMINATOR
 };
@@ -1018,7 +1019,7 @@ static rlm_rcode_t mod_session_init(void *instance, eap_session_t *eap_session)
         *      to be toggled by attributes later.
         */
        eap_aka_session->request_identity = inst->request_identity;
-       eap_aka_session->send_result_ind = true;
+       eap_aka_session->send_result_ind = inst->protected_success;
        eap_aka_session->id_req = SIM_NO_ID_REQ;        /* Set the default */
 
        /*
index 70080fb655f3ce600c2ad7916653ebb7d04d423f..187a9cff8089fefb76d2335f504deed713a98589 100644 (file)
@@ -51,10 +51,6 @@ typedef struct {
        fr_sim_id_req_type_t            id_req;                 //!< The type of identity we're requesting
                                                                ///< or previously requested.
 
-
-       bool                            request_identity;       //!< Always send an identity request before a
-                                                               ///< challenge.
-
        bool                            send_result_ind;        //!< Say that we would like to use protected result
                                                                ///< indications (SIM-Notification-Success).
 
@@ -64,6 +60,5 @@ typedef struct {
 
 typedef struct {
        char const                      *virtual_server;        //!< Virtual server for HLR integration.
-       bool                            request_identity;       //!< Whether we always request the identity of
-                                                               ///< the subscriber.
+       bool                            protected_success;      //!< Send protected success messages.
 } rlm_eap_sim_t;
index 4e7161554bc7c2235f6a8e8020e3e7abc5ca627c..cf98051acecd17932198f3c05809a788f3538c02 100644 (file)
@@ -51,6 +51,7 @@ FR_NAME_NUMBER const sim_state_table[] = {
 
 static CONF_PARSER submodule_config[] = {
        { FR_CONF_OFFSET("virtual_server", FR_TYPE_STRING, rlm_eap_sim_t, virtual_server) },
+       { FR_CONF_OFFSET("protected_success", FR_TYPE_BOOL, rlm_eap_sim_t, protected_success ), .dflt = "no" },
        CONF_PARSER_TERMINATOR
 };
 
@@ -875,7 +876,7 @@ static rlm_rcode_t mod_session_init(UNUSED void *instance, eap_session_t *eap_se
 {
        REQUEST                         *request = eap_session->request;
        eap_sim_session_t               *eap_sim_session;
-//     rlm_eap_sim_t                   *inst = instance;
+       rlm_eap_sim_t                   *inst = instance;
        fr_sim_id_type_t                type;
        fr_sim_method_hint_t            method;
 
@@ -887,7 +888,7 @@ static rlm_rcode_t mod_session_init(UNUSED void *instance, eap_session_t *eap_se
         *      Set default configuration, we may allow these
         *      to be toggled by attributes later.
         */
-       eap_sim_session->send_result_ind = true;
+       eap_sim_session->send_result_ind = inst->protected_success;
        eap_sim_session->id_req = SIM_ANY_ID_REQ;       /* Set the default */
 
        /*