aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>2017-10-05 23:53:01 +0200
committerAndreas Blaesius <skate4life@gmx.de>2017-10-21 19:39:03 +0200
commitc7109518cd6a91993e3872d07864ac74723549b9 (patch)
treeefc8b5c36590da07dd92fb605dcfa33371ee633c
parentb99c54b34e8a83a7199daf76320931d5a57631a3 (diff)
downloadandroid_external_wpa_supplicant_8-c7109518cd6a91993e3872d07864ac74723549b9.tar.gz
android_external_wpa_supplicant_8-c7109518cd6a91993e3872d07864ac74723549b9.tar.bz2
android_external_wpa_supplicant_8-c7109518cd6a91993e3872d07864ac74723549b9.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: I0c998c0f6f77d00387d8472d75fdb1fa6335eaa4 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 f70f3b92..2212d332 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -1439,6 +1439,14 @@ static int wpa_supplicant_verify_eapol_key_mic(struct wpa_sm *sm,
sm->tptk_set = 0;
sm->ptk_set = 1;
os_memcpy(&sm->ptk, &sm->tptk, sizeof(sm->ptk));
+ /*
+ * 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;
}
}