eapol/eapol_framework/eapol_common/include/eapol_key_types.h
changeset 0 c8830336c852
child 2 1c7bc153c08e
equal deleted inserted replaced
-1:000000000000 0:c8830336c852
       
     1 /*
       
     2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  EAP and WLAN authentication protocols.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #if !defined(_EAPOL_KEY_TYPES_H_)
       
    21 #define _EAPOL_KEY_TYPES_H_
       
    22 
       
    23 #include "eap_configuration_field.h"
       
    24 
       
    25 //--------------------------------------------------------------------------------------------------
       
    26 
       
    27 enum eapol_wpa_psk_constants_e
       
    28 {
       
    29 	EAPOL_WPA_PSK_LENGTH_BYTES = 32ul,
       
    30 };
       
    31 
       
    32 /**
       
    33  * Enumeration of EAPOL ethernet type.
       
    34  */
       
    35 enum eapol_ethernet_type_e
       
    36 {
       
    37 	eapol_ethernet_type_none              = 0,
       
    38 	eapol_ethernet_type_pae               = 0x888e, ///< Ethernet type Port Access Entity (PAE)
       
    39 	eapol_ethernet_type_preauthentication = 0x88c7, ///< Ethernet type Preauthentication
       
    40 #if defined(USE_WAPI_CORE)
       
    41 	eapol_ethernet_type_wapi              = 0x88b4, ///< Ethernet type WAPI
       
    42 #endif //#if defined(USE_WAPI_CORE)
       
    43 };
       
    44 
       
    45 /**
       
    46  * This is enumeration of key types.
       
    47  * NOTE, do not change the values, these are used in interface.
       
    48  * These values are used in for loop.
       
    49  */
       
    50 enum eapol_key_type_e
       
    51 {
       
    52 	eapol_key_type_broadcast = 0,
       
    53 	eapol_key_type_unicast = 1,
       
    54 #if defined(EAP_USE_WPXM)
       
    55 	eapol_key_type_wpxm_wpxk1 = 2,
       
    56 	eapol_key_type_wpxm_wpxk2 = 3,
       
    57 #endif //#if defined(EAP_USE_WPXM)
       
    58 	eapol_key_type_pmkid = 4,
       
    59 	eapol_key_type_last_type, ///< Keep this the last one.
       
    60 };
       
    61 
       
    62 /// Enumeration of RC4 Key flag field.
       
    63 /// NOTE, do not change the values, these are used in interface.
       
    64 enum eapol_RC4_key_flags_e
       
    65 {
       
    66 	eapol_RC4_key_flag_broadcast = 0,
       
    67 	eapol_RC4_key_flag_unicast = 1,
       
    68 	eapol_RC4_key_flag_none = 0xff
       
    69 };
       
    70 
       
    71 
       
    72 /// NOTE, do not change the values, these are used in interface.
       
    73 enum eapol_wlan_authentication_state_e
       
    74 {
       
    75 	eapol_wlan_authentication_state_none = 0, ///< Initial value.
       
    76 	eapol_wlan_authentication_state_association_ok = 1, ///< Successfull association.
       
    77 	eapol_wlan_authentication_state_this_ap_failed = 2, ///< Still other authentication could be tested.
       
    78 	eapol_wlan_authentication_state_failed_completely = 3, ///< No more options to try.
       
    79 	eapol_wlan_authentication_state_802_11_auth_algorithm_not_supported = 4,
       
    80 	eapol_wlan_authentication_state_authenticating = 5, ///< This is temporary build fix, do not use this anymore. Instead use eapol_wlan_authentication_state_eap_authentication_running or eapol_wlan_authentication_state_4_way_handshake_running. @{ remove after integrated with WLAN engine.}
       
    81 	eapol_wlan_authentication_state_eap_authentication_running = 6,
       
    82 	eapol_wlan_authentication_state_no_response = 7,
       
    83 	eapol_wlan_authentication_state_4_way_handshake_running = 8,
       
    84 	eapol_wlan_authentication_state_authentication_successfull = 9,
       
    85 	eapol_wlan_authentication_state_authentication_cancelled = 10, // When user cancels the password prompt.
       
    86 	eapol_wlan_authentication_state_immediate_reconnect = 11, ///< This was a provisioning of credentials. Immediately reconnect so the credentials can be used.
       
    87 #if defined(USE_WAPI_CORE)
       
    88 	eapol_wlan_authentication_state_wapi_authentication_running = 12,
       
    89 #endif //#if defined(USE_WAPI_CORE)
       
    90 };
       
    91 
       
    92 /**
       
    93  * This is enumeration of authentication types.
       
    94  * NOTE, do not change the values, these are used in interface.
       
    95  */
       
    96 enum eapol_key_authentication_type_e
       
    97 {
       
    98 	eapol_key_authentication_type_none = 0,
       
    99 	eapol_key_authentication_type_RSNA_EAP = 1,   ///< Authentication is RSNA 802.11i EAP-authentication, 4-Way, Group Key and STAKey Handshakes.
       
   100 	eapol_key_authentication_type_RSNA_PSK = 2,    ///< Authentication is RNSA 802.11i PSK (pre shared key), 4-Way and Group Key Handshakes.
       
   101 	eapol_key_authentication_type_WPA_EAP = 3,    ///< Authentication is WPA EAP-authentication, 4-Way and Group Key Handshakes.
       
   102 	eapol_key_authentication_type_WPA_PSK = 4,    ///< Authentication is WPA PSK (pre shared key), 4-Way and Group Key Handshakes.
       
   103 	eapol_key_authentication_type_802_1X = 5, ///< Authentication is dynamic WEP (802.1X). EAP-authentication with simple EAPOL RC4 key message.
       
   104 	eapol_key_authentication_type_WPXM = 6,    ///< Authentication is WPXM.
       
   105 	eapol_key_authentication_type_WFA_SC = 7,  ///< Authentication is Wi-Fi Alliance Simple Configure.
       
   106 #if defined(USE_WAPI_CORE)
       
   107 	eapol_key_authentication_type_WAI_PSK = 8,  ///< Authentication is WAI PSK.
       
   108 	eapol_key_authentication_type_WAI_certificate = 9,  ///< Authentication is WAI certificate.
       
   109 #endif //#if defined(USE_WAPI_CORE)
       
   110 };
       
   111 
       
   112 /**
       
   113  * This is enumeration of 802.11 authentication modes.
       
   114  * NOTE, do not change the values, these are used in interface.
       
   115  */
       
   116 enum eapol_key_802_11_authentication_mode_e
       
   117 {
       
   118 	eapol_key_802_11_authentication_mode_none = 0,
       
   119 	eapol_key_802_11_authentication_mode_open = 1,   ///< Authentication is 802.11 open authentication.
       
   120 	eapol_key_802_11_authentication_mode_shared = 2,    ///< Authentication is 802.11 shared authentication.
       
   121 	eapol_key_802_11_authentication_mode_leap = 3,    ///< Authentication is LEAP-authentication.
       
   122 };
       
   123 
       
   124 /**
       
   125  * This is enumeration of EAPOL handshake types.
       
   126  * NOTE, do not change the values, these are used in interface.
       
   127  */
       
   128 enum eapol_key_handshake_type_e
       
   129 {
       
   130 	eapol_key_handshake_type_none = 0,
       
   131 	eapol_key_handshake_type_4_way_handshake = 1,
       
   132 	eapol_key_handshake_type_group_key_handshake = 2,
       
   133 	eapol_key_handshake_type_STAKey_handshake = 3,
       
   134 	eapol_key_handshake_type_802_11i_handshake = 4,
       
   135 	eapol_key_handshake_type_dynamic_WEP = 5,
       
   136 #if defined(EAP_USE_WPXM)
       
   137 	eapol_key_handshake_type_WPXM_reassociation = 6,
       
   138 #endif //#if defined(EAP_USE_WPXM)
       
   139 #if defined(USE_WAPI_CORE)
       
   140 	eapol_key_handshake_type_wai_handshake = 7,
       
   141 #endif //#if defined(USE_WAPI_CORE)
       
   142 };
       
   143 
       
   144 /**
       
   145  * This is enumeration of EAPOL states.
       
   146  * NOTE, do not change the values, these are used in interface.
       
   147  */
       
   148 enum eapol_key_state_e
       
   149 {
       
   150 	eapol_key_state_none = 0,
       
   151 	
       
   152 	eapol_key_state_preauthenticated = 1,
       
   153 
       
   154 	eapol_key_state_eap_authentication_running = 2,
       
   155 
       
   156 	eapol_key_state_wait_4_way_handshake_start = 3,
       
   157 	eapol_key_state_wait_4_way_handshake_message_1 = 4,
       
   158 	eapol_key_state_wait_4_way_handshake_message_2 = 5,
       
   159 	eapol_key_state_wait_4_way_handshake_message_3 = 6,
       
   160 	eapol_key_state_wait_4_way_handshake_message_4 = 7,
       
   161 	eapol_key_state_4_way_handshake_running = 8,
       
   162 	eapol_key_state_4_way_handshake_failed = 9,
       
   163 	eapol_key_state_4_way_handshake_successfull = 10,
       
   164 
       
   165 	eapol_key_state_wait_group_key_handshake_message_1 = 11,
       
   166 	eapol_key_state_wait_group_key_handshake_message_2 = 12,
       
   167 	eapol_key_state_group_key_handshake_failed = 13,
       
   168 	eapol_key_state_group_key_handshake_successfull = 14,
       
   169 
       
   170 	eapol_key_state_wait_rc4_key_message = 15,
       
   171 
       
   172 	eapol_key_state_802_11i_authentication_terminated_unsuccessfull = 16,
       
   173 	eapol_key_state_802_11i_authentication_finished_successfull = 17,
       
   174 
       
   175 	eapol_key_state_reassociation_failed = 18,
       
   176 
       
   177 #if defined(EAP_USE_WPXM)
       
   178 	eapol_key_state_wpxm_reassociation_finished_successfull = 19,
       
   179 #endif //#if defined(EAP_USE_WPXM)
       
   180 
       
   181 #if defined(USE_WAPI_CORE)
       
   182 	eapol_key_state_wapi_authentication_terminated_unsuccessfull = 20,
       
   183 	eapol_key_state_wapi_authentication_finished_successfull = 21,
       
   184 	eapol_key_state_wapi_authentication_running = 22,
       
   185 #endif //#if defined(USE_WAPI_CORE)
       
   186 
       
   187 };
       
   188 
       
   189 /**
       
   190  * This is enumeration of authentication server.
       
   191  * NOTE, do not change the values, these are used in interface.
       
   192  */
       
   193 enum eapol_authentication_server_state_e
       
   194 {
       
   195 	eapol_authentication_server_state_none = 0,
       
   196 	eapol_authentication_server_state_authentication_successfull = 1,
       
   197 };
       
   198 
       
   199 //--------------------------------------------------------------------------------------------------
       
   200 
       
   201 /**
       
   202  *  @defgroup EAPOL_key_state_config_options Configuration options of EAPOL Key State.
       
   203  *  The following configuration options are read through abs_eap_base_type_c::read_configure() function.
       
   204  *  @{
       
   205  */
       
   206 
       
   207 /**
       
   208  *  This is u32_t configuration option.
       
   209  *  This is the maximum count EAPOL key state Authenticator resents EAPOL-Key message again.
       
   210  *  This is used in simulator testing.
       
   211  */
       
   212 EAP_CONFIGURATION_FIELD(
       
   213 	cf_str_EAPOL_key_state_retransmission_counter,
       
   214 	"EAPOL_key_state_retransmission_counter",
       
   215 	eap_configure_type_u32_t,
       
   216 	false);
       
   217 
       
   218 /**
       
   219  *  This is u32_t configuration option.
       
   220  *  This is the time after EAPOL ket state Authenticator resents message again.
       
   221  *  Time is in milli seconds.
       
   222  *  This is used in simulator testing.
       
   223  */
       
   224 EAP_CONFIGURATION_FIELD(
       
   225 	cf_str_EAPOL_key_state_retransmission_time,
       
   226 	"EAPOL_key_state_retransmission_time",
       
   227 	eap_configure_type_u32_t,
       
   228 	false);
       
   229 
       
   230 /**
       
   231  *  This is u32_t configuration option.
       
   232  *  This is the maximum time EAPOL-Key Handshake could succeed.
       
   233  *  EAPOL-Key Handshake is terminated after this time elapses.
       
   234  *  Time is in milli seconds.
       
   235  */
       
   236 EAP_CONFIGURATION_FIELD(
       
   237 	cf_str_EAPOL_key_state_handshake_timeout,
       
   238 	"EAPOL_key_state_handshake_timeout",
       
   239 	eap_configure_type_u32_t,
       
   240 	false);
       
   241 
       
   242 #if defined(EAP_USE_WPXM)
       
   243 /**
       
   244  *  This is u32_t configuration option.
       
   245  *  This is the maximum time WPXM reassociation could succeed.
       
   246  *  WPXM reassociation is terminated after this time elapses.
       
   247  *  Time is in milli seconds.
       
   248  */
       
   249 EAP_CONFIGURATION_FIELD(
       
   250 	cf_str_EAPOL_key_state_wpxm_reassociate_timeout,
       
   251 	"EAPOL_key_state_wpxm_reassociate_timeout",
       
   252 	eap_configure_type_u32_t,
       
   253 	false);
       
   254 #endif //#if defined(EAP_USE_WPXM)
       
   255 
       
   256 /**
       
   257  *  This is u32_t configuration option.
       
   258  *  This is the maximum time EAPOL-Key PMKSA is cached.
       
   259  *  Time is in milli seconds.
       
   260  */
       
   261 EAP_CONFIGURATION_FIELD(
       
   262 	cf_str_EAPOL_key_state_pmksa_caching_timeout,
       
   263 	"EAPOL_key_state_pmksa_caching_timeout",
       
   264 	eap_configure_type_u32_t,
       
   265 	false);
       
   266 
       
   267 /**
       
   268  *  This string configuration option value selects the test authentication and key management.
       
   269  */
       
   270 EAP_CONFIGURATION_FIELD(
       
   271 	cf_str_EAPOL_key_authentication_type,
       
   272 	"EAPOL_key_authentication_type",
       
   273 	eap_configure_type_string,
       
   274 	false);
       
   275 
       
   276 EAP_CONFIGURATION_FIELD(
       
   277 	cf_str_EAPOL_key_authentication_type_config_value_RSNA_EAP,
       
   278 	"RSNA_EAP",
       
   279 	eap_configure_type_string,
       
   280 	false);
       
   281 
       
   282 EAP_CONFIGURATION_FIELD(
       
   283 	cf_str_EAPOL_key_authentication_type_config_value_RSNA_PSK,
       
   284 	"RSNA_PSK",
       
   285 	eap_configure_type_string,
       
   286 	false);
       
   287 
       
   288 EAP_CONFIGURATION_FIELD(
       
   289 	cf_str_EAPOL_key_authentication_type_config_value_WPA_EAP,
       
   290 	"WPA_EAP",
       
   291 	eap_configure_type_string,
       
   292 	false);
       
   293 
       
   294 EAP_CONFIGURATION_FIELD(
       
   295 	cf_str_EAPOL_key_authentication_type_config_value_WPA_PSK,
       
   296 	"WPA_PSK",
       
   297 	eap_configure_type_string,
       
   298 	false);
       
   299 
       
   300 EAP_CONFIGURATION_FIELD(
       
   301 	cf_str_EAPOL_key_authentication_type_config_value_dynamic_WEP,
       
   302 	"dynamic_WEP",
       
   303 	eap_configure_type_string,
       
   304 	false);
       
   305 
       
   306 #if defined(EAP_USE_WPXM)
       
   307 EAP_CONFIGURATION_FIELD(
       
   308 	cf_str_EAPOL_key_authentication_type_config_value_WPXM,
       
   309 	"WPXM",
       
   310 	eap_configure_type_string,
       
   311 	false);
       
   312 #endif //#if defined(EAP_USE_WPXM)
       
   313 
       
   314 #if defined(EAP_USE_WPXM)
       
   315 EAP_CONFIGURATION_FIELD(
       
   316 	cf_str_EAPOL_WPXM_type,
       
   317 	"EAPOL_WPXM_type",
       
   318 	eap_configure_type_string,
       
   319 	false);
       
   320 #endif //#if defined(EAP_USE_WPXM)
       
   321 
       
   322 EAP_CONFIGURATION_FIELD(
       
   323 	cf_str_EAPOL_key_authentication_type_config_value_WFA_SC,
       
   324 	"WFA_SC",
       
   325 	eap_configure_type_string,
       
   326 	false);
       
   327 
       
   328 EAP_CONFIGURATION_FIELD(
       
   329 	cf_str_EAPOL_key_authentication_type_config_value_WAI_PSK,
       
   330 	"WAI_PSK",
       
   331 	eap_configure_type_string,
       
   332 	false);
       
   333 
       
   334 EAP_CONFIGURATION_FIELD(
       
   335 	cf_str_EAPOL_key_authentication_type_config_value_WAI_certificate,
       
   336 	"WAI_certificate",
       
   337 	eap_configure_type_string,
       
   338 	false);
       
   339 
       
   340 
       
   341 /**
       
   342  *  This string configuration option value selects the test pairwise cipher.
       
   343  */
       
   344 EAP_CONFIGURATION_FIELD(
       
   345 	cf_str_EAPOL_key_pairwise_cipher,
       
   346 	"EAPOL_key_pairwise_cipher",
       
   347 	eap_configure_type_string,
       
   348 	false);
       
   349 
       
   350 /**
       
   351  *  This string configuration option value selects the test group cipher.
       
   352  */
       
   353 EAP_CONFIGURATION_FIELD(
       
   354 	cf_str_EAPOL_key_group_cipher,
       
   355 	"EAPOL_key_group_cipher",
       
   356 	eap_configure_type_string,
       
   357 	false);
       
   358 
       
   359 EAP_CONFIGURATION_FIELD(
       
   360 	cf_str_EAPOL_key_cipher_CCMP,
       
   361 	"CCMP",
       
   362 	eap_configure_type_string,
       
   363 	false);
       
   364 
       
   365 EAP_CONFIGURATION_FIELD(
       
   366 	cf_str_EAPOL_key_cipher_TKIP,
       
   367 	"TKIP",
       
   368 	eap_configure_type_string,
       
   369 	false);
       
   370 
       
   371 
       
   372 /**
       
   373  *  This is boolean configuration option.
       
   374  *  This flag tells whether broken 4-Way Handshake message 1 without PMKID is allowed (true) or dropped (false).
       
   375  *  Default value id false.
       
   376  */
       
   377 EAP_CONFIGURATION_FIELD(
       
   378 	cf_str_EAPOL_key_state_allow_missing_PMKID_in_message_1,
       
   379 	"EAPOL_key_state_allow_missing_PMKID_in_message_1",
       
   380 	eap_configure_type_boolean,
       
   381 	false);
       
   382 
       
   383 /**
       
   384  *  This is boolean configuration option.
       
   385  *  This flag tells whether broken 4-Way Handshake message 1 without PMKID is created (true) or not (false).
       
   386  *  Default value id false.
       
   387  */
       
   388 EAP_CONFIGURATION_FIELD(
       
   389 	cf_str_EAPOL_key_state_skip_PMKID_key_data_in_message_1,
       
   390 	"EAPOL_key_state_skip_PMKID_key_data_in_message_1",
       
   391 	eap_configure_type_boolean,
       
   392 	false);
       
   393 
       
   394 /**
       
   395  *  This is boolean configuration option.
       
   396  *  This flag activates group key update test (true) or not (false).
       
   397  *  Default value id false.
       
   398  */
       
   399 EAP_CONFIGURATION_FIELD(
       
   400 	cf_str_EAPOL_key_state_TEST_group_key_update,
       
   401 	"EAPOL_key_state_TEST_group_key_update",
       
   402 	eap_configure_type_boolean,
       
   403 	false);
       
   404 
       
   405 
       
   406 /**
       
   407  *  This is boolean configuration option.
       
   408  *  This flag tells whether broken 4-Way Handshake message 1 with non zero MIC is allowed (true) or dropped (false).
       
   409  *  Default value id false.
       
   410  */
       
   411 EAP_CONFIGURATION_FIELD(
       
   412 	cf_str_EAPOL_key_state_allow_non_zero_mic_in_message_1,
       
   413 	"EAPOL_key_state_allow_non_zero_mic_in_message_1",
       
   414 	eap_configure_type_boolean,
       
   415 	false);
       
   416 
       
   417 /**
       
   418  *  This is boolean configuration option.
       
   419  *  This flag tells the EAPOL must indicate PMKID to lower layers (true) or not (false).
       
   420  *  Default value id false.
       
   421  */
       
   422 EAP_CONFIGURATION_FIELD(
       
   423 	cf_str_EAPOL_key_state_indicate_pmkid_to_lower_layer,
       
   424 	"EAPOL_key_state_indicate_pmkid_to_lower_layer",
       
   425 	eap_configure_type_boolean,
       
   426 	false);
       
   427 
       
   428 /** @} */ // End of group EAPOK_key_state_config_options.
       
   429 
       
   430 //--------------------------------------------------------------------------------------------------
       
   431 
       
   432 #endif //#if !defined(_EAPOL_KEY_TYPES_)