245 }; |
266 }; |
246 |
267 |
247 //-------------------------------------------------- |
268 //-------------------------------------------------- |
248 |
269 |
249 // |
270 // |
250 EAP_FUNC_IMPORT virtual ~eapol_RSNA_key_header_c(); |
271 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H virtual ~eapol_RSNA_key_header_c(); |
251 |
272 |
252 // |
273 // |
253 EAP_FUNC_IMPORT eapol_RSNA_key_header_c( |
274 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eapol_RSNA_key_header_c( |
254 abs_eap_am_tools_c * const tools, |
275 abs_eap_am_tools_c * const tools, |
255 const bool is_RSNA_when_true, |
276 const bool is_RSNA_when_true, |
256 const bool is_WPXM_when_true, |
277 const bool is_WPXM_when_true, |
257 void * const header_begin, |
278 void * const header_begin, |
258 const u32_t header_buffer_length); |
279 const u32_t header_buffer_length); |
259 |
280 |
260 EAP_FUNC_IMPORT eapol_protocol_version_e get_eapol_protocol_version() const; |
281 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eapol_protocol_version_e get_eapol_protocol_version() const; |
261 |
282 |
262 EAP_FUNC_IMPORT eapol_packet_type_e get_eapol_packet_type() const; |
283 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eapol_packet_type_e get_eapol_packet_type() const; |
263 |
284 |
264 /// Function returns pcket body field of EAPOL packet. This field is two octets in length, |
285 /// Function returns pcket body field of EAPOL packet. This field is two octets in length, |
265 /// taken to represent an unsigned binary number. The value of this field defines the length |
286 /// taken to represent an unsigned binary number. The value of this field defines the length |
266 /// in octets of the Packet Body field. Value of 0 indicates that there is no Packet Body field present. |
287 /// in octets of the Packet Body field. Value of 0 indicates that there is no Packet Body field present. |
267 EAP_FUNC_IMPORT u16_t get_eapol_packet_body_length() const; |
288 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u16_t get_eapol_packet_body_length() const; |
268 |
289 |
269 /// This function returns whole length of the EAPOL packet. |
290 /// This function returns whole length of the EAPOL packet. |
270 /// This includes EAPOL header and packet body. |
291 /// This includes EAPOL header and packet body. |
271 EAP_FUNC_IMPORT u16_t get_eapol_packet_length() const; |
292 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u16_t get_eapol_packet_length() const; |
272 |
293 |
273 EAP_FUNC_IMPORT eapol_key_descriptor_type_e get_key_descriptor_type() const; |
294 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eapol_key_descriptor_type_e get_key_descriptor_type() const; |
274 |
295 |
275 /// Gets the Key Information field. |
296 /// Gets the Key Information field. |
276 EAP_FUNC_IMPORT u16_t get_key_information() const; |
297 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u16_t get_key_information() const; |
277 |
298 |
278 /** |
299 /** |
279 * This function returns the Key Descriptor Version bits of Key Information field. |
300 * This function returns the Key Descriptor Version bits of Key Information field. |
280 */ |
301 */ |
281 EAP_FUNC_IMPORT eapol_RSNA_key_header_c::key_descriptor_version_e get_key_information_key_descriptor_version() const; |
302 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eapol_RSNA_key_header_c::key_descriptor_version_e get_key_information_key_descriptor_version() const; |
282 |
303 |
283 /** |
304 /** |
284 * This function returns the Key Type bit of Key Information field. |
305 * This function returns the Key Type bit of Key Information field. |
285 */ |
306 */ |
286 EAP_FUNC_IMPORT bool get_key_information_key_type() const; |
307 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H bool get_key_information_key_type() const; |
287 |
308 |
288 /** |
309 /** |
289 * This function returns the Reserved A bits (higher ones) of Key Information field. |
310 * This function returns the Reserved A bits (higher ones) of Key Information field. |
290 * This is RSNA specific. |
311 * This is RSNA specific. |
291 */ |
312 */ |
292 EAP_FUNC_IMPORT u8_t get_key_information_reserved_a() const; |
313 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t get_key_information_reserved_a() const; |
293 |
314 |
294 /** |
315 /** |
295 * This function returns the key index bits (higher ones) of Key Information field. |
316 * This function returns the key index bits (higher ones) of Key Information field. |
296 * This is WPA specific. |
317 * This is WPA specific. |
297 */ |
318 */ |
298 EAP_FUNC_IMPORT u8_t get_key_information_key_index() const; |
319 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t get_key_information_key_index() const; |
299 |
320 |
300 /** |
321 /** |
301 * This function returns the Install bit of Key Information field. |
322 * This function returns the Install bit of Key Information field. |
302 */ |
323 */ |
303 EAP_FUNC_IMPORT bool get_key_information_install() const; |
324 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H bool get_key_information_install() const; |
304 |
325 |
305 /** |
326 /** |
306 * This function returns the Key Ack bit of Key Information field. |
327 * This function returns the Key Ack bit of Key Information field. |
307 */ |
328 */ |
308 EAP_FUNC_IMPORT bool get_key_information_key_ack() const; |
329 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H bool get_key_information_key_ack() const; |
309 |
330 |
310 /** |
331 /** |
311 * This function returns the Key MIC bit of Key Information field. |
332 * This function returns the Key MIC bit of Key Information field. |
312 */ |
333 */ |
313 EAP_FUNC_IMPORT bool get_key_information_key_MIC() const; |
334 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H bool get_key_information_key_MIC() const; |
314 |
335 |
315 /** |
336 /** |
316 * This function returns the Secure bit of Key Information field. |
337 * This function returns the Secure bit of Key Information field. |
317 */ |
338 */ |
318 EAP_FUNC_IMPORT bool get_key_information_secure() const; |
339 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H bool get_key_information_secure() const; |
319 |
340 |
320 /** |
341 /** |
321 * This function returns the Error bit of Key Information field. |
342 * This function returns the Error bit of Key Information field. |
322 */ |
343 */ |
323 EAP_FUNC_IMPORT bool get_key_information_error() const; |
344 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H bool get_key_information_error() const; |
324 |
345 |
325 /** |
346 /** |
326 * This function returns the Request bit of Key Information field. |
347 * This function returns the Request bit of Key Information field. |
327 */ |
348 */ |
328 EAP_FUNC_IMPORT bool get_key_information_request() const; |
349 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H bool get_key_information_request() const; |
329 |
350 |
330 /** |
351 /** |
331 * This function returns the Encrypted Key Data bit of Key Information field. |
352 * This function returns the Encrypted Key Data bit of Key Information field. |
332 */ |
353 */ |
333 EAP_FUNC_IMPORT bool get_key_information_encrypted_key_data() const; |
354 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H bool get_key_information_encrypted_key_data() const; |
334 |
355 |
335 |
356 |
336 /** |
357 /** |
337 * This function returns the Reserved B bits (lower ones) of Key Information field. |
358 * This function returns the Reserved B bits (lower ones) of Key Information field. |
338 */ |
359 */ |
339 EAP_FUNC_IMPORT u8_t get_key_information_reserved_b() const; |
360 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t get_key_information_reserved_b() const; |
340 |
361 |
341 /** |
362 /** |
342 * This function returns the Key Length field of the EAPOL-Key descriptor. |
363 * This function returns the Key Length field of the EAPOL-Key descriptor. |
343 */ |
364 */ |
344 EAP_FUNC_IMPORT u16_t get_key_length() const; |
365 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u16_t get_key_length() const; |
345 |
366 |
346 /** |
367 /** |
347 * This function returns the Key Reply Counter field of the EAPOL-Key descriptor. |
368 * This function returns the Key Reply Counter field of the EAPOL-Key descriptor. |
348 */ |
369 */ |
349 EAP_FUNC_IMPORT u64_t get_key_replay_counter() const; |
370 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u64_t get_key_replay_counter() const; |
350 |
371 |
351 EAP_FUNC_IMPORT u8_t * get_key_NONCE() const; |
372 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t * get_key_NONCE() const; |
352 |
373 |
353 EAP_FUNC_IMPORT u8_t * get_EAPOL_key_IV() const; |
374 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t * get_EAPOL_key_IV() const; |
354 |
375 |
355 EAP_FUNC_IMPORT u8_t * get_key_RSC() const; |
376 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t * get_key_RSC() const; |
356 |
377 |
357 EAP_FUNC_IMPORT u8_t * get_key_STA_MAC_address() const; |
378 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t * get_key_STA_MAC_address() const; |
358 |
379 |
359 EAP_FUNC_IMPORT u8_t * get_key_reserved() const; |
380 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t * get_key_reserved() const; |
360 |
381 |
361 EAP_FUNC_IMPORT u8_t * get_key_MIC() const; |
382 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t * get_key_MIC() const; |
362 |
383 |
363 /** |
384 /** |
364 * This function returns the Key Data Length field of the EAPOL-Key descriptor. |
385 * This function returns the Key Data Length field of the EAPOL-Key descriptor. |
365 */ |
386 */ |
366 EAP_FUNC_IMPORT u16_t get_key_data_length() const; |
387 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u16_t get_key_data_length() const; |
367 |
388 |
368 EAP_FUNC_IMPORT u8_t * get_key_data(const u32_t key_length) const; |
389 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t * get_key_data(const u32_t key_length) const; |
369 |
390 |
370 EAP_FUNC_IMPORT u8_t * get_key_data_offset(const u32_t offset, const u32_t key_length) const; |
391 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u8_t * get_key_data_offset(const u32_t offset, const u32_t key_length) const; |
371 |
392 |
372 EAP_FUNC_IMPORT static u16_t get_header_length(); |
393 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H static u16_t get_header_length(); |
373 |
394 |
374 EAP_FUNC_IMPORT eap_status_e set_eapol_protocol_version(const eapol_protocol_version_e version); |
395 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_eapol_protocol_version(const eapol_protocol_version_e version); |
375 |
396 |
376 EAP_FUNC_IMPORT eap_status_e set_eapol_packet_type(const eapol_packet_type_e type); |
397 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_eapol_packet_type(const eapol_packet_type_e type); |
377 |
398 |
378 EAP_FUNC_IMPORT eap_status_e set_eapol_packet_body_length(const u32_t eapol_length); |
399 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_eapol_packet_body_length(const u32_t eapol_length); |
379 |
400 |
380 EAP_FUNC_IMPORT eap_status_e set_key_descriptor_type(const eapol_key_descriptor_type_e eapol_key_descriptor_type); |
401 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_descriptor_type(const eapol_key_descriptor_type_e eapol_key_descriptor_type); |
381 |
402 |
382 /** |
403 /** |
383 * This function sets the selected bits on. |
404 * This function sets the selected bits on. |
384 */ |
405 */ |
385 EAP_FUNC_IMPORT u16_t set_bits_on( |
406 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H u16_t set_bits_on( |
386 u16_t key_information, |
407 u16_t key_information, |
387 const u16_t set_bits, |
408 const u16_t set_bits, |
388 const u32_t mask, |
409 const u32_t mask, |
389 const u32_t shift); |
410 const u32_t shift); |
390 |
411 |
391 /** |
412 /** |
392 * This function sets the Key Descriptor Version bits of Key Information field. |
413 * This function sets the Key Descriptor Version bits of Key Information field. |
393 */ |
414 */ |
394 EAP_FUNC_IMPORT eap_status_e set_key_information_key_descriptor_version(const u8_t version); |
415 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_key_descriptor_version(const u8_t version); |
395 |
416 |
396 /** |
417 /** |
397 * This function sets the Key Type bit of Key Information field. |
418 * This function sets the Key Type bit of Key Information field. |
398 */ |
419 */ |
399 EAP_FUNC_IMPORT eap_status_e set_key_information_key_type(const bool key_type_bit_on_when_true); |
420 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_key_type(const bool key_type_bit_on_when_true); |
400 |
421 |
401 /** |
422 /** |
402 * This function returns the key index bits (higher ones) of Key Information field. |
423 * This function returns the key index bits (higher ones) of Key Information field. |
403 * This is WPA specific. |
424 * This is WPA specific. |
404 */ |
425 */ |
405 EAP_FUNC_IMPORT eap_status_e set_key_information_key_index(const u8_t key_index); |
426 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_key_index(const u8_t key_index); |
406 |
427 |
407 /** |
428 /** |
408 * This function sets the Install bit of Key Information field. |
429 * This function sets the Install bit of Key Information field. |
409 */ |
430 */ |
410 EAP_FUNC_IMPORT eap_status_e set_key_information_install(const bool install_bit_on_when_true); |
431 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_install(const bool install_bit_on_when_true); |
411 |
432 |
412 /** |
433 /** |
413 * This function sets the Key Ack bit of Key Information field. |
434 * This function sets the Key Ack bit of Key Information field. |
414 */ |
435 */ |
415 EAP_FUNC_IMPORT eap_status_e set_key_information_key_ack(const bool key_ack_bit_on_when_true); |
436 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_key_ack(const bool key_ack_bit_on_when_true); |
416 |
437 |
417 /** |
438 /** |
418 * This function sets the Key MIC bit of Key Information field. |
439 * This function sets the Key MIC bit of Key Information field. |
419 */ |
440 */ |
420 EAP_FUNC_IMPORT eap_status_e set_key_information_key_MIC(const bool key_MIC_bit_on_when_true); |
441 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_key_MIC(const bool key_MIC_bit_on_when_true); |
421 |
442 |
422 /** |
443 /** |
423 * This function sets the Secure bit of Key Information field. |
444 * This function sets the Secure bit of Key Information field. |
424 */ |
445 */ |
425 EAP_FUNC_IMPORT eap_status_e set_key_information_secure(const bool secure_bit_on_when_true); |
446 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_secure(const bool secure_bit_on_when_true); |
426 |
447 |
427 /** |
448 /** |
428 * This function sets the Error bit of Key Information field. |
449 * This function sets the Error bit of Key Information field. |
429 */ |
450 */ |
430 EAP_FUNC_IMPORT eap_status_e set_key_information_error(const bool error_bit_on_when_true); |
451 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_error(const bool error_bit_on_when_true); |
431 |
452 |
432 /** |
453 /** |
433 * This function sets the Request bit of Key Information field. |
454 * This function sets the Request bit of Key Information field. |
434 */ |
455 */ |
435 EAP_FUNC_IMPORT eap_status_e set_key_information_request(const bool request_bit_is_on_when_true); |
456 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_request(const bool request_bit_is_on_when_true); |
436 |
457 |
437 /** |
458 /** |
438 * This function sets the Encrypted Key Data bit of Key Information field. |
459 * This function sets the Encrypted Key Data bit of Key Information field. |
439 */ |
460 */ |
440 EAP_FUNC_IMPORT eap_status_e set_key_information_encrypted_key_data(const bool encrypted_key_data_bit_is_on_when_true); |
461 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_information_encrypted_key_data(const bool encrypted_key_data_bit_is_on_when_true); |
441 |
462 |
442 /** |
463 /** |
443 * This function sets the Key Length field of the EAPOL-Key descriptor. |
464 * This function sets the Key Length field of the EAPOL-Key descriptor. |
444 */ |
465 */ |
445 EAP_FUNC_IMPORT eap_status_e set_key_length(const u16_t length); |
466 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_length(const u16_t length); |
446 |
467 |
447 /** |
468 /** |
448 * This function sets the Key Reply Counter field of the EAPOL-Key descriptor. |
469 * This function sets the Key Reply Counter field of the EAPOL-Key descriptor. |
449 */ |
470 */ |
450 EAP_FUNC_IMPORT eap_status_e set_key_replay_counter(const u64_t reply_counter); |
471 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_replay_counter(const u64_t reply_counter); |
451 |
472 |
452 /** |
473 /** |
453 * This function sets the Key Data Length field of the EAPOL-Key descriptor. |
474 * This function sets the Key Data Length field of the EAPOL-Key descriptor. |
454 */ |
475 */ |
455 EAP_FUNC_IMPORT eap_status_e set_key_data_length(const u16_t key_data_length); |
476 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e set_key_data_length(const u16_t key_data_length); |
456 |
477 |
457 /** |
478 /** |
458 * This function zeroes the EAPOL header and EAPOL-Key descriptor header. |
479 * This function zeroes the EAPOL header and EAPOL-Key descriptor header. |
459 */ |
480 */ |
460 EAP_FUNC_IMPORT eap_status_e zero_EAPOL_header_and_Key_descriptor( |
481 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e zero_EAPOL_header_and_Key_descriptor( |
461 abs_eap_am_tools_c * const tools |
482 abs_eap_am_tools_c * const tools |
462 ); |
483 ); |
463 |
484 |
464 EAP_FUNC_IMPORT eap_status_e zero_key_MIC( |
485 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e zero_key_MIC( |
465 abs_eap_am_tools_c * const tools |
486 abs_eap_am_tools_c * const tools |
466 ); |
487 ); |
467 |
488 |
468 EAP_FUNC_IMPORT eap_status_e zero_key_NONCE( |
489 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e zero_key_NONCE( |
469 abs_eap_am_tools_c * const tools |
490 abs_eap_am_tools_c * const tools |
470 ); |
491 ); |
471 |
492 |
472 EAP_FUNC_IMPORT eap_status_e zero_EAPOL_key_IV( |
493 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e zero_EAPOL_key_IV( |
473 abs_eap_am_tools_c * const tools |
494 abs_eap_am_tools_c * const tools |
474 ); |
495 ); |
475 |
496 |
476 EAP_FUNC_IMPORT eap_status_e zero_key_RSC( |
497 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e zero_key_RSC( |
477 abs_eap_am_tools_c * const tools |
498 abs_eap_am_tools_c * const tools |
478 ); |
499 ); |
479 |
500 |
480 EAP_FUNC_IMPORT eap_status_e zero_key_STA_MAC_address( |
501 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e zero_key_STA_MAC_address( |
481 abs_eap_am_tools_c * const tools |
502 abs_eap_am_tools_c * const tools |
482 ); |
503 ); |
483 |
504 |
484 EAP_FUNC_IMPORT eap_status_e zero_key_reserved( |
505 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e zero_key_reserved( |
485 abs_eap_am_tools_c * const tools |
506 abs_eap_am_tools_c * const tools |
486 ); |
507 ); |
487 |
508 |
488 EAP_FUNC_IMPORT eap_status_e check_header() const; |
509 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e check_header() const; |
489 |
510 |
490 EAP_FUNC_IMPORT eap_status_e reset_header( |
511 EAP_FUNC_VISIBILITY_EAPOL_RSNA_KEY_HEADER_H eap_status_e reset_header( |
491 const u8_t key_index, |
512 const u8_t key_index, |
492 const eapol_key_authentication_type_e authentication_type, |
513 const eapol_key_authentication_type_e authentication_type, |
493 const eapol_RSNA_cipher_e eapol_pairwise_cipher, |
514 const eapol_RSNA_cipher_e eapol_pairwise_cipher, |
494 const u64_t key_reply_counter, |
515 const u64_t key_reply_counter, |
495 const bool key_type_bit_on_when_true, |
516 const bool key_type_bit_on_when_true, |