eapol/eapol_framework/eapol_common/core/eap_core.cpp
changeset 49 43351a4f2da3
parent 34 ad1f037f1ac2
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    14 * Description:  EAP and WLAN authentication protocols.
    14 * Description:  EAP and WLAN authentication protocols.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 58.1.12 %
    19 * %version: 58.1.15 %
    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
   386 		#if defined(USE_EAP_CORE_SIMULATOR_VERSION)
   386 		#if defined(USE_EAP_CORE_SIMULATOR_VERSION)
   387 
   387 
   388 			EAP_TRACE_DEBUG(
   388 			EAP_TRACE_DEBUG(
   389 				m_am_tools,
   389 				m_am_tools,
   390 				TRACE_FLAGS_DEFAULT,
   390 				TRACE_FLAGS_DEFAULT,
   391 				(EAPL("eap_core_c::state_notification(): %s, %s, Ignored notification: ")
   391 				(EAPL("eap_core_c::init_end_of_session(): %s, %s, Ignored notification: ")
   392 				 EAPL("Protocol layer %d, EAP-type 0x%02x, State transition from ")
   392 				 EAPL("Protocol layer %d, EAP-type 0x%02x, State transition from ")
   393 				 EAPL("%d=%s to %d=%s, client %d.\n"),
   393 				 EAPL("%d=%s to %d=%s, client %d.\n"),
   394 				 (m_is_client == true) ? "client": "server",
   394 				 (m_is_client == true) ? "client": "server",
   395 				 (m_is_tunneled_eap == true) ? "tunneled": "outer most",
   395 				 (m_is_tunneled_eap == true) ? "tunneled": "outer most",
   396 				 state->get_protocol_layer(), 
   396 				 state->get_protocol_layer(), 
   414 	else
   414 	else
   415 	{
   415 	{
   416 		EAP_TRACE_DEBUG(
   416 		EAP_TRACE_DEBUG(
   417 			m_am_tools,
   417 			m_am_tools,
   418 			TRACE_FLAGS_DEFAULT,
   418 			TRACE_FLAGS_DEFAULT,
   419 			(EAPL("eap_core_c::state_notification(): %s, %s, Ignored notification: ")
   419 			(EAPL("eap_core_c::init_end_of_session(): %s, %s, Ignored notification: ")
   420 			 EAPL("Protocol layer %d, EAP-type 0x%02x, State transition from ")
   420 			 EAPL("Protocol layer %d, EAP-type 0x%02x, State transition from ")
   421 			 EAPL("%d=%s to %d=%s, client %d when shutdown was called.\n"),
   421 			 EAPL("%d=%s to %d=%s, client %d when shutdown was called.\n"),
   422 			 (m_is_client == true) ? "client": "server",
   422 			 (m_is_client == true) ? "client": "server",
   423 			 (m_is_tunneled_eap == true) ? "tunneled": "outer most",
   423 			 (m_is_tunneled_eap == true) ? "tunneled": "outer most",
   424 			 state->get_protocol_layer(), 
   424 			 state->get_protocol_layer(), 
   469 		state->get_current_state(),
   469 		state->get_current_state(),
   470 		state->get_current_state_string(),
   470 		state->get_current_state_string(),
   471 		state->get_authentication_error(),
   471 		state->get_authentication_error(),
   472 		status_string.get_status_string(state->get_authentication_error())));
   472 		status_string.get_status_string(state->get_authentication_error())));
   473 
   473 
       
   474 	EAP_TRACE_DEBUG(
       
   475 		m_am_tools, 
       
   476 		TRACE_FLAGS_DEFAULT, 
       
   477 		(EAPL("eap_core_c::state_notification(), %s, %s, m_eap_identity_request_send=%d, m_eap_identity_response_received=%d.\n"),
       
   478 		(m_is_client == true) ? "client": "server",
       
   479 		(m_is_tunneled_eap == true) ? "tunneled": "outer most",
       
   480 		m_eap_identity_request_send,
       
   481 		m_eap_identity_response_received));
       
   482 
       
   483 	EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_core_c::state_notification()");
       
   484 
   474 	if (m_ignore_notifications == true
   485 	if (m_ignore_notifications == true
   475 		|| m_partner == 0)
   486 		|| m_partner == 0)
   476 	{
   487 	{
   477 		return;
   488 		return;
   478 	}
   489 	}
   481 	if (state->get_protocol_layer() == eap_protocol_layer_general)
   492 	if (state->get_protocol_layer() == eap_protocol_layer_general)
   482 	{
   493 	{
   483 		 // These notications are allowed always.
   494 		 // These notications are allowed always.
   484 	}
   495 	}
   485 	else if (state->get_protocol_layer() == eap_protocol_layer_eap
   496 	else if (state->get_protocol_layer() == eap_protocol_layer_eap
   486 		&& state->get_eap_type() != m_current_eap_type)
   497 		&& state->get_eap_type() != m_current_eap_type
       
   498 		&& m_is_client == false)
   487 	{
   499 	{
   488 		EAP_TRACE_DEBUG(
   500 		EAP_TRACE_DEBUG(
   489 			m_am_tools,
   501 			m_am_tools,
   490 			TRACE_FLAGS_DEFAULT,
   502 			TRACE_FLAGS_DEFAULT,
   491 			(EAPL("eap_core_c::state_notification(): %s, %s, Ignored notification: ")
   503 			(EAPL("eap_core_c::state_notification(): %s, %s, Ignored notification: ")
  3235 		state_notification(&notification);
  3247 		state_notification(&notification);
  3236 	}
  3248 	}
  3237 
  3249 
  3238 	eap_status_e status = m_type_map.for_each(shutdown_operation, true);
  3250 	eap_status_e status = m_type_map.for_each(shutdown_operation, true);
  3239 
  3251 
       
  3252 	m_type_map.reset();
  3240 
  3253 
  3241 	cancel_retransmission();
  3254 	cancel_retransmission();
  3242 
  3255 
  3243 	cancel_session_timeout();
  3256 	cancel_session_timeout();
  3244 
  3257