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
					
				
					 2 changed files with 14 additions and 6 deletions
				
			
		|  | @ -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.,
 | ||||
| 	 *	peer MS-MPPE-Send-Key | MS-MPPE-Recv-Key */ | ||||
| 	get_asymetric_start_key(data->master_key, key, MSCHAPV2_KEY_LEN, 1, 0); | ||||
| 	get_asymetric_start_key(data->master_key, key + MSCHAPV2_KEY_LEN, | ||||
| 				MSCHAPV2_KEY_LEN, 0, 0); | ||||
| 	if (get_asymetric_start_key(data->master_key, key, MSCHAPV2_KEY_LEN, 1, | ||||
| 				    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", | ||||
| 			key, key_len); | ||||
|  |  | |||
|  | @ -551,9 +551,13 @@ static u8 * eap_mschapv2_getKey(struct eap_sm *sm, void *priv, size_t *len) | |||
| 	if (key == NULL) | ||||
| 		return NULL; | ||||
| 	/* MSK = server MS-MPPE-Recv-Key | MS-MPPE-Send-Key */ | ||||
| 	get_asymetric_start_key(data->master_key, key, MSCHAPV2_KEY_LEN, 0, 1); | ||||
| 	get_asymetric_start_key(data->master_key, key + MSCHAPV2_KEY_LEN, | ||||
| 				MSCHAPV2_KEY_LEN, 1, 1); | ||||
| 	if (get_asymetric_start_key(data->master_key, key, MSCHAPV2_KEY_LEN, 0, | ||||
| 				    1) < 0 || | ||||
| 	    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); | ||||
| 
 | ||||
| 	return key; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Jouni Malinen
						Jouni Malinen