aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>2017-10-05 23:53:01 +0200
committerDan Pasanen <dan.pasanen@gmail.com>2017-10-16 10:50:00 -0500
commitfbf7ecce2598a039e774d6ba501bae227182c52a (patch)
tree4860956e5475514219c97c4071c5d8bdd7e91102
parent5c64f90e6f148f9a1ef9465ca8381e8f806ea0be (diff)
downloadandroid_external_wpa_supplicant_8-fbf7ecce2598a039e774d6ba501bae227182c52a.tar.gz
android_external_wpa_supplicant_8-fbf7ecce2598a039e774d6ba501bae227182c52a.tar.bz2
android_external_wpa_supplicant_8-fbf7ecce2598a039e774d6ba501bae227182c52a.zip
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. Change-Id: Ib8d2a4dc2c6ccd634866f0b3b01ca3d73f73bcaa 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 5ef50393..619720ee 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -1642,6 +1642,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;
}
}