From: Jouni Malinen Date: Thu, 18 Jun 2020 10:03:29 +0000 (+0300) Subject: DPP2: Comeback delay response for certificate in over TCP case X-Git-Tag: hostap_2_10~1130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a352c7230d2ef45dc19fd9489ebbb92cd1cb3c6c;p=thirdparty%2Fhostap.git DPP2: Comeback delay response for certificate in over TCP case Send out the GAS Initial Response with comeback delay when Configurator is operating over TCP. Signed-off-by: Jouni Malinen --- diff --git a/src/common/dpp_tcp.c b/src/common/dpp_tcp.c index 6b21b8102..632cb4ccd 100644 --- a/src/common/dpp_tcp.c +++ b/src/common/dpp_tcp.c @@ -1023,6 +1023,30 @@ static int dpp_controller_rx_gas_req(struct dpp_connection *conn, const u8 *msg, return -1; resp = dpp_conf_req_rx(auth, pos, slen); + if (!resp && auth->waiting_cert) { + wpa_printf(MSG_DEBUG, "DPP: Certificate not yet ready"); + buf = wpabuf_alloc(4 + 18); + if (!buf) + return -1; + + wpabuf_put_be32(buf, 18); + + wpabuf_put_u8(buf, WLAN_PA_GAS_INITIAL_RESP); + wpabuf_put_u8(buf, dialog_token); + wpabuf_put_le16(buf, WLAN_STATUS_SUCCESS); + wpabuf_put_le16(buf, 500); /* GAS Comeback Delay */ + + dpp_write_adv_proto(buf); + wpabuf_put_le16(buf, 0); /* Query Response Length */ + + /* Send Config Response over TCP */ + wpa_hexdump_buf(MSG_MSGDUMP, "DPP: Outgoing TCP message", buf); + wpabuf_free(conn->msg_out); + conn->msg_out_pos = 0; + conn->msg_out = buf; + dpp_tcp_send(conn); + return 0; + } if (!resp) return -1;