aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>2017-10-05 21:53:01 (GMT)
committerJouni Malinen <j@w1.fi>2017-10-15 23:03:47 (GMT)
commita00e946c1c9a1f9cc65c72900d2a444ceb1f872e (patch)
tree3c9495c18e3d48f9852d7be0798edd22774d8a08
parentf4528fbf517d40c05a3efbfb4733672dd0b732fa (diff)
downloadhostap-a00e946c1c9a1f9cc65c72900d2a444ceb1f872e.zip
hostap-a00e946c1c9a1f9cc65c72900d2a444ceb1f872e.tar.gz
hostap-a00e946c1c9a1f9cc65c72900d2a444ceb1f872e.tar.bz2
WPA: Extra defense against PTK reinstalls in 4-way handshake
Currently, reinstallations of the PTK are prevented by (1) assuring the same TPTK is only set once as the PTK, and (2) that one particular PTK is only installed once. This patch makes it more explicit that point (1) is required to prevent key reinstallations. At the same time, this patch hardens wpa_supplicant such that future changes do not accidentally break this property. Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
-rw-r--r--src/rsn_supp/wpa.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 4840199..efa06c3 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -1729,6 +1729,14 @@ static int wpa_supplicant_verify_eapol_key_mic(struct wpa_sm *sm,
sm->ptk_set = 1;
os_memcpy(&sm->ptk, &sm->tptk, sizeof(sm->ptk));
os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ /*
+ * This assures the same TPTK in sm->tptk can never be
+ * copied twice to sm->pkt as the new PTK. In
+ * combination with the installed flag in the wpa_ptk
+ * struct, this assures the same PTK is only installed
+ * once.
+ */
+ sm->renew_snonce = 1;
}
}