mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-19 03:14:05 -05:00
EAP-MSCHAPv2: Propagate GetAsymetricStartKey() failures up from getKey()
Report failure from getKey() if MSK cannot be derived due to unexpected sha1_vector() local failure. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
d804155783
commit
90ee1bf5f1
@ -856,9 +856,13 @@ static u8 * eap_mschapv2_getKey(struct eap_sm *sm, void *priv, size_t *len)
|
|||||||
|
|
||||||
/* MSK = server MS-MPPE-Recv-Key | MS-MPPE-Send-Key, i.e.,
|
/* MSK = server MS-MPPE-Recv-Key | MS-MPPE-Send-Key, i.e.,
|
||||||
* peer MS-MPPE-Send-Key | MS-MPPE-Recv-Key */
|
* peer MS-MPPE-Send-Key | MS-MPPE-Recv-Key */
|
||||||
get_asymetric_start_key(data->master_key, key, MSCHAPV2_KEY_LEN, 1, 0);
|
if (get_asymetric_start_key(data->master_key, key, MSCHAPV2_KEY_LEN, 1,
|
||||||
get_asymetric_start_key(data->master_key, key + MSCHAPV2_KEY_LEN,
|
0) < 0 ||
|
||||||
MSCHAPV2_KEY_LEN, 0, 0);
|
get_asymetric_start_key(data->master_key, key + MSCHAPV2_KEY_LEN,
|
||||||
|
MSCHAPV2_KEY_LEN, 0, 0) < 0) {
|
||||||
|
os_free(key);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
wpa_hexdump_key(MSG_DEBUG, "EAP-MSCHAPV2: Derived key",
|
wpa_hexdump_key(MSG_DEBUG, "EAP-MSCHAPV2: Derived key",
|
||||||
key, key_len);
|
key, key_len);
|
||||||
|
@ -551,9 +551,13 @@ static u8 * eap_mschapv2_getKey(struct eap_sm *sm, void *priv, size_t *len)
|
|||||||
if (key == NULL)
|
if (key == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
/* MSK = server MS-MPPE-Recv-Key | MS-MPPE-Send-Key */
|
/* MSK = server MS-MPPE-Recv-Key | MS-MPPE-Send-Key */
|
||||||
get_asymetric_start_key(data->master_key, key, MSCHAPV2_KEY_LEN, 0, 1);
|
if (get_asymetric_start_key(data->master_key, key, MSCHAPV2_KEY_LEN, 0,
|
||||||
get_asymetric_start_key(data->master_key, key + MSCHAPV2_KEY_LEN,
|
1) < 0 ||
|
||||||
MSCHAPV2_KEY_LEN, 1, 1);
|
get_asymetric_start_key(data->master_key, key + MSCHAPV2_KEY_LEN,
|
||||||
|
MSCHAPV2_KEY_LEN, 1, 1) < 0) {
|
||||||
|
os_free(key);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
wpa_hexdump_key(MSG_DEBUG, "EAP-MSCHAPV2: Derived key", key, *len);
|
wpa_hexdump_key(MSG_DEBUG, "EAP-MSCHAPV2: Derived key", key, *len);
|
||||||
|
|
||||||
return key;
|
return key;
|
||||||
|
Loading…
Reference in New Issue
Block a user