return wpas_p2p_lo_start(wpa_s, freq, period, interval, count);
}
+
+#ifdef CONFIG_TESTING_OPTIONS
+static int p2p_ctrl_pmk_get(struct wpa_supplicant *wpa_s, char *buf,
+ size_t buflen)
+{
+ const u8 *pmk;
+ size_t pmk_len;
+
+ /* Return the PMK from the first identity entry. This assumes test
+ * cases to remove all indentities at the beginning so that only one
+ * entry is available. */
+ if (!wpa_s->conf->identity || !wpa_s->conf->identity->pmk)
+ return -1;
+
+ pmk_len = wpabuf_len(wpa_s->conf->identity->pmk);
+ pmk = wpabuf_head(wpa_s->conf->identity->pmk);
+
+ return wpa_snprintf_hex(buf, buflen, pmk, pmk_len);
+}
+#endif /* CONFIG_TESTING_OPTIONS */
#endif /* CONFIG_P2P */
} else if (os_strcmp(buf, "P2P_REMOVE_IDENTITY") == 0) {
if (wpas_p2p_remove_all_identity(wpa_s))
reply_len = -1;
+#ifdef CONFIG_TESTING_OPTIONS
+ } else if (os_strncmp(buf, "P2P_PMK_GET", 12) == 0) {
+ reply_len = p2p_ctrl_pmk_get(wpa_s, reply, reply_size);
+#endif /* CONFIG_TESTING_OPTIONS */
#endif /* CONFIG_P2P */
#ifdef CONFIG_WIFI_DISPLAY
} else if (os_strncmp(buf, "WFD_SUBELEM_SET ", 16) == 0) {