diff --git a/src/simauth.c b/src/simauth.c index 76ecd334..2c0bccd5 100644 --- a/src/simauth.c +++ b/src/simauth.c @@ -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); diff --git a/src/simauth.h b/src/simauth.h index 6b9bcda5..6ffb049a 100644 --- a/src/simauth.h +++ b/src/simauth.h @@ -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);