124 { |
124 { |
125 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("####################################################################\n"))); |
125 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("####################################################################\n"))); |
126 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
126 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
127 } |
127 } |
128 |
128 |
129 #if defined(EAPOL_SKIP_ETHERNET_HEADER) |
|
130 |
|
131 { |
|
132 eapol_header_wr_c eapol( |
|
133 m_am_tools, |
|
134 packet_data->get_header_buffer(packet_data->get_header_buffer_length()), |
|
135 packet_data->get_header_buffer_length()); |
|
136 if (eapol.get_is_valid() == false) |
|
137 { |
|
138 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
139 return EAP_STATUS_RETURN(m_am_tools, eap_status_header_corrupted); |
|
140 } |
|
141 |
|
142 status = m_eapol_core->packet_process( |
|
143 receive_network_id, |
|
144 &eapol, |
|
145 packet_length); |
|
146 |
|
147 EAP_GENERAL_HEADER_COPY_ERROR_PARAMETERS(packet_data, &eapol); |
|
148 |
|
149 EAP_TRACE_DEBUG( |
|
150 m_am_tools, |
|
151 TRACE_FLAGS_DEFAULT, |
|
152 (EAPL("####################################################################\n"))); |
|
153 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
154 return EAP_STATUS_RETURN(m_am_tools, status); |
|
155 } |
|
156 |
|
157 #else |
|
158 |
|
159 if (packet_length < eapol_ethernet_header_rd_c::get_header_length()) |
129 if (packet_length < eapol_ethernet_header_rd_c::get_header_length()) |
160 { |
130 { |
161 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("####################################################################\n"))); |
131 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("####################################################################\n"))); |
162 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
132 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
163 return EAP_STATUS_RETURN(m_am_tools, eap_status_process_illegal_packet_error); |
133 return EAP_STATUS_RETURN(m_am_tools, eap_status_process_illegal_packet_error); |
383 u32_t * const MTU, |
329 u32_t * const MTU, |
384 u32_t * const trailer_length) |
330 u32_t * const trailer_length) |
385 { |
331 { |
386 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
332 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
387 |
333 |
388 #if defined(EAPOL_SKIP_ETHERNET_HEADER) |
|
389 |
|
390 const u32_t offset = m_partner->get_header_offset(MTU, trailer_length); |
|
391 |
|
392 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
393 return offset; |
|
394 |
|
395 #else |
|
396 |
|
397 const u32_t offset = m_partner->get_header_offset(MTU, trailer_length); |
334 const u32_t offset = m_partner->get_header_offset(MTU, trailer_length); |
398 (*MTU) -= eapol_ethernet_header_wr_c::get_header_length(); |
335 (*MTU) -= eapol_ethernet_header_wr_c::get_header_length(); |
399 |
336 |
400 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
337 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
401 return offset+eapol_ethernet_header_wr_c::get_header_length(); |
338 return offset+eapol_ethernet_header_wr_c::get_header_length(); |
402 |
|
403 #endif //#if defined(EAPOL_SKIP_ETHERNET_HEADER) |
|
404 } |
339 } |
405 |
340 |
406 //-------------------------------------------------- |
341 //-------------------------------------------------- |
407 |
342 |
408 // |
343 // |
510 } |
445 } |
511 |
446 |
512 //-------------------------------------------------- |
447 //-------------------------------------------------- |
513 |
448 |
514 // |
449 // |
515 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::read_reassociation_parameters( |
450 eap_status_e ethernet_core_c::read_reassociation_parameters( |
516 const eap_am_network_id_c * const old_receive_network_id, ///< source includes remote address, destination includes local address. |
451 const eap_am_network_id_c * const old_receive_network_id, ///< source includes remote address, destination includes local address. |
517 const eap_am_network_id_c * const new_receive_network_id, ///< source includes remote address, destination includes local address. |
452 const eap_am_network_id_c * const new_receive_network_id, ///< source includes remote address, destination includes local address. |
518 const eapol_key_authentication_type_e authentication_type, |
453 const eapol_key_authentication_type_e authentication_type, |
519 eap_variable_data_c * const PMKID, |
454 eap_variable_data_c * const PMKID, |
520 const eap_variable_data_c * const received_WPA_ie, |
455 const eap_variable_data_c * const received_WPA_ie, |
564 } |
499 } |
565 |
500 |
566 //-------------------------------------------------- |
501 //-------------------------------------------------- |
567 |
502 |
568 // |
503 // |
569 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::complete_reassociation( |
504 eap_status_e ethernet_core_c::complete_reassociation( |
570 const eapol_wlan_authentication_state_e reassociation_result, |
505 const eapol_wlan_authentication_state_e reassociation_result, |
571 const eap_am_network_id_c * const receive_network_id, |
506 const eap_am_network_id_c * const receive_network_id, |
572 const eapol_key_authentication_type_e authentication_type, |
507 const eapol_key_authentication_type_e authentication_type, |
573 const eap_variable_data_c * const received_WPA_IE, // WLM must give only the WPA IE to EAPOL |
508 const eap_variable_data_c * const received_WPA_IE, // WLM must give only the WPA IE to EAPOL |
574 const eap_variable_data_c * const sent_WPA_IE, |
509 const eap_variable_data_c * const sent_WPA_IE, |
952 pre_shared_key); |
898 pre_shared_key); |
953 |
899 |
954 return EAP_STATUS_RETURN(m_am_tools, status); |
900 return EAP_STATUS_RETURN(m_am_tools, status); |
955 } |
901 } |
956 |
902 |
957 //-------------------------------------------------- |
903 #endif // #if defined(USE_EAPOL_KEY_STATE) |
958 |
904 |
|
905 //-------------------------------------------------- |
|
906 |
|
907 #if defined(USE_EAPOL_KEY_STATE) |
959 /** |
908 /** |
960 * @param receive_network_id carries the MAC addresses. |
909 * @param receive_network_id carries the MAC addresses. |
961 * MAC address of Authenticator should be in source address. MAC address of Supplicant should be in destination address. |
910 * MAC address of Authenticator should be in source address. MAC address of Supplicant should be in destination address. |
962 */ |
911 */ |
963 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::disassociation( |
912 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::disassociation( |
964 const bool complete_to_lower_layer, |
|
965 const eap_am_network_id_c * const receive_network_id |
913 const eap_am_network_id_c * const receive_network_id |
966 ) |
914 ) |
967 { |
915 { |
968 eap_status_e status = eap_status_process_general_error; |
916 eap_status_e status = eap_status_process_general_error; |
969 |
917 |
970 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
918 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
971 |
919 |
972 status = m_eapol_core->disassociation( |
920 status = m_eapol_core->disassociation( |
973 complete_to_lower_layer, |
|
974 receive_network_id); |
921 receive_network_id); |
975 |
922 |
976 return EAP_STATUS_RETURN(m_am_tools, status); |
923 return EAP_STATUS_RETURN(m_am_tools, status); |
977 } |
924 } |
|
925 |
|
926 #endif //#if defined(USE_EAPOL_KEY_STATE) |
978 |
927 |
979 //-------------------------------------------------- |
928 //-------------------------------------------------- |
980 |
929 |
981 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::add_rogue_ap(eap_array_c<eap_rogue_ap_entry_c> & rogue_ap_list) |
930 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::add_rogue_ap(eap_array_c<eap_rogue_ap_entry_c> & rogue_ap_list) |
982 { |
931 { |
1006 return EAP_STATUS_RETURN(m_am_tools, status); |
955 return EAP_STATUS_RETURN(m_am_tools, status); |
1007 } |
956 } |
1008 |
957 |
1009 //-------------------------------------------------- |
958 //-------------------------------------------------- |
1010 |
959 |
1011 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::complete_check_pmksa_cache( |
|
1012 EAP_TEMPLATE_CONST eap_array_c<eap_am_network_id_c> * const bssid_sta_receive_network_ids) |
|
1013 { |
|
1014 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1015 |
|
1016 const eap_status_e status = m_partner->complete_check_pmksa_cache( |
|
1017 bssid_sta_receive_network_ids); |
|
1018 |
|
1019 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1020 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1021 } |
|
1022 |
|
1023 //-------------------------------------------------- |
|
1024 |
|
1025 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
1026 |
|
1027 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::save_simple_config_session( |
|
1028 const simple_config_state_e state, |
|
1029 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array, |
|
1030 const eap_variable_data_c * const new_password, |
|
1031 const simple_config_Device_Password_ID_e Device_Password_ID, |
|
1032 const simple_config_payloads_c * const other_configuration) |
|
1033 { |
|
1034 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1035 |
|
1036 EAP_TRACE_DEBUG( |
|
1037 m_am_tools, |
|
1038 TRACE_FLAGS_DEFAULT, |
|
1039 (EAPL("%s: ethernet_core_c::save_simple_config_session().\n"), |
|
1040 (m_is_client == true) ? "client": "server")); |
|
1041 |
|
1042 const eap_status_e status = m_partner->save_simple_config_session( |
|
1043 state, |
|
1044 credential_array, |
|
1045 new_password, |
|
1046 Device_Password_ID, |
|
1047 other_configuration); |
|
1048 |
|
1049 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1050 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1051 } |
|
1052 |
|
1053 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
1054 |
|
1055 //-------------------------------------------------- |
|
1056 |
|
1057 // |
|
1058 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::set_eap_database_reference_values( |
|
1059 const eap_variable_data_c * const reference) |
|
1060 { |
|
1061 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1062 |
|
1063 EAP_TRACE_DEBUG( |
|
1064 m_am_tools, |
|
1065 TRACE_FLAGS_DEFAULT, |
|
1066 (EAPL("ethernet_core_c::set_eap_database_reference_values()\n"))); |
|
1067 |
|
1068 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: ethernet_core_c::set_eap_database_reference_values()"); |
|
1069 |
|
1070 eap_status_e status = m_eapol_core->set_eap_database_reference_values(reference); |
|
1071 |
|
1072 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1073 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1074 } |
|
1075 |
|
1076 //-------------------------------------------------- |
|
1077 |
|
1078 // |
|
1079 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::get_802_11_authentication_mode( |
|
1080 const eap_am_network_id_c * const receive_network_id, |
|
1081 const eapol_key_authentication_type_e authentication_type, |
|
1082 const eap_variable_data_c * const SSID, |
|
1083 const eap_variable_data_c * const preshared_key) |
|
1084 { |
|
1085 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1086 |
|
1087 EAP_TRACE_DEBUG( |
|
1088 m_am_tools, |
|
1089 TRACE_FLAGS_DEFAULT, |
|
1090 (EAPL("ethernet_core_c::get_802_11_authentication_mode()\n"))); |
|
1091 |
|
1092 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: ethernet_core_c::get_802_11_authentication_mode()"); |
|
1093 |
|
1094 eap_status_e status = m_eapol_core->get_802_11_authentication_mode( |
|
1095 receive_network_id, |
|
1096 authentication_type, |
|
1097 SSID, |
|
1098 preshared_key); |
|
1099 |
|
1100 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1101 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1102 } |
|
1103 |
|
1104 //-------------------------------------------------- |
|
1105 |
|
1106 // |
|
1107 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::complete_get_802_11_authentication_mode( |
|
1108 const eap_status_e completion_status, |
|
1109 const eap_am_network_id_c * const receive_network_id, |
|
1110 const eapol_key_802_11_authentication_mode_e mode) |
|
1111 { |
|
1112 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1113 |
|
1114 EAP_TRACE_DEBUG( |
|
1115 m_am_tools, |
|
1116 TRACE_FLAGS_DEFAULT, |
|
1117 (EAPL("ethernet_core_c::complete_get_802_11_authentication_mode()\n"))); |
|
1118 |
|
1119 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: ethernet_core_c::complete_get_802_11_authentication_mode()"); |
|
1120 |
|
1121 eap_status_e status(eap_status_ok); |
|
1122 |
|
1123 if (m_partner != 0) |
|
1124 { |
|
1125 status = m_partner->complete_get_802_11_authentication_mode( |
|
1126 completion_status, |
|
1127 receive_network_id, |
|
1128 mode); |
|
1129 } |
|
1130 |
|
1131 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1132 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1133 } |
|
1134 |
|
1135 //-------------------------------------------------- |
|
1136 |
|
1137 // |
|
1138 EAP_FUNC_EXPORT eap_status_e ethernet_core_c::complete_disassociation( |
|
1139 const bool complete_to_lower_layer, |
|
1140 const eap_am_network_id_c * const receive_network_id) |
|
1141 { |
|
1142 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1143 |
|
1144 EAP_TRACE_DEBUG( |
|
1145 m_am_tools, |
|
1146 TRACE_FLAGS_DEFAULT, |
|
1147 (EAPL("ethernet_core_c::complete_disassociation()\n"))); |
|
1148 |
|
1149 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: ethernet_core_c::complete_disassociation()"); |
|
1150 |
|
1151 eap_status_e status(eap_status_ok); |
|
1152 |
|
1153 if (m_partner != 0) |
|
1154 { |
|
1155 status = m_partner->complete_disassociation( |
|
1156 complete_to_lower_layer, |
|
1157 receive_network_id); |
|
1158 } |
|
1159 |
|
1160 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1161 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1162 } |
|
1163 |
|
1164 //-------------------------------------------------- |
|
1165 // End. |
960 // End. |