EAP-SIM/AKA: Remove unused RESULT_FAILURE state
This was not set anywhere, so remove the unnecessary code trying to handle the unused state. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
		
							parent
							
								
									32747a3eee
								
							
						
					
					
						commit
						79122f9f9c
					
				
					 2 changed files with 8 additions and 16 deletions
				
			
		|  | @ -42,7 +42,7 @@ struct eap_aka_data { | ||||||
| 	u8 *last_eap_identity; | 	u8 *last_eap_identity; | ||||||
| 	size_t last_eap_identity_len; | 	size_t last_eap_identity_len; | ||||||
| 	enum { | 	enum { | ||||||
| 		CONTINUE, RESULT_SUCCESS, RESULT_FAILURE, SUCCESS, FAILURE | 		CONTINUE, RESULT_SUCCESS, SUCCESS, FAILURE | ||||||
| 	} state; | 	} state; | ||||||
| 
 | 
 | ||||||
| 	struct wpabuf *id_msgs; | 	struct wpabuf *id_msgs; | ||||||
|  | @ -64,8 +64,6 @@ static const char * eap_aka_state_txt(int state) | ||||||
| 		return "CONTINUE"; | 		return "CONTINUE"; | ||||||
| 	case RESULT_SUCCESS: | 	case RESULT_SUCCESS: | ||||||
| 		return "RESULT_SUCCESS"; | 		return "RESULT_SUCCESS"; | ||||||
| 	case RESULT_FAILURE: |  | ||||||
| 		return "RESULT_FAILURE"; |  | ||||||
| 	case SUCCESS: | 	case SUCCESS: | ||||||
| 		return "SUCCESS"; | 		return "SUCCESS"; | ||||||
| 	case FAILURE: | 	case FAILURE: | ||||||
|  | @ -1025,7 +1023,7 @@ static struct wpabuf * eap_aka_process_challenge(struct eap_sm *sm, | ||||||
| 	if (data->result_ind && attr->result_ind) | 	if (data->result_ind && attr->result_ind) | ||||||
| 		data->use_result_ind = 1; | 		data->use_result_ind = 1; | ||||||
| 
 | 
 | ||||||
| 	if (data->state != FAILURE && data->state != RESULT_FAILURE) { | 	if (data->state != FAILURE) { | ||||||
| 		eap_aka_state(data, data->use_result_ind ? | 		eap_aka_state(data, data->use_result_ind ? | ||||||
| 			      RESULT_SUCCESS : SUCCESS); | 			      RESULT_SUCCESS : SUCCESS); | ||||||
| 	} | 	} | ||||||
|  | @ -1241,7 +1239,7 @@ static struct wpabuf * eap_aka_process_reauthentication( | ||||||
| 	if (data->result_ind && attr->result_ind) | 	if (data->result_ind && attr->result_ind) | ||||||
| 		data->use_result_ind = 1; | 		data->use_result_ind = 1; | ||||||
| 
 | 
 | ||||||
| 	if (data->state != FAILURE && data->state != RESULT_FAILURE) { | 	if (data->state != FAILURE) { | ||||||
| 		eap_aka_state(data, data->use_result_ind ? | 		eap_aka_state(data, data->use_result_ind ? | ||||||
| 			      RESULT_SUCCESS : SUCCESS); | 			      RESULT_SUCCESS : SUCCESS); | ||||||
| 	} | 	} | ||||||
|  | @ -1347,9 +1345,7 @@ done: | ||||||
| 		 */ | 		 */ | ||||||
| 		ret->methodState = data->use_result_ind ? | 		ret->methodState = data->use_result_ind ? | ||||||
| 			METHOD_DONE : METHOD_MAY_CONT; | 			METHOD_DONE : METHOD_MAY_CONT; | ||||||
| 	} else if (data->state == RESULT_FAILURE) | 	} else if (data->state == RESULT_SUCCESS) | ||||||
| 		ret->methodState = METHOD_CONT; |  | ||||||
| 	else if (data->state == RESULT_SUCCESS) |  | ||||||
| 		ret->methodState = METHOD_CONT; | 		ret->methodState = METHOD_CONT; | ||||||
| 
 | 
 | ||||||
| 	if (ret->methodState == METHOD_DONE) { | 	if (ret->methodState == METHOD_DONE) { | ||||||
|  |  | ||||||
|  | @ -43,7 +43,7 @@ struct eap_sim_data { | ||||||
| 	u8 *last_eap_identity; | 	u8 *last_eap_identity; | ||||||
| 	size_t last_eap_identity_len; | 	size_t last_eap_identity_len; | ||||||
| 	enum { | 	enum { | ||||||
| 		CONTINUE, RESULT_SUCCESS, RESULT_FAILURE, SUCCESS, FAILURE | 		CONTINUE, RESULT_SUCCESS, SUCCESS, FAILURE | ||||||
| 	} state; | 	} state; | ||||||
| 	int result_ind, use_result_ind; | 	int result_ind, use_result_ind; | ||||||
| }; | }; | ||||||
|  | @ -57,8 +57,6 @@ static const char * eap_sim_state_txt(int state) | ||||||
| 		return "CONTINUE"; | 		return "CONTINUE"; | ||||||
| 	case RESULT_SUCCESS: | 	case RESULT_SUCCESS: | ||||||
| 		return "RESULT_SUCCESS"; | 		return "RESULT_SUCCESS"; | ||||||
| 	case RESULT_FAILURE: |  | ||||||
| 		return "RESULT_FAILURE"; |  | ||||||
| 	case SUCCESS: | 	case SUCCESS: | ||||||
| 		return "SUCCESS"; | 		return "SUCCESS"; | ||||||
| 	case FAILURE: | 	case FAILURE: | ||||||
|  | @ -788,7 +786,7 @@ static struct wpabuf * eap_sim_process_challenge(struct eap_sm *sm, | ||||||
| 	if (data->result_ind && attr->result_ind) | 	if (data->result_ind && attr->result_ind) | ||||||
| 		data->use_result_ind = 1; | 		data->use_result_ind = 1; | ||||||
| 
 | 
 | ||||||
| 	if (data->state != FAILURE && data->state != RESULT_FAILURE) { | 	if (data->state != FAILURE) { | ||||||
| 		eap_sim_state(data, data->use_result_ind ? | 		eap_sim_state(data, data->use_result_ind ? | ||||||
| 			      RESULT_SUCCESS : SUCCESS); | 			      RESULT_SUCCESS : SUCCESS); | ||||||
| 	} | 	} | ||||||
|  | @ -989,7 +987,7 @@ static struct wpabuf * eap_sim_process_reauthentication( | ||||||
| 	if (data->result_ind && attr->result_ind) | 	if (data->result_ind && attr->result_ind) | ||||||
| 		data->use_result_ind = 1; | 		data->use_result_ind = 1; | ||||||
| 
 | 
 | ||||||
| 	if (data->state != FAILURE && data->state != RESULT_FAILURE) { | 	if (data->state != FAILURE) { | ||||||
| 		eap_sim_state(data, data->use_result_ind ? | 		eap_sim_state(data, data->use_result_ind ? | ||||||
| 			      RESULT_SUCCESS : SUCCESS); | 			      RESULT_SUCCESS : SUCCESS); | ||||||
| 	} | 	} | ||||||
|  | @ -1088,9 +1086,7 @@ done: | ||||||
| 			DECISION_UNCOND_SUCC : DECISION_COND_SUCC; | 			DECISION_UNCOND_SUCC : DECISION_COND_SUCC; | ||||||
| 		ret->methodState = data->use_result_ind ? | 		ret->methodState = data->use_result_ind ? | ||||||
| 			METHOD_DONE : METHOD_MAY_CONT; | 			METHOD_DONE : METHOD_MAY_CONT; | ||||||
| 	} else if (data->state == RESULT_FAILURE) | 	} else if (data->state == RESULT_SUCCESS) | ||||||
| 		ret->methodState = METHOD_CONT; |  | ||||||
| 	else if (data->state == RESULT_SUCCESS) |  | ||||||
| 		ret->methodState = METHOD_CONT; | 		ret->methodState = METHOD_CONT; | ||||||
| 
 | 
 | ||||||
| 	if (ret->methodState == METHOD_DONE) { | 	if (ret->methodState == METHOD_DONE) { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Jouni Malinen
						Jouni Malinen