From: Jouni Malinen Date: Fri, 13 Nov 2009 20:29:31 +0000 (+0200) Subject: WPS: Fix OpCode when proxying WSC_ACK or WSC_NACK from ER X-Git-Tag: hostap_0_7_0~60 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=libeap.git;a=commitdiff_plain;h=04f5d740772c53125bdf9251565d0e438b239430 WPS: Fix OpCode when proxying WSC_ACK or WSC_NACK from ER Previously, WSC_MSG was hardcoded for every message from ER, but this needs to be changed based on message type to send a valid message to the Enrollee via EAP transport. --- diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c index d8053d4..37a506c 100644 --- a/src/wps/wps_registrar.c +++ b/src/wps/wps_registrar.c @@ -1563,8 +1563,18 @@ struct wpabuf * wps_registrar_get_msg(struct wps_data *wps, else wps->wps->upnp_msgs = NULL; msg = p->msg; + switch (p->type) { + case WPS_WSC_ACK: + *op_code = WSC_ACK; + break; + case WPS_WSC_NACK: + *op_code = WSC_NACK; + break; + default: + *op_code = WSC_MSG; + break; + } os_free(p); - *op_code = WSC_MSG; if (wps->ext_reg == 0) wps->ext_reg = 1; return msg;