354 = eapol_RSNA_key_header_c::get_header_length() |
354 = eapol_RSNA_key_header_c::get_header_length() |
355 + m_authenticator_RSNA_IE.get_data_length(); |
355 + m_authenticator_RSNA_IE.get_data_length(); |
356 |
356 |
357 u32_t extra_encryption_padding_and_block(0ul); |
357 u32_t extra_encryption_padding_and_block(0ul); |
358 |
358 |
359 if (m_eapol_pairwise_cipher == eapol_RSNA_key_header_c::eapol_RSNA_cipher_CCMP |
359 //if (m_eapol_pairwise_cipher == eapol_RSNA_key_header_c::eapol_RSNA_cipher_CCMP |
360 || m_eapol_group_cipher == eapol_RSNA_key_header_c::eapol_RSNA_cipher_CCMP) |
360 // || m_eapol_group_cipher == eapol_RSNA_key_header_c::eapol_RSNA_cipher_CCMP) |
361 { |
361 { |
362 extra_encryption_padding_and_block = 2ul * EAP_CRYPTO_AES_WRAP_BLOCK_SIZE; |
362 extra_encryption_padding_and_block = 2ul * EAP_CRYPTO_AES_WRAP_BLOCK_SIZE; |
363 } |
363 } |
364 |
364 |
365 if ((get_is_RSNA() == true |
365 if ((get_is_RSNA() == true |
976 // OK, we need 4-Way Handshake. |
976 // OK, we need 4-Way Handshake. |
977 EAP_TRACE_DEBUG( |
977 EAP_TRACE_DEBUG( |
978 m_am_tools, |
978 m_am_tools, |
979 TRACE_FLAGS_DEFAULT, |
979 TRACE_FLAGS_DEFAULT, |
980 (EAPL("EAPOL_KEY: %s: eapol_key_state_c::start_4_way_handshake(): ") |
980 (EAPL("EAPOL_KEY: %s: eapol_key_state_c::start_4_way_handshake(): ") |
981 EAPL("Start 4-Way Handshake, m_authentication_type=%d\n"), |
981 EAPL("Start 4-Way Handshake, m_authentication_type=%d=%s\n"), |
982 (m_is_client == true ? "client": "server"), |
982 (m_is_client == true ? "client": "server"), |
983 m_authentication_type)); |
983 m_authentication_type, |
984 } |
984 eapol_key_state_string_c::get_eapol_key_authentication_type_string(m_authentication_type))); |
985 else if (m_authentication_type == eapol_key_authentication_type_802_1X) |
985 } |
|
986 else if (m_authentication_type == eapol_key_authentication_type_dynamic_WEP |
|
987 || m_authentication_type == eapol_key_authentication_type_EAP_authentication_no_encryption |
|
988 ) |
986 { |
989 { |
987 // No 4-Way Handshake needed. |
990 // No 4-Way Handshake needed. |
988 // AP will send unicast and broad cast keys in EAPOL key messages. |
991 // AP will send unicast and broad cast keys in EAPOL key messages. |
989 EAP_TRACE_DEBUG( |
992 EAP_TRACE_DEBUG( |
990 m_am_tools, |
993 m_am_tools, |
991 TRACE_FLAGS_DEFAULT, |
994 TRACE_FLAGS_DEFAULT, |
992 (EAPL("EAPOL_KEY: %s: eapol_key_state_c::start_4_way_handshake(): ") |
995 (EAPL("EAPOL_KEY: %s: eapol_key_state_c::start_4_way_handshake(): ") |
993 EAPL("Dynamic WEP, m_authentication_type=%d\n"), |
996 EAPL("Dynamic WEP, m_authentication_type=%d=%s\n"), |
994 (m_is_client == true ? "client": "server"), |
997 (m_is_client == true ? "client": "server"), |
995 m_authentication_type)); |
998 m_authentication_type, |
|
999 eapol_key_state_string_c::get_eapol_key_authentication_type_string(m_authentication_type))); |
996 |
1000 |
997 m_eapol_key_handshake_type = eapol_key_handshake_type_dynamic_WEP; |
1001 m_eapol_key_handshake_type = eapol_key_handshake_type_dynamic_WEP; |
998 |
1002 |
999 send_RC4_eapol_key_messages(); |
1003 send_RC4_eapol_key_messages(); |
1000 |
1004 |
1006 // No 4-Way Handshake needed. |
1010 // No 4-Way Handshake needed. |
1007 EAP_TRACE_DEBUG( |
1011 EAP_TRACE_DEBUG( |
1008 m_am_tools, |
1012 m_am_tools, |
1009 TRACE_FLAGS_DEFAULT, |
1013 TRACE_FLAGS_DEFAULT, |
1010 (EAPL("EAPOL_KEY: %s: eapol_key_state_c::start_4_way_handshake(): ") |
1014 (EAPL("EAPOL_KEY: %s: eapol_key_state_c::start_4_way_handshake(): ") |
1011 EAPL("No 4-Way Handshake, m_authentication_type=%d\n"), |
1015 EAPL("No 4-Way Handshake, m_authentication_type=%d=%s\n"), |
1012 (m_is_client == true ? "client": "server"), |
1016 (m_is_client == true ? "client": "server"), |
1013 m_authentication_type)); |
1017 m_authentication_type, |
|
1018 eapol_key_state_string_c::get_eapol_key_authentication_type_string(m_authentication_type))); |
1014 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1019 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1015 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
1020 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
1016 } |
1021 } |
1017 |
1022 |
1018 if (m_eapol_key_handshake_type != eapol_key_handshake_type_none |
1023 if (m_eapol_key_handshake_type != eapol_key_handshake_type_none |
|
1024 && m_eapol_key_handshake_type != eapol_key_handshake_type_authenticated |
1019 && m_eapol_key_handshake_type != eapol_key_handshake_type_4_way_handshake) |
1025 && m_eapol_key_handshake_type != eapol_key_handshake_type_4_way_handshake) |
1020 { |
1026 { |
1021 eapol_key_state_string_c state_string; |
1027 eapol_key_state_string_c state_string; |
1022 EAP_TRACE_ERROR( |
1028 EAP_TRACE_ERROR( |
1023 m_am_tools, |
1029 m_am_tools, |
1024 TRACE_FLAGS_DEFAULT, |
1030 TRACE_FLAGS_DEFAULT, |
1025 (EAPL("WARNING: EAPOL_KEY: %s: start_4_way_handshake(): wrong handshake type %s\n"), |
1031 (EAPL("WARNING: EAPOL_KEY: %s: start_4_way_handshake(): wrong handshake type m_eapol_key_handshake_type=%d=%s\n"), |
1026 (m_is_client == true ? "client": "server"), |
1032 (m_is_client == true ? "client": "server"), |
|
1033 m_eapol_key_handshake_type, |
1027 state_string.get_eapol_key_handshake_type_string(m_eapol_key_handshake_type))); |
1034 state_string.get_eapol_key_handshake_type_string(m_eapol_key_handshake_type))); |
1028 |
1035 |
1029 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1036 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1030 return EAP_STATUS_RETURN(m_am_tools, eap_status_wrong_eap_type_state); |
1037 return EAP_STATUS_RETURN(m_am_tools, eap_status_wrong_eap_type_state); |
1031 } |
1038 } |