eapol/eapol_framework/eapol_common/type/tls_peap/tls/src/tls_record.cpp
changeset 34 ad1f037f1ac2
parent 26 9abfd4f00d37
child 49 43351a4f2da3
equal deleted inserted replaced
31:372d2d6c5cf9 34:ad1f037f1ac2
    14 * Description:  EAP and WLAN authentication protocols.
    14 * Description:  EAP and WLAN authentication protocols.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 195 %
    19 * %version: 197 %
    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
    58 
    58 
    59 #define EAP_STATUS_RETURN_AND_CREATE_TLS_PROTOCOL_ALERT(tools, status) \
    59 #define EAP_STATUS_RETURN_AND_CREATE_TLS_PROTOCOL_ALERT(tools, status) \
    60 	EAP_STATUS_RETURN(tools, eap_status_return_and_create_tls_protocol_alert((status)))
    60 	EAP_STATUS_RETURN(tools, eap_status_return_and_create_tls_protocol_alert((status)))
    61 
    61 
    62 
    62 
    63 eap_status_e tls_record_c::eap_status_return_and_create_tls_protocol_alert(
    63 EAP_FUNC_EXPORT eap_status_e tls_record_c::eap_status_return_and_create_tls_protocol_alert(
    64 	const eap_status_e status)
    64 	const eap_status_e status)
    65 {
    65 {
    66 	if (status != eap_status_ok
    66 	if (status != eap_status_ok
    67 		&& status != eap_status_success
    67 		&& status != eap_status_success
    68 		&& status != eap_status_pending_request
    68 		&& status != eap_status_pending_request
   271 		 this,
   271 		 this,
   272 		 (m_is_client == true ? "client": "server")));
   272 		 (m_is_client == true ? "client": "server")));
   273 
   273 
   274 	EAP_TRACE_RETURN_STRING(m_am_tools, "returns: tls_record_c::tls_record_c()");
   274 	EAP_TRACE_RETURN_STRING(m_am_tools, "returns: tls_record_c::tls_record_c()");
   275 
   275 
       
   276 #if defined(USE_FAST_EAP_TYPE)
       
   277 	EAP_TRACE_DEBUG(
       
   278 		m_am_tools,
       
   279 		TRACE_FLAGS_DEFAULT,
       
   280 		(EAPL("TLS: tls_record_c::tls_record_c(): EAP-FAST enabled.")));
       
   281 #else
       
   282 	EAP_TRACE_DEBUG(
       
   283 		m_am_tools,
       
   284 		TRACE_FLAGS_DEFAULT,
       
   285 		(EAPL("TLS: tls_record_c::tls_record_c(): EAP-FAST disabled.")));
       
   286 #endif //#if defined(USE_FAST_EAP_TYPE)
       
   287 
   276 	if (receive_network_id == 0
   288 	if (receive_network_id == 0
   277 		|| receive_network_id->get_is_valid_data() == false)
   289 		|| receive_network_id->get_is_valid_data() == false)
   278 	{
   290 	{
   279 		// No need to delete anything here because it is done in destructor.
   291 		// No need to delete anything here because it is done in destructor.
   280 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
   292 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
  1188 	return EAP_STATUS_RETURN(m_am_tools, status);
  1200 	return EAP_STATUS_RETURN(m_am_tools, status);
  1189 }
  1201 }
  1190 
  1202 
  1191 //--------------------------------------------------
  1203 //--------------------------------------------------
  1192 
  1204 
  1193 void tls_record_c::send_error_notification(const eap_status_e error)
  1205 EAP_FUNC_EXPORT void tls_record_c::send_error_notification(const eap_status_e error)
  1194 {
  1206 {
  1195 	// Notifies the lower level of an authentication error.
  1207 	// Notifies the lower level of an authentication error.
  1196 
  1208 
  1197 	eap_general_state_variable_e general_state_variable(eap_general_state_authentication_error);
  1209 	eap_general_state_variable_e general_state_variable(eap_general_state_authentication_error);
  1198 
  1210