wpa_auth: Make struct wpa_auth_callbacks const

Instead of copying the struct wpa_auth_callbacks, just keep a pointer to
it, keep the context pointer separate, and let the user just provide a
static const structure. This reduces the attack surface of heap
overwrites, since the function pointers move elsewhere.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2017-01-26 16:24:06 +01:00 committed by Jouni Malinen
parent 30eddf3529
commit cef8fac04b
7 changed files with 100 additions and 102 deletions

View file

@ -203,7 +203,8 @@ struct wpa_authenticator {
struct wpa_stsl_negotiation *stsl_negotiations;
struct wpa_auth_config conf;
struct wpa_auth_callbacks cb;
const struct wpa_auth_callbacks *cb;
void *cb_ctx;
u8 *wpa_ie;
size_t wpa_ie_len;