eapol/eapol_framework/eapol_symbian/am/include/eap_am_type_gsmsim_symbian_simulator.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 
       
    21 #if !defined(_EAP_AM_TYPE_GSMSIM_SYMBIAN_SIMULATOR_H_)
       
    22 #define _EAP_AM_TYPE_GSMSIM_SYMBIAN_SIMULATOR_H_
       
    23 
       
    24 #include "eap_tools.h"
       
    25 #include "eap_am_export.h"
       
    26 #include "abs_eap_base_type.h"
       
    27 #include "eap_am_type_gsmsim.h"
       
    28 #include "EapPluginInterface.h"
       
    29 
       
    30 // 
       
    31 class EAP_EXPORT eap_am_type_gsmsim_simulator_c
       
    32 : public eap_am_type_gsmsim_c
       
    33 {
       
    34 private:
       
    35 	//--------------------------------------------------
       
    36 
       
    37 	abs_eap_am_tools_c * const m_am_tools;
       
    38 
       
    39 	abs_eap_base_type_c * const m_partner;
       
    40 
       
    41 	eap_variable_data_c saved_pseudonym;
       
    42 
       
    43 	bool m_is_valid;
       
    44 
       
    45 	//--------------------------------------------------
       
    46 protected:
       
    47 	//--------------------------------------------------
       
    48 
       
    49 	//--------------------------------------------------
       
    50 public:
       
    51 	//--------------------------------------------------
       
    52 
       
    53 	// 
       
    54 	EAP_FUNC_IMPORT virtual ~eap_am_type_gsmsim_simulator_c();
       
    55 
       
    56 	// 
       
    57 	EAP_FUNC_IMPORT eap_am_type_gsmsim_simulator_c(
       
    58 		abs_eap_am_tools_c * const m_am_tools,
       
    59 		abs_eap_base_type_c * const partner,
       
    60 		const CEapPluginInterface::TIndexType aIndexType,
       
    61 		const TInt aIndex);
       
    62 
       
    63 	EAP_FUNC_IMPORT eap_status_e configure();
       
    64 
       
    65 	//
       
    66 	EAP_FUNC_IMPORT eap_status_e shutdown();
       
    67 
       
    68 	// 
       
    69 	EAP_FUNC_IMPORT eap_status_e query_SIM_imsi(
       
    70 		u8_t * const imsi, const u32_t max_length, u32_t * const imsi_length);
       
    71 
       
    72 	//
       
    73 	EAP_FUNC_IMPORT eap_status_e store_pseudonym_id(
       
    74 		const eap_am_network_id_c * const network_id,
       
    75 		const eap_variable_data_c * const pseudonym);
       
    76 
       
    77 	//
       
    78 	EAP_FUNC_IMPORT eap_status_e store_reauthentication_id(
       
    79 		const eap_am_network_id_c * const network_id,
       
    80 		const eap_variable_data_c * const reauthentication_identity);
       
    81 
       
    82 	//
       
    83 	EAP_FUNC_IMPORT eap_status_e query_SIM_IMSI_or_pseudonym_or_reauthentication_id(
       
    84 		const bool must_be_synchronous,
       
    85 		eap_variable_data_c * const IMSI,
       
    86 		eap_variable_data_c * const pseudonym_identity,
       
    87 		eap_variable_data_c * const reauthentication_identity,
       
    88 		eap_variable_data_c * const automatic_realm, ///< If this is not used, do not add any data to this parameter.
       
    89 		u32_t * const length_of_mnc,
       
    90 		const gsmsim_payload_AT_type_e required_identity,
       
    91 		const eap_type_gsmsim_complete_e required_completion,
       
    92 		const u8_t received_eap_identifier);
       
    93 
       
    94 	//
       
    95 	EAP_FUNC_IMPORT eap_status_e cancel_SIM_IMSI_or_pseudonym_or_reauthentication_id_query();
       
    96 
       
    97 	//
       
    98 	EAP_FUNC_IMPORT eap_status_e query_SIM_kc_and_sres(
       
    99 		const u8_t * const imsi, const u32_t imsi_length,
       
   100 		const u8_t * const rand, const u32_t rand_length,
       
   101 		u8_t * const kc, u32_t * const kc_length,
       
   102 		u8_t * const sres, u32_t * const sres_length);
       
   103 
       
   104 	//
       
   105 	EAP_FUNC_IMPORT eap_status_e handle_gsmsim_notification(eap_gsmsim_notification_codes_e gsmsim_notification_code);
       
   106 
       
   107 
       
   108 #if defined(USE_EAP_TYPE_SERVER_GSMSIM)
       
   109 	//
       
   110 	EAP_FUNC_IMPORT eap_status_e query_SIM_triplets(
       
   111 		const bool must_be_synchronous,
       
   112 		const eap_variable_data_c * const username,
       
   113 		eap_variable_data_c * const imsi,
       
   114 		eap_type_sim_triplet_array_c * const triplets,
       
   115 		eap_type_gsmsim_identity_type * const type);
       
   116 #endif //#if defined(USE_EAP_TYPE_SERVER_GSMSIM)
       
   117 
       
   118 
       
   119 #if defined(USE_EAP_TYPE_SERVER_GSMSIM)
       
   120 	//
       
   121 	EAP_FUNC_IMPORT eap_status_e cancel_SIM_triplets_query();
       
   122 #endif //#if defined(USE_EAP_TYPE_SERVER_GSMSIM)
       
   123 
       
   124 	//
       
   125 	EAP_FUNC_IMPORT eap_status_e query_SIM_kc_sres(
       
   126 		const bool must_be_synchronous,
       
   127 		//const eap_variable_data_c * const imsi,
       
   128 		const eap_variable_data_c * const n_rands,
       
   129 		eap_variable_data_c * const n_kc,
       
   130 		eap_variable_data_c * const n_sres);
       
   131 
       
   132 	//
       
   133 	EAP_FUNC_IMPORT eap_status_e cancel_SIM_kc_sres_query();
       
   134 
       
   135 	//
       
   136 	EAP_FUNC_IMPORT eap_status_e generate_encryption_IV(
       
   137 		eap_variable_data_c * const encryption_IV,
       
   138 		const u32_t IV_length);
       
   139 
       
   140 	//
       
   141 	EAP_FUNC_IMPORT eap_status_e generate_pseudonym_id(
       
   142 		const eap_am_network_id_c * const network_id,
       
   143 		const eap_variable_data_c * const imsi,
       
   144 		eap_variable_data_c * const pseudonym,
       
   145 		const u32_t maximum_pseudonym_length);
       
   146 
       
   147 	//
       
   148 	EAP_FUNC_IMPORT eap_status_e generate_reauthentication_id(
       
   149 		const eap_am_network_id_c * const network_id,
       
   150 		const eap_variable_data_c * const imsi,
       
   151 		eap_variable_data_c * const reauthentication_identity,
       
   152 		const u32_t maximum_reauthentication_identity_length);
       
   153 
       
   154 	//
       
   155 	EAP_FUNC_IMPORT eap_status_e store_reauth_parameters(
       
   156 		const eap_variable_data_c * const XKEY,
       
   157 		const eap_variable_data_c * const K_aut,
       
   158 		const eap_variable_data_c * const K_encr,
       
   159 		const u32_t reauth_counter);
       
   160 
       
   161 	//
       
   162 	EAP_FUNC_IMPORT eap_status_e authentication_finished(
       
   163 		const bool true_when_successfull,
       
   164 		const eap_gsmsim_authentication_type_e authentication_type,
       
   165 		const eap_type_gsmsim_identity_type identity_type);
       
   166 
       
   167 	//
       
   168 	EAP_FUNC_IMPORT eap_status_e query_reauth_parameters(
       
   169 		eap_variable_data_c * const XKEY,
       
   170 		eap_variable_data_c * const K_aut,
       
   171 		eap_variable_data_c * const K_encr,
       
   172 		u32_t * const reauth_counter);
       
   173 
       
   174 	//
       
   175 	EAP_FUNC_IMPORT eap_status_e increase_reauth_counter();
       
   176 
       
   177 
       
   178 #if defined(USE_EAP_TYPE_SERVER_GSMSIM)
       
   179 	//
       
   180 	EAP_FUNC_IMPORT eap_status_e query_imsi_from_username(
       
   181 		const bool must_be_synchronous,
       
   182 		const u8_t next_eap_identifier,
       
   183 		const eap_am_network_id_c * const network_id,
       
   184 		const eap_variable_data_c * const username,
       
   185 		eap_variable_data_c * const imsi,
       
   186 		eap_type_gsmsim_identity_type * const type,
       
   187 		const eap_type_gsmsim_complete_e completion_action);
       
   188 #endif //#if defined(USE_EAP_TYPE_SERVER_GSMSIM)
       
   189 
       
   190 
       
   191 	//
       
   192 	EAP_FUNC_IMPORT eap_status_e cancel_imsi_from_username_query();
       
   193 
       
   194 	//
       
   195 	EAP_FUNC_IMPORT eap_status_e check_is_rand_unused(const eap_variable_data_c * const n_rands);
       
   196 
       
   197 	EAP_FUNC_IMPORT eap_status_e set_rand_is_used(const eap_variable_data_c * const n_rands);
       
   198 
       
   199 	EAP_FUNC_IMPORT void set_is_valid();
       
   200 
       
   201 	EAP_FUNC_IMPORT bool get_is_valid();
       
   202 
       
   203 	//
       
   204 	EAP_FUNC_IMPORT eap_status_e type_configure_read(
       
   205 		const eap_configuration_field_c * const field,
       
   206 		eap_variable_data_c * const data);
       
   207 
       
   208 	//
       
   209 	EAP_FUNC_IMPORT eap_status_e type_configure_write(
       
   210 		const eap_configuration_field_c * const field,
       
   211 		eap_variable_data_c * const data);
       
   212 
       
   213 	//--------------------------------------------------
       
   214 }; // class eap_am_type_gsmsim_simulator_c
       
   215 
       
   216 
       
   217 #endif //#if !defined(_EAP_AM_TYPE_GSMSIM_SYMBIAN_SIMULATOR_H_)
       
   218 
       
   219 //--------------------------------------------------
       
   220 
       
   221 
       
   222 
       
   223 // End.