EAP peer: Add framework for external SIM/USIM processing
The new configuration parameter external_sim=<0/1> can now be used to configure wpa_supplicant to use external SIM/USIM processing (e.g., GSM authentication for EAP-SIM or UMTS authentication for EAP-AKA). The requests and responses for such operations are sent over the ctrl_iface CTRL-REQ-SIM and CTRL-RSP-SIM commands similarly to the existing password query mechanism. Changes to the EAP methods to use this new mechanism will be added in separate commits. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
7e8bc7d6fb
commit
a5d44ac083
18 changed files with 122 additions and 4 deletions
|
@ -1638,7 +1638,8 @@ static void eap_sm_request(struct eap_sm *sm, enum wpa_ctrl_req_type field,
|
|||
const char *msg, size_t msglen)
|
||||
{
|
||||
struct eap_peer_config *config;
|
||||
char *txt = NULL, *tmp;
|
||||
const char *txt = NULL;
|
||||
char *tmp;
|
||||
|
||||
if (sm == NULL)
|
||||
return;
|
||||
|
@ -1681,6 +1682,9 @@ static void eap_sm_request(struct eap_sm *sm, enum wpa_ctrl_req_type field,
|
|||
case WPA_CTRL_REQ_EAP_PASSPHRASE:
|
||||
config->pending_req_passphrase++;
|
||||
break;
|
||||
case WPA_CTRL_REQ_SIM:
|
||||
txt = msg;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
@ -1791,6 +1795,17 @@ void eap_sm_request_passphrase(struct eap_sm *sm)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* eap_sm_request_sim - Request external SIM processing
|
||||
* @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
|
||||
* @req: EAP method specific request
|
||||
*/
|
||||
void eap_sm_request_sim(struct eap_sm *sm, const char *req)
|
||||
{
|
||||
eap_sm_request(sm, WPA_CTRL_REQ_SIM, req, os_strlen(req));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* eap_sm_notify_ctrl_attached - Notification of attached monitor
|
||||
* @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
|
||||
|
@ -2304,6 +2319,17 @@ void eap_set_force_disabled(struct eap_sm *sm, int disabled)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* eap_set_external_sim - Set external_sim flag
|
||||
* @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
|
||||
* @external_sim: Whether external SIM/USIM processing is used
|
||||
*/
|
||||
void eap_set_external_sim(struct eap_sm *sm, int external_sim)
|
||||
{
|
||||
sm->external_sim = external_sim;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* eap_notify_pending - Notify that EAP method is ready to re-process a request
|
||||
* @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
|
||||
|
|
|
@ -296,6 +296,7 @@ void eap_sm_request_new_password(struct eap_sm *sm);
|
|||
void eap_sm_request_pin(struct eap_sm *sm);
|
||||
void eap_sm_request_otp(struct eap_sm *sm, const char *msg, size_t msg_len);
|
||||
void eap_sm_request_passphrase(struct eap_sm *sm);
|
||||
void eap_sm_request_sim(struct eap_sm *sm, const char *req);
|
||||
void eap_sm_notify_ctrl_attached(struct eap_sm *sm);
|
||||
u32 eap_get_phase2_type(const char *name, int *vendor);
|
||||
struct eap_method_type * eap_get_phase2_types(struct eap_peer_config *config,
|
||||
|
@ -303,6 +304,7 @@ struct eap_method_type * eap_get_phase2_types(struct eap_peer_config *config,
|
|||
void eap_set_fast_reauth(struct eap_sm *sm, int enabled);
|
||||
void eap_set_workaround(struct eap_sm *sm, unsigned int workaround);
|
||||
void eap_set_force_disabled(struct eap_sm *sm, int disabled);
|
||||
void eap_set_external_sim(struct eap_sm *sm, int external_sim);
|
||||
int eap_key_available(struct eap_sm *sm);
|
||||
void eap_notify_success(struct eap_sm *sm);
|
||||
void eap_notify_lower_layer_success(struct eap_sm *sm);
|
||||
|
|
|
@ -669,6 +669,15 @@ struct eap_peer_config {
|
|||
* 2 = require valid OCSP stapling response
|
||||
*/
|
||||
int ocsp;
|
||||
|
||||
/**
|
||||
* external_sim_resp - Response from external SIM processing
|
||||
*
|
||||
* This field should not be set in configuration step. It is only used
|
||||
* internally when control interface is used to request external
|
||||
* SIM/USIM processing.
|
||||
*/
|
||||
char *external_sim_resp;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -348,6 +348,8 @@ struct eap_sm {
|
|||
|
||||
struct ext_password_data *ext_pw;
|
||||
struct wpabuf *ext_pw_buf;
|
||||
|
||||
int external_sim;
|
||||
};
|
||||
|
||||
const u8 * eap_get_config_identity(struct eap_sm *sm, size_t *len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue