3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

simauth: fixup to add proper return values

The GSM and Milenage API's should return an integer which
can be used to cancel the request, they were returning bool.
This commit is contained in:
James Prestwood 2017-12-13 13:19:36 -08:00 committed by Denis Kenzior
parent 5d6118681d
commit a1ceb34bec
2 changed files with 10 additions and 8 deletions

View File

@ -152,12 +152,12 @@ void sim_auth_unregistered_watch_remove(struct iwd_sim_auth *auth,
watchlist_remove(&auth->auth_watchers, id);
}
bool sim_auth_check_milenage(struct iwd_sim_auth *auth,
int sim_auth_check_milenage(struct iwd_sim_auth *auth,
const uint8_t *rand, const uint8_t *autn,
sim_auth_check_milenage_cb_t cb, void *data)
{
if (!auth->aka_supported)
return false;
return -1;
/* save ID in case simauth is destroyed */
auth->pending = auth->driver->check_milenage(auth, rand, autn,
@ -166,11 +166,11 @@ bool sim_auth_check_milenage(struct iwd_sim_auth *auth,
return auth->pending;
}
bool sim_auth_run_gsm(struct iwd_sim_auth *auth, const uint8_t *rands,
int sim_auth_run_gsm(struct iwd_sim_auth *auth, const uint8_t *rands,
int num_rands, sim_auth_run_gsm_cb_t cb, void *data)
{
if (!auth->sim_supported)
return false;
return -1;
/* save ID in case simauth is destroyed */
auth->pending = auth->driver->run_gsm(auth, rands, num_rands, cb, data);

View File

@ -126,9 +126,10 @@ struct iwd_sim_auth *iwd_sim_auth_find(bool sim, bool aka);
* @param cb Callback with milenage values
* @param data User data
*
* @param False if there was an error
* @return Transaction ID, used to cancel the request if needed
* < 0 in case of an error
*/
bool sim_auth_check_milenage(struct iwd_sim_auth *auth,
int sim_auth_check_milenage(struct iwd_sim_auth *auth,
const uint8_t *rand, const uint8_t *autn,
sim_auth_check_milenage_cb_t cb, void *data);
@ -141,9 +142,10 @@ bool sim_auth_check_milenage(struct iwd_sim_auth *auth,
* @param cb Callback with GSM key values
* @param data User data
*
* @return False if there was an error
* @return Transaction ID, used to cancel the request if needed
* < 0 in case of an error
*/
bool sim_auth_run_gsm(struct iwd_sim_auth *auth, const uint8_t *rands,
int sim_auth_run_gsm(struct iwd_sim_auth *auth, const uint8_t *rands,
int num_rands, sim_auth_run_gsm_cb_t cb, void *data);
void sim_auth_cancel_request(struct iwd_sim_auth *auth, int id);