]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make last received ANonce available through control interface
authorJouni Malinen <j@w1.fi>
Sat, 14 Oct 2017 14:58:11 +0000 (17:58 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 16 Oct 2017 14:47:24 +0000 (17:47 +0300)
This makes it easier to debug 4-way handshake implementation issues
without having to use a sniffer.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/rsn_supp/wpa.c
src/rsn_supp/wpa.h
wpa_supplicant/ctrl_iface.c

index 0e1674e84391959259d45cbb376c43625c0139f0..0aed5bc746c077d04dbaf4ec185ad46d8d68e154 100644 (file)
@@ -3281,11 +3281,19 @@ void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm,
 
 
 #ifdef CONFIG_TESTING_OPTIONS
+
 void wpa_sm_set_test_assoc_ie(struct wpa_sm *sm, struct wpabuf *buf)
 {
        wpabuf_free(sm->test_assoc_ie);
        sm->test_assoc_ie = buf;
 }
+
+
+const u8 * wpa_sm_get_anonce(struct wpa_sm *sm)
+{
+       return sm->anonce;
+}
+
 #endif /* CONFIG_TESTING_OPTIONS */
 
 
index 3624fc2729417328d98e6b20c585507675729883..81c01713d7f1b6bf585e216554d680dda818403d 100644 (file)
@@ -428,6 +428,7 @@ extern unsigned int tdls_testing;
 
 int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf);
 void wpa_sm_set_test_assoc_ie(struct wpa_sm *sm, struct wpabuf *buf);
+const u8 * wpa_sm_get_anonce(struct wpa_sm *sm);
 
 struct wpabuf * fils_build_auth(struct wpa_sm *sm, int dh_group, const u8 *md);
 int fils_process_auth(struct wpa_sm *sm, const u8 *bssid, const u8 *data,
index 8e50d013309f3659da5767c3c0488a3f9bfe0b33..746c9f1fe498537671caccde524214048113b3d1 100644 (file)
@@ -749,6 +749,12 @@ static int wpa_supplicant_ctrl_iface_get(struct wpa_supplicant *wpa_s,
 #endif /* CONFIG_TESTING_GET_GTK */
        } else if (os_strcmp(cmd, "tls_library") == 0) {
                res = tls_get_library_version(buf, buflen);
+#ifdef CONFIG_TESTING_OPTIONS
+       } else if (os_strcmp(cmd, "anonce") == 0) {
+               return wpa_snprintf_hex(buf, buflen,
+                                       wpa_sm_get_anonce(wpa_s->wpa),
+                                       WPA_NONCE_LEN);
+#endif /* CONFIG_TESTING_OPTIONS */
        } else {
                res = wpa_config_get_value(cmd, wpa_s->conf, buf, buflen);
        }