118 //-------------------------------------------------- |
141 //-------------------------------------------------- |
119 |
142 |
120 /** |
143 /** |
121 * The destructor of the tls_record_message_c class does nothing special. |
144 * The destructor of the tls_record_message_c class does nothing special. |
122 */ |
145 */ |
123 EAP_FUNC_IMPORT virtual ~tls_record_message_c(); |
146 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H virtual ~tls_record_message_c(); |
124 |
147 |
125 /** |
148 /** |
126 * The constructor of the tls_record_c class simply initializes the attributes. |
149 * The constructor of the tls_record_c class simply initializes the attributes. |
127 */ |
150 */ |
128 EAP_FUNC_IMPORT tls_record_message_c( |
151 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H tls_record_message_c( |
129 abs_eap_am_tools_c * const tools, |
152 abs_eap_am_tools_c * const tools, |
130 abs_tls_message_hash_c * const message_hash, |
153 abs_tls_message_hash_c * const message_hash, |
131 const bool is_client); |
154 const bool is_client); |
132 |
155 |
133 /** |
156 /** |
134 * Object must indicate it's validity. |
157 * Object must indicate it's validity. |
135 * If object initialization fails this function must return false. |
158 * If object initialization fails this function must return false. |
136 * @return This function returns the validity of this object. |
159 * @return This function returns the validity of this object. |
137 */ |
160 */ |
138 EAP_FUNC_IMPORT bool get_is_valid(); |
161 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H bool get_is_valid(); |
139 |
162 |
140 |
163 |
141 /** |
164 /** |
142 * This function returns the index of message where analyse must continue. |
165 * This function returns the index of message where analyse must continue. |
143 */ |
166 */ |
144 EAP_FUNC_IMPORT u32_t get_analyse_index() const; |
167 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H u32_t get_analyse_index() const; |
145 |
168 |
146 /** |
169 /** |
147 * This function saves the index of message where analyse must continue. |
170 * This function saves the index of message where analyse must continue. |
148 */ |
171 */ |
149 EAP_FUNC_IMPORT void save_analyse_index(const u32_t analyse_index); |
172 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H void save_analyse_index(const u32_t analyse_index); |
150 |
173 |
151 |
174 |
152 /** |
175 /** |
153 * This function returns the flag that tells whether this record is parsed (true) or not (flase). |
176 * This function returns the flag that tells whether this record is parsed (true) or not (flase). |
154 */ |
177 */ |
155 EAP_FUNC_IMPORT bool get_parsed_record() const; |
178 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H bool get_parsed_record() const; |
156 |
179 |
157 /** |
180 /** |
158 * This function sets the flag that tells this record is parsed. |
181 * This function sets the flag that tells this record is parsed. |
159 */ |
182 */ |
160 EAP_FUNC_IMPORT void set_parsed_record(); |
183 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H void set_parsed_record(); |
161 |
184 |
162 |
185 |
163 /** |
186 /** |
164 * This function returns the flag that tells whether the TLS-record header is included to m_record_message_data (true) or not (flase). |
187 * This function returns the flag that tells whether the TLS-record header is included to m_record_message_data (true) or not (flase). |
165 */ |
188 */ |
166 EAP_FUNC_IMPORT bool get_tls_record_header_is_included() const; |
189 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H bool get_tls_record_header_is_included() const; |
167 |
190 |
168 /** |
191 /** |
169 * This function sets the flag that tells whether the TLS-record header is included to m_record_message_data (true) or not (flase). |
192 * This function sets the flag that tells whether the TLS-record header is included to m_record_message_data (true) or not (flase). |
170 */ |
193 */ |
171 EAP_FUNC_IMPORT void set_tls_record_header_is_included(const bool when_true_tls_record_header_is_included); |
194 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H void set_tls_record_header_is_included(const bool when_true_tls_record_header_is_included); |
172 |
195 |
173 |
196 |
174 /** |
197 /** |
175 * This function returns the flag that tells whether the cipher suite is applied to this record (true) or not (flase). |
198 * This function returns the flag that tells whether the cipher suite is applied to this record (true) or not (flase). |
176 */ |
199 */ |
177 EAP_FUNC_IMPORT bool get_cipher_suite_applied() const; |
200 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H bool get_cipher_suite_applied() const; |
178 |
201 |
179 /** |
202 /** |
180 * This function sets the flag that tells the cipher suite is applied to this record. |
203 * This function sets the flag that tells the cipher suite is applied to this record. |
181 */ |
204 */ |
182 EAP_FUNC_IMPORT void set_cipher_suite_applied(); |
205 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H void set_cipher_suite_applied(); |
183 |
206 |
184 |
207 |
185 /** |
208 /** |
186 * This function sets the protocol of this record. |
209 * This function sets the protocol of this record. |
187 */ |
210 */ |
188 EAP_FUNC_IMPORT eap_status_e set_protocol( |
211 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e set_protocol( |
189 tls_record_protocol_e protocol); |
212 tls_record_protocol_e protocol); |
190 |
213 |
191 /** |
214 /** |
192 * This function sets the version of TLS. |
215 * This function sets the version of TLS. |
193 */ |
216 */ |
194 EAP_FUNC_IMPORT eap_status_e set_version( |
217 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e set_version( |
195 tls_version_e version); |
218 tls_version_e version); |
196 |
219 |
197 /** |
220 /** |
198 * This function copies the appropriate fields of this record. |
221 * This function copies the appropriate fields of this record. |
199 */ |
222 */ |
200 EAP_FUNC_IMPORT eap_status_e set_record_header_copy( |
223 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e set_record_header_copy( |
201 const tls_record_header_c * const tls_record_header); |
224 const tls_record_header_c * const tls_record_header); |
202 |
225 |
203 /** |
226 /** |
204 * This function sets the reference of TLS-record data. |
227 * This function sets the reference of TLS-record data. |
205 * NOTE this does not copy the message. |
228 * NOTE this does not copy the message. |
206 */ |
229 */ |
207 EAP_FUNC_IMPORT eap_status_e set_record_message_data( |
230 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e set_record_message_data( |
208 void * const data, |
231 void * const data, |
209 const u32_t data_length); |
232 const u32_t data_length); |
210 |
233 |
211 /** |
234 /** |
212 * This function returns the reference of TLS-record data. |
235 * This function returns the reference of TLS-record data. |
213 * NOTE this is not a copy of the message. |
236 * NOTE this is not a copy of the message. |
214 */ |
237 */ |
215 EAP_FUNC_IMPORT eap_variable_data_c * get_record_message_data(); |
238 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_variable_data_c * get_record_message_data(); |
216 |
239 |
217 /** |
240 /** |
218 * This function returns the protocol of TLS-record. |
241 * This function returns the protocol of TLS-record. |
219 */ |
242 */ |
220 EAP_FUNC_IMPORT tls_record_protocol_e get_protocol() const; |
243 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H tls_record_protocol_e get_protocol() const; |
221 |
244 |
222 /** |
245 /** |
223 * This function returns the version of TLS-record. |
246 * This function returns the version of TLS-record. |
224 */ |
247 */ |
225 EAP_FUNC_IMPORT tls_version_e get_version() const; |
248 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H tls_version_e get_version() const; |
226 |
249 |
227 /** |
250 /** |
228 * This function returns the data length of TLS-record. |
251 * This function returns the data length of TLS-record. |
229 */ |
252 */ |
230 EAP_FUNC_IMPORT u32_t get_data_length() const; |
253 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H u32_t get_data_length() const; |
231 |
254 |
232 /** |
255 /** |
233 * This function adds the data length of TLS-record. |
256 * This function adds the data length of TLS-record. |
234 */ |
257 */ |
235 EAP_FUNC_IMPORT eap_status_e add_data_length(const u32_t data_length); |
258 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e add_data_length(const u32_t data_length); |
236 |
259 |
237 /** |
260 /** |
238 * This function adds TLS-handshake message to this TLS-record. |
261 * This function adds TLS-handshake message to this TLS-record. |
239 */ |
262 */ |
240 EAP_FUNC_IMPORT eap_status_e add_handshake_message( |
263 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e add_handshake_message( |
241 tls_handshake_message_c * const handshake_message, |
264 tls_handshake_message_c * const handshake_message, |
242 const bool free_handshake_message); |
265 const bool free_handshake_message); |
243 |
266 |
244 /** |
267 /** |
245 * This function adds TLS-change cipher spec message to this TLS-record. |
268 * This function adds TLS-change cipher spec message to this TLS-record. |
246 */ |
269 */ |
247 EAP_FUNC_IMPORT eap_status_e add_change_cipher_spec_message( |
270 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e add_change_cipher_spec_message( |
248 tls_change_cipher_spec_message_c * const change_cipher_spec_message, |
271 tls_change_cipher_spec_message_c * const change_cipher_spec_message, |
249 const bool free_change_cipher_spec_message); |
272 const bool free_change_cipher_spec_message); |
250 |
273 |
251 /** |
274 /** |
252 * This function adds TLS-alert message to this TLS-record. |
275 * This function adds TLS-alert message to this TLS-record. |
253 */ |
276 */ |
254 EAP_FUNC_IMPORT eap_status_e add_alert_message( |
277 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e add_alert_message( |
255 tls_alert_message_c * const alert_message, |
278 tls_alert_message_c * const alert_message, |
256 const bool free_alert_message); |
279 const bool free_alert_message); |
257 |
280 |
258 /** |
281 /** |
259 * This function adds TLS-application data message to this TLS-record. |
282 * This function adds TLS-application data message to this TLS-record. |
260 */ |
283 */ |
261 EAP_FUNC_IMPORT eap_status_e add_application_data_message( |
284 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e add_application_data_message( |
262 tls_application_data_message_c * const alert_message, |
285 tls_application_data_message_c * const alert_message, |
263 const bool free_alert_message); |
286 const bool free_alert_message); |
264 |
287 |
265 /** |
288 /** |
266 * This function adds data of every TLS-protocol message to internal message buffer (m_record_message_data). |
289 * This function adds data of every TLS-protocol message to internal message buffer (m_record_message_data). |
267 */ |
290 */ |
268 EAP_FUNC_IMPORT eap_status_e add_message_data(); |
291 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H eap_status_e add_message_data(); |
269 |
292 |
270 /** |
293 /** |
271 * This function returns count of the TLS-handshake messages. |
294 * This function returns count of the TLS-handshake messages. |
272 */ |
295 */ |
273 EAP_FUNC_IMPORT u32_t get_handshake_count() const; |
296 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H u32_t get_handshake_count() const; |
274 |
297 |
275 /** |
298 /** |
276 * This function returns count of the TLS-change cipher spec messages. |
299 * This function returns count of the TLS-change cipher spec messages. |
277 */ |
300 */ |
278 EAP_FUNC_IMPORT u32_t get_change_cipher_spec_count() const; |
301 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H u32_t get_change_cipher_spec_count() const; |
279 |
302 |
280 /** |
303 /** |
281 * This function returns count of the TLS-alert messages. |
304 * This function returns count of the TLS-alert messages. |
282 */ |
305 */ |
283 EAP_FUNC_IMPORT u32_t get_alert_count() const; |
306 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H u32_t get_alert_count() const; |
284 |
307 |
285 /** |
308 /** |
286 * This function returns count of the TLS-application data messages. |
309 * This function returns count of the TLS-application data messages. |
287 */ |
310 */ |
288 EAP_FUNC_IMPORT u32_t get_application_data_count() const; |
311 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H u32_t get_application_data_count() const; |
289 |
312 |
290 /** |
313 /** |
291 * This function returns the TLS-handshake message selected by index. |
314 * This function returns the TLS-handshake message selected by index. |
292 */ |
315 */ |
293 EAP_FUNC_IMPORT tls_handshake_message_c * get_handshake( |
316 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H tls_handshake_message_c * get_handshake( |
294 const u32_t index) EAP_TEMPLATE_CONST; |
317 const u32_t index) EAP_TEMPLATE_CONST; |
295 |
318 |
296 /** |
319 /** |
297 * This function returns the TLS-change cipher spec message selected by index. |
320 * This function returns the TLS-change cipher spec message selected by index. |
298 */ |
321 */ |
299 EAP_FUNC_IMPORT const tls_change_cipher_spec_message_c * get_change_cipher_spec( |
322 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H const tls_change_cipher_spec_message_c * get_change_cipher_spec( |
300 const u32_t index) const; |
323 const u32_t index) const; |
301 |
324 |
302 /** |
325 /** |
303 * This function returns the TLS-alert message selected by index. |
326 * This function returns the TLS-alert message selected by index. |
304 */ |
327 */ |
305 EAP_FUNC_IMPORT const tls_alert_message_c * get_alert( |
328 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H const tls_alert_message_c * get_alert( |
306 const u32_t index) const; |
329 const u32_t index) const; |
307 |
330 |
308 /** |
331 /** |
309 * This function returns the TLS-application data message selected by index. |
332 * This function returns the TLS-application data message selected by index. |
310 */ |
333 */ |
311 EAP_FUNC_IMPORT tls_application_data_message_c * get_application_data( |
334 EAP_FUNC_VISIBILITY_TLS_RECORD_MESSAGE_H tls_application_data_message_c * get_application_data( |
312 const u32_t index) const; |
335 const u32_t index) const; |
313 |
336 |
314 // |
337 // |
315 //-------------------------------------------------- |
338 //-------------------------------------------------- |
316 }; // class tls_record_message_c |
339 }; // class tls_record_message_c |