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.
This commit is contained in:
Denis Kenzior 2016-08-30 23:18:53 -05:00
parent 1820d7c33e
commit c0de9d1790
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}