WPS 2.0: Add Request to Enroll attribute into Probe Request

Whenever wpa_supplication is using Request Type Enrollee, it is trying
to enroll into a network. Indicate this with the explicit inclusion of
Request to Enroll attribute with value TRUE.
This commit is contained in:
Jouni Malinen 2009-12-23 01:03:15 +02:00 committed by Jouni Malinen
parent 31fcea931d
commit cfe1c3f1ef
3 changed files with 14 additions and 1 deletions

View file

@ -449,7 +449,9 @@ struct wpabuf * wps_build_probe_req_ie(int pbc, struct wps_device_data *dev,
wps_build_config_error(ie, WPS_CFG_NO_ERROR) ||
wps_build_dev_password_id(ie, pbc ? DEV_PW_PUSHBUTTON :
DEV_PW_DEFAULT) ||
wps_build_version2(ie)) {
wps_build_version2(ie) ||
(req_type == WPS_REQ_ENROLLEE &&
wps_build_req_to_enroll(ie))) {
wpabuf_free(ie);
return NULL;
}

View file

@ -337,3 +337,13 @@ int wps_build_oob_dev_password(struct wpabuf *msg, struct wps_context *wps)
return 0;
}
#endif /* CONFIG_WPS_OOB */
int wps_build_req_to_enroll(struct wpabuf *msg)
{
wpa_printf(MSG_DEBUG, "WPS: * Request to Enroll (1)");
wpabuf_put_be16(msg, ATTR_REQUEST_TO_ENROLL);
wpabuf_put_be16(msg, 1);
wpabuf_put_u8(msg, 1);
return 0;
}

View file

@ -247,6 +247,7 @@ int wps_build_encr_type_flags(struct wps_data *wps, struct wpabuf *msg);
int wps_build_conn_type_flags(struct wps_data *wps, struct wpabuf *msg);
int wps_build_assoc_state(struct wps_data *wps, struct wpabuf *msg);
int wps_build_oob_dev_password(struct wpabuf *msg, struct wps_context *wps);
int wps_build_req_to_enroll(struct wpabuf *msg);
/* wps_attr_process.c */
int wps_process_authenticator(struct wps_data *wps, const u8 *authenticator,