eapol/eapol_framework/eapol_common/type/gsmsim/core/eap_type_gsmsim.cpp
changeset 26 9abfd4f00d37
parent 2 1c7bc153c08e
child 34 ad1f037f1ac2
equal deleted inserted replaced
25:e03a3db4489e 26:9abfd4f00d37
    14 * Description:  EAP and WLAN authentication protocols.
    14 * Description:  EAP and WLAN authentication protocols.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 27.1.4 %
    19 * %version: 35 %
    20 */
    20 */
    21 
    21 
    22 // This is enumeration of EAPOL source code.
    22 // This is enumeration of EAPOL source code.
    23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
    23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
    24 	#undef EAP_FILE_NUMBER_ENUM
    24 	#undef EAP_FILE_NUMBER_ENUM
  2717 			current_payload,
  2717 			current_payload,
  2718 			payload->get_payload_AT_string(),
  2718 			payload->get_payload_AT_string(),
  2719 			payload->get_payload_length(),
  2719 			payload->get_payload_length(),
  2720 			payload->get_reserved()));
  2720 			payload->get_reserved()));
  2721 
  2721 
  2722 		status = p_gsmsim_payloads->get_COUNTER_TOO_SMALL()->set_buffer(
  2722 		status = p_gsmsim_payloads->get_counter_too_small()->set_buffer(
  2723 			payload, 0, 0u, false, false);
  2723 			payload, 0, 0u, false, false);
  2724 
  2724 
  2725 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
  2725 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
  2726 		return EAP_STATUS_RETURN(m_am_tools, status);
  2726 		return EAP_STATUS_RETURN(m_am_tools, status);
  2727 	}
  2727 	}
  4654 	EAP_TRACE_DATA_DEBUG(
  4654 	EAP_TRACE_DATA_DEBUG(
  4655 		m_am_tools, 
  4655 		m_am_tools, 
  4656 		TRACE_FLAGS_DEFAULT, 
  4656 		TRACE_FLAGS_DEFAULT, 
  4657 		(EAPL("received: GSMSIM packet"),
  4657 		(EAPL("received: GSMSIM packet"),
  4658 		 received_gsmsim->get_header_buffer(
  4658 		 received_gsmsim->get_header_buffer(
  4659 			 received_gsmsim->get_header_length()+received_gsmsim->get_data_length()),
  4659 			 received_gsmsim->get_header_buffer_length()),
  4660 		 received_gsmsim->get_header_length()+received_gsmsim->get_data_length()));
  4660 		 received_gsmsim->get_header_buffer_length()));
  4661 
  4661 
  4662 	if (received_gsmsim->get_type() == eap_type_identity)
  4662 	if (received_gsmsim->get_type() == eap_type_identity)
  4663 	{
  4663 	{
  4664 		if (is_client_when_true == true)
  4664 		if (is_client_when_true == true)
  4665 		{
  4665 		{
  6477 		}
  6477 		}
  6478 	}
  6478 	}
  6479 
  6479 
  6480 	//----------------------------------------------------------
  6480 	//----------------------------------------------------------
  6481 
  6481 
  6482 #if defined(USE_EAP_EXPANDED_TYPES)
       
  6483 	{
  6482 	{
  6484 		eap_variable_data_c use_eap_expanded_type(m_am_tools);
  6483 		eap_variable_data_c use_eap_expanded_type(m_am_tools);
  6485 
  6484 
  6486 		eap_status_e status = read_configure(
  6485 		eap_status_e status = read_configure(
  6487 			cf_str_EAP_GSMSIM_use_eap_expanded_type.get_field(),
  6486 			cf_str_EAP_GSMSIM_use_eap_expanded_type.get_field(),
  6511 					m_use_eap_expanded_type = false;
  6510 					m_use_eap_expanded_type = false;
  6512 				}
  6511 				}
  6513 			}
  6512 			}
  6514 		}
  6513 		}
  6515 	}
  6514 	}
  6516 #endif //#if defined(USE_EAP_EXPANDED_TYPES)
       
  6517 
  6515 
  6518 	//----------------------------------------------------------
  6516 	//----------------------------------------------------------
  6519 
  6517 
  6520 	{
  6518 	{
  6521 		(void) read_configure(
  6519 		(void) read_configure(
  6792 	return EAP_STATUS_RETURN(m_am_tools, status);
  6790 	return EAP_STATUS_RETURN(m_am_tools, status);
  6793 }
  6791 }
  6794 
  6792 
  6795 //--------------------------------------------------
  6793 //--------------------------------------------------
  6796 
  6794 
  6797 //
       
  6798 EAP_FUNC_EXPORT eap_status_e eap_type_gsmsim_c::cancel_all_timers()
       
  6799 {
       
  6800 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  6801 
       
  6802 	EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true);
       
  6803 
       
  6804 	const eap_status_e status = get_type_partner()->cancel_all_timers();
       
  6805 
       
  6806 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  6807 	return EAP_STATUS_RETURN(m_am_tools, status);
       
  6808 }
       
  6809 
       
  6810 //--------------------------------------------------
       
  6811 
       
  6812 void eap_type_gsmsim_c::set_start_response_includes_identity(gsmsim_payload_AT_type_e type)
  6795 void eap_type_gsmsim_c::set_start_response_includes_identity(gsmsim_payload_AT_type_e type)
  6813 {
  6796 {
  6814 	EAP_TRACE_DEBUG(
  6797 	EAP_TRACE_DEBUG(
  6815 		m_am_tools,
  6798 		m_am_tools,
  6816 		TRACE_FLAGS_DEFAULT,
  6799 		TRACE_FLAGS_DEFAULT,