|
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(_ABS_EAPOL_KEY_STATE_H_) |
|
22 #define _ABS_EAPOL_KEY_STATE_H_ |
|
23 |
|
24 #include "eap_am_export.h" |
|
25 |
|
26 class eapol_session_key_c; |
|
27 |
|
28 |
|
29 /// This class defines the interface the eapol_key_state_c class |
|
30 /// will use with the partner class (lower layer). |
|
31 class EAP_EXPORT abs_eapol_key_state_c |
|
32 { |
|
33 private: |
|
34 //-------------------------------------------------- |
|
35 |
|
36 //-------------------------------------------------- |
|
37 protected: |
|
38 //-------------------------------------------------- |
|
39 |
|
40 //-------------------------------------------------- |
|
41 public: |
|
42 //-------------------------------------------------- |
|
43 |
|
44 /** |
|
45 * The destructor of the abs_eap_core class does nothing special. |
|
46 */ |
|
47 virtual ~abs_eapol_key_state_c() |
|
48 { |
|
49 } |
|
50 |
|
51 /** |
|
52 * The constructor of the abs_eap_core class does nothing special. |
|
53 */ |
|
54 abs_eapol_key_state_c() |
|
55 { |
|
56 } |
|
57 |
|
58 /** |
|
59 * A eapol_key_state_c object calls this function when |
|
60 * a new temporary key (PTK, GTK or STAKey) is generated. |
|
61 */ |
|
62 virtual eap_status_e packet_data_session_key( |
|
63 const eap_am_network_id_c * const receive_network_id, |
|
64 const eapol_session_key_c * const key |
|
65 ) = 0; |
|
66 |
|
67 /** |
|
68 * The read_configure() function reads the configuration data identified |
|
69 * by the field string of field_length bytes length. Adaptation module must direct |
|
70 * the query to some persistent store. |
|
71 * @see abs_eap_base_type_c::read_configure(). |
|
72 */ |
|
73 virtual eap_status_e read_configure( |
|
74 const eap_configuration_field_c * const field, |
|
75 eap_variable_data_c * const data) = 0; |
|
76 |
|
77 /** |
|
78 * The write_configure() function writes the configuration data identified |
|
79 * by the field string of field_length bytes length. Adaptation module must direct |
|
80 * the action to some persistent store. |
|
81 * @see abs_eap_base_type_c::write_configure(). |
|
82 */ |
|
83 virtual eap_status_e write_configure( |
|
84 const eap_configuration_field_c * const field, |
|
85 eap_variable_data_c * const data) = 0; |
|
86 |
|
87 /** |
|
88 * This is notification of internal state transition. |
|
89 * This is used for notifications, debugging and protocol testing. |
|
90 * The primal notifications are eap_state_variable_e::eap_state_authentication_finished_successfully |
|
91 * and eap_state_variable_e::eap_state_authentication_terminated_unsuccessfully. |
|
92 * These two notifications are sent from EAP-protocol layer (eap_protocol_layer_e::eap_protocol_layer_eap). |
|
93 * These two notifications tells the end state of authentication session. These are the only |
|
94 * reliable indications of the final status of authentication session. |
|
95 * You MUST NOT make decision based on the return value of abs_eap_stack_interface_c::packet_process(). |
|
96 */ |
|
97 virtual void state_notification( |
|
98 const abs_eap_state_notification_c * const state) = 0; |
|
99 |
|
100 /** |
|
101 * The set_timer() function initializes timer to be elapsed after time_ms milliseconds. |
|
102 * @param initializer is pointer to object which timer_expired() function will |
|
103 * be called after timer elapses. |
|
104 * @param id is identifier which will be returned in timer_expired() function. |
|
105 * The user selects and interprets the id for this timer. |
|
106 * @param data is pointer to any user selected data which will be returned in timer_expired() function. |
|
107 * @param time_ms is the time of timer in milli seconds. |
|
108 * |
|
109 * Adaptation module internally implements the timer. |
|
110 */ |
|
111 virtual eap_status_e set_timer( |
|
112 abs_eap_base_timer_c * const initializer, |
|
113 const u32_t id, |
|
114 void * const data, |
|
115 const u32_t time_ms) = 0; |
|
116 |
|
117 /** |
|
118 * The cancel_timer() function cancels the timer id initiated by initializer. |
|
119 * @param initializer is pointer to object which set the cancelled timer. |
|
120 * @param id is identifier which will be returned in timer_expired() function. |
|
121 * The user selects and interprets the id for this timer. |
|
122 * |
|
123 * Adaptation module internally implements the timer. |
|
124 */ |
|
125 virtual eap_status_e cancel_timer( |
|
126 abs_eap_base_timer_c * const initializer, |
|
127 const u32_t id) = 0; |
|
128 |
|
129 /** |
|
130 * The cancel_all_timers() function cancels all timers. |
|
131 * User should use this in termination of the stack before |
|
132 * the adaptation module of tools is deleted. |
|
133 * Preferred mode is to cancel each timer directly |
|
134 * using cancel_timer() function. |
|
135 * |
|
136 * Adaptation module internally implements the timer. |
|
137 */ |
|
138 virtual eap_status_e cancel_all_timers() = 0; |
|
139 |
|
140 /** |
|
141 * All STAs contain a global Key Counter which is 256 bits in size. |
|
142 * It should be initialized at system boot up time to a fresh cryptographic quality random number. |
|
143 * Refer to Annex I.9 on random number generation. It is recommended that the counter value is initialized to: |
|
144 * PRF-256(Random number, "Init Counter", Local MAC Address || Time) |
|
145 * The Local MAC Address should be AA on the Authenticator and SA on the Supplicant. |
|
146 * The random number is 256 bits in size. Time should be the current time |
|
147 * (from NTP or another time in NTP format) whenever possible. |
|
148 * This initialization is to ensure that different initial Key Counter |
|
149 * values occur across system restarts whether a real-time clock is available or not. |
|
150 * The Key Counter must be incremented (all 256 bits) each time a value is used as a nonce or IV. |
|
151 * The Key Counter must not be allowed to wrap to the initialization value. |
|
152 */ |
|
153 virtual eap_status_e get_and_increment_global_key_counter( |
|
154 eap_variable_data_c * const key_counter) = 0; |
|
155 |
|
156 /** |
|
157 * This function tells lower layer to remove EAPOL-Key Handshake session object asynchronously. |
|
158 * @param send_netword_id carries the send addresses (network identity). |
|
159 */ |
|
160 virtual eap_status_e asynchronous_init_remove_eapol_key_state( |
|
161 const eap_am_network_id_c * const send_netword_id) = 0; |
|
162 |
|
163 //-------------------------------------------------- |
|
164 }; // class abs_eapol_key_state_c |
|
165 |
|
166 #endif //#if !defined(_ABS_EAPOL_KEY_STATE_H_) |
|
167 |
|
168 //-------------------------------------------------- |
|
169 |
|
170 |
|
171 |
|
172 // End. |