|
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(_EAPOL_SESSION_KEY_H_) |
|
22 #define _EAPOL_SESSION_KEY_H_ |
|
23 |
|
24 #include "eap_variable_data.h" |
|
25 #include "eapol_key_types.h" |
|
26 #include "eap_am_export.h" |
|
27 |
|
28 |
|
29 /// A eapol_session_key_c class. |
|
30 /// This is used for session key encapsulation. |
|
31 class EAP_EXPORT eapol_session_key_c |
|
32 { |
|
33 private: |
|
34 //-------------------------------------------------- |
|
35 |
|
36 abs_eap_am_tools_c * const m_am_tools; ///< This is pointer to the tools class. @see abs_eap_am_tools_c. |
|
37 |
|
38 eap_variable_data_c m_key; ///< Here is the key. |
|
39 |
|
40 eap_variable_data_c m_sequence_number; ///< Here is the current sequence number for GTK. NOTE m_key_type should be GTK. |
|
41 |
|
42 eapol_key_type_e m_key_type; ///< This the type of the key. |
|
43 |
|
44 u32_t m_key_index; ///< This is the index of the key. |
|
45 |
|
46 bool m_key_tx_bit; ///< This is the TX bit of the key. |
|
47 |
|
48 bool m_is_valid; |
|
49 |
|
50 //-------------------------------------------------- |
|
51 protected: |
|
52 //-------------------------------------------------- |
|
53 |
|
54 //-------------------------------------------------- |
|
55 public: |
|
56 //-------------------------------------------------- |
|
57 |
|
58 /** |
|
59 * The destructor of the eapol_session_key_c class does nothing special. |
|
60 */ |
|
61 EAP_FUNC_IMPORT virtual ~eapol_session_key_c(); |
|
62 |
|
63 /** |
|
64 * The constructor of the eapol_session_key_c class does nothing special. |
|
65 */ |
|
66 EAP_FUNC_IMPORT eapol_session_key_c( |
|
67 abs_eap_am_tools_c * const tools, |
|
68 eap_variable_data_c * const key, ///< Here is the key. |
|
69 const eapol_key_type_e key_type, ///< This the type of the key. |
|
70 const u32_t key_index, ///< This is the index of the key. |
|
71 const bool key_tx_bit, ///< This is the TX bit of the key. |
|
72 const u8_t * const key_RSC, ///< This is the RSC counter |
|
73 const u32_t key_RSC_size ///< This is the size of RSC counter |
|
74 ); |
|
75 |
|
76 /** |
|
77 * The constructor of the eapol_session_key_c class does nothing special. |
|
78 */ |
|
79 EAP_FUNC_IMPORT eapol_session_key_c( |
|
80 abs_eap_am_tools_c * const tools |
|
81 ); |
|
82 |
|
83 EAP_FUNC_IMPORT const eap_variable_data_c * get_key() const; |
|
84 |
|
85 EAP_FUNC_IMPORT const eap_variable_data_c * get_sequence_number() const; |
|
86 |
|
87 EAP_FUNC_IMPORT eapol_key_type_e get_key_type() const; |
|
88 |
|
89 EAP_FUNC_IMPORT u32_t get_key_index() const; |
|
90 |
|
91 EAP_FUNC_IMPORT bool get_key_tx_bit() const; |
|
92 |
|
93 EAP_FUNC_IMPORT bool get_is_valid() const; |
|
94 |
|
95 |
|
96 EAP_FUNC_IMPORT eap_status_e set_key(const eap_variable_data_c * const key); |
|
97 |
|
98 EAP_FUNC_IMPORT eap_status_e set_sequence_number(eap_variable_data_c * const sequence_number); |
|
99 |
|
100 EAP_FUNC_IMPORT void set_key_type(const eapol_key_type_e key_type); |
|
101 |
|
102 EAP_FUNC_IMPORT void set_key_index(const u32_t key_index); |
|
103 |
|
104 EAP_FUNC_IMPORT void set_key_tx_bit(const bool key_tx_bit); |
|
105 |
|
106 EAP_FUNC_IMPORT static eap_const_string get_eapol_key_type_string( |
|
107 const eapol_key_type_e key_type); |
|
108 |
|
109 //-------------------------------------------------- |
|
110 }; // class eapol_session_key_c |
|
111 |
|
112 #endif //#if !defined(_EAPOL_SESSION_KEY_H_) |
|
113 |
|
114 //-------------------------------------------------- |
|
115 |
|
116 |
|
117 |
|
118 // End. |