From c0de9d17909f109f4fb33306811719e8606ceea7 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 30 Aug 2016 23:18:53 -0500 Subject: [PATCH] eap-wsc: optionally load IV1 & IV2 for debugging When we send M5 & M7, we need to generate a random IV. For testing purposes, the IV can be provided in settings, otherwise it will be generated randomly. --- src/eap-wsc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/eap-wsc.c b/src/eap-wsc.c index 5e9dc055..1c640ec4 100644 --- a/src/eap-wsc.c +++ b/src/eap-wsc.c @@ -70,6 +70,8 @@ struct eap_wsc_state { char *device_password; uint8_t e_snonce1[16]; uint8_t e_snonce2[16]; + uint8_t iv1[16]; + uint8_t iv2[16]; uint8_t psk1[16]; uint8_t psk2[16]; uint8_t r_hash2[32]; @@ -781,6 +783,12 @@ static bool eap_wsc_load_settings(struct eap_state *eap, if (!load_hexencoded(settings, "E-SNonce2", wsc->e_snonce2, 16)) l_getrandom(wsc->e_snonce2, 16); + if (!load_hexencoded(settings, "IV1", wsc->iv1, 16)) + l_getrandom(wsc->iv1, 16); + + if (!load_hexencoded(settings, "IV2", wsc->iv2, 16)) + l_getrandom(wsc->iv2, 16); + return true; }