eapol/eapol_framework/eapol_symbian/eap_if/include/EapFastPacStoreImpl.h
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
     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 * %version: %
       
    20 */
       
    21 
       
    22 #include "EapFastPacStore.h"
       
    23 #include "abs_eap_pac_store_message.h"
       
    24 #include "eap_pac_store_message_base.h"
       
    25 #include "eap_pac_store_client_message_if.h"
       
    26 #include "eap_am_message_if.h"
       
    27 #include "EapClientIf.h"
       
    28 #include "eap_am_message_if_symbian.h"
       
    29 
       
    30 enum eap_fast_pac_store_impl_wait_state_e
       
    31 {
       
    32 	eap_fast_pac_store_impl_wait_state_none,
       
    33 	eap_fast_pac_store_impl_wait_state_complete_open_pac_store,
       
    34 	eap_fast_pac_store_impl_wait_state_complete_create_device_seed,
       
    35 	eap_fast_pac_store_impl_wait_state_complete_is_master_key_present,
       
    36 	eap_fast_pac_store_impl_wait_state_complete_is_master_key_and_password_matching,
       
    37 	eap_fast_pac_store_impl_wait_state_complete_create_and_save_master_key,
       
    38 	eap_fast_pac_store_impl_wait_state_complete_compare_pac_store_password,
       
    39 	eap_fast_pac_store_impl_wait_state_complete_is_pacstore_password_present,
       
    40 	eap_fast_pac_store_impl_wait_state_complete_set_pac_store_password,
       
    41 	eap_fast_pac_store_impl_wait_state_complete_destroy_pac_store,
       
    42 };
       
    43 
       
    44 class CEapFastPacStoreImpl
       
    45 : public CEapFastPacStore
       
    46 	,public abs_eap_pac_store_message_c
       
    47 {
       
    48 public:
       
    49 	
       
    50 	static CEapFastPacStore* NewL();
       
    51 	
       
    52 	CEapFastPacStoreImpl();
       
    53 	
       
    54 	virtual ~CEapFastPacStoreImpl();
       
    55 
       
    56 	void OpenPacStoreL();
       
    57     
       
    58   void CreateDeviceSeedL();
       
    59 
       
    60   TBool IsMasterKeyPresentL();
       
    61 
       
    62   TBool IsMasterKeyAndPasswordMatchingL(
       
    63 		const TDesC8 & aPassword8);
       
    64 
       
    65   TInt CreateAndSaveMasterKeyL(
       
    66 		const TDesC8 & aPassword8);
       
    67 
       
    68   TBool ComparePacStorePasswordL(
       
    69 		TDes8 & aPassword8);
       
    70 
       
    71   TBool IsPacStorePasswordPresentL();
       
    72 
       
    73   TInt SetPacStorePasswordL(
       
    74 		const TDesC8 & aPassword8);
       
    75 
       
    76   TInt DestroyPacStore();
       
    77   
       
    78   eap_status_e complete_open_pac_store(
       
    79 		const eap_status_e completion_status);
       
    80 
       
    81 	eap_status_e complete_create_device_seed(
       
    82 		const eap_status_e completion_status);
       
    83 
       
    84 	eap_status_e complete_is_master_key_present(
       
    85 		bool is_present
       
    86 		,const eap_status_e completion_status);
       
    87 
       
    88 	eap_status_e complete_is_master_key_and_password_matching(
       
    89 	  bool is_matching
       
    90 		,const eap_status_e completion_status);
       
    91 
       
    92 	eap_status_e complete_create_and_save_master_key(
       
    93 		const eap_status_e completion_status);
       
    94 
       
    95 	eap_status_e complete_compare_pac_store_password(
       
    96 			bool is_matching);
       
    97 
       
    98 	eap_status_e complete_is_pacstore_password_present(
       
    99 			bool is_present);
       
   100 
       
   101 	eap_status_e complete_set_pac_store_password(
       
   102 		const eap_status_e completion_status);
       
   103 
       
   104 	eap_status_e complete_destroy_pac_store(
       
   105 		const eap_status_e completion_status);
       
   106 
       
   107 	void ConstructL();
       
   108 	
       
   109 protected:
       
   110 	
       
   111 
       
   112 private:
       
   113 	
       
   114 	void Activate();
       
   115 	
       
   116 	void Complete();
       
   117 
       
   118 	void WaitCompletion();
       
   119 
       
   120 	abs_eap_am_tools_c* iTools;
       
   121 	eap_pac_store_message_base_c * iPartner;
       
   122 	TBool iIsValid;
       
   123 	eap_fast_pac_store_impl_wait_state_e iWaitState;
       
   124 	eap_status_e iCompletionStatus;
       
   125 	TRequestStatus iAsyncronousStatus;
       
   126 	eap_variable_data_c* iPacStorePassword;
       
   127 	TBool iIsPresent;
       
   128 	TBool iIsMatching;
       
   129 	TBool iIsPwMatching;
       
   130 	TBool iIsPwPresent;
       
   131 	CActiveSchedulerWait iWait;
       
   132 
       
   133 };