eapol/eapol_framework/eapol_common/am/include/eap_sim_triplets.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_SIM_TRIPLETS_H_)
       
    22 #define _EAP_SIM_TRIPLETS_H_
       
    23 
       
    24 //#include "eap_am_memory.h"
       
    25 #include "eap_tools.h"
       
    26 #include "eap_am_export.h"
       
    27 #include "eap_variable_data.h"
       
    28 
       
    29 
       
    30 //-----------------------------------------------
       
    31 
       
    32 const u32_t SIM_RAND_LENGTH = 16u;
       
    33 const u32_t SIM_KC_LENGTH   = 8u;
       
    34 const u32_t SIM_SRES_LENGTH = 4u;
       
    35 
       
    36 
       
    37 class EAP_EXPORT eap_type_saesim_triplet_c
       
    38 {
       
    39 private:
       
    40 
       
    41 	eap_variable_data_c *m_kc;
       
    42 	eap_variable_data_c *m_rand;
       
    43 	eap_variable_data_c *m_sres;
       
    44 	bool m_is_valid;
       
    45 
       
    46 public:
       
    47 
       
    48 	EAP_FUNC_IMPORT virtual ~eap_type_saesim_triplet_c();
       
    49 
       
    50 	EAP_FUNC_IMPORT eap_type_saesim_triplet_c(
       
    51 		abs_eap_am_tools_c * const tools
       
    52 		);
       
    53 
       
    54 	EAP_FUNC_IMPORT void reset();
       
    55 
       
    56 	EAP_FUNC_IMPORT eap_status_e set_triplet(
       
    57 		eap_variable_data_c * const kc,
       
    58 		eap_variable_data_c * const rand,
       
    59 		eap_variable_data_c * const sres
       
    60 		);
       
    61 
       
    62 	EAP_FUNC_IMPORT eap_type_saesim_triplet_c * copy(
       
    63 		abs_eap_am_tools_c * const tools
       
    64 		);
       
    65 
       
    66 	EAP_FUNC_IMPORT void set_is_valid();
       
    67 
       
    68 	EAP_FUNC_IMPORT bool get_is_valid();
       
    69 
       
    70 	EAP_FUNC_IMPORT eap_variable_data_c *get_kc();
       
    71 
       
    72 	EAP_FUNC_IMPORT eap_variable_data_c *get_rand();
       
    73 
       
    74 	EAP_FUNC_IMPORT eap_variable_data_c *get_sres();
       
    75 };
       
    76 
       
    77 //-----------------------------------------------
       
    78 
       
    79 class EAP_EXPORT eap_type_sim_triplet_array_c
       
    80 {
       
    81 private:
       
    82 
       
    83 	u32_t m_triplet_count;
       
    84 	eap_type_saesim_triplet_c **m_array;
       
    85 	abs_eap_am_tools_c * m_am_tools;
       
    86 
       
    87 public:
       
    88 
       
    89 	EAP_FUNC_IMPORT virtual ~eap_type_sim_triplet_array_c();
       
    90 
       
    91 	EAP_FUNC_IMPORT eap_type_sim_triplet_array_c(
       
    92 		abs_eap_am_tools_c * const tools
       
    93 		);
       
    94 
       
    95 	EAP_FUNC_IMPORT eap_status_e set_triplet_count(
       
    96 		const u32_t triplet_count
       
    97 		);
       
    98 
       
    99 	EAP_FUNC_IMPORT eap_type_saesim_triplet_c * add_triplet();
       
   100 
       
   101 	EAP_FUNC_IMPORT eap_type_saesim_triplet_c * get_triplet(abs_eap_am_tools_c * const m_am_tools, u32_t index);
       
   102 
       
   103 	EAP_FUNC_IMPORT eap_status_e set_triplet(u32_t index, eap_type_saesim_triplet_c * const triplet);
       
   104 
       
   105 	EAP_FUNC_IMPORT u32_t get_triplet_count();
       
   106 
       
   107 	EAP_FUNC_IMPORT eap_type_sim_triplet_array_c * copy();
       
   108 
       
   109 	EAP_FUNC_IMPORT void reset();
       
   110 
       
   111 };
       
   112 
       
   113 
       
   114 #endif //#if !defined(_EAP_SIM_TRIPLETS_H_)
       
   115 
       
   116 //--------------------------------------------------
       
   117 
       
   118 
       
   119 
       
   120 // End.