eapol/eapol_framework/eapol_common/type/tls_peap/tls/include/tls_record.h
changeset 49 43351a4f2da3
parent 26 9abfd4f00d37
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    14 * Description:  EAP and WLAN authentication protocols.
    14 * Description:  EAP and WLAN authentication protocols.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: %
    19 * %version: 73 %
    20 */
    20 */
    21 
    21 
    22 #if !defined(_TLS_RECORD_H_)
    22 #if !defined(_TLS_RECORD_H_)
    23 #define _TLS_RECORD_H_
    23 #define _TLS_RECORD_H_
    24 
    24 
    35 #include "tls_base_application.h"
    35 #include "tls_base_application.h"
    36 #include "eap_protocol_layer.h"
    36 #include "eap_protocol_layer.h"
    37 #include "eap_am_network_id.h"
    37 #include "eap_am_network_id.h"
    38 #include "eap_automatic_variable.h"
    38 #include "eap_automatic_variable.h"
    39 #include "eap_master_session_key.h"
    39 #include "eap_master_session_key.h"
       
    40 #if defined(USE_FAST_EAP_TYPE)
       
    41 	#include "abs_pac_store_initializer.h"
       
    42 #endif //#if defined(USE_FAST_EAP_TYPE)
       
    43 #include "eap_am_export.h"
       
    44 // Start: added by script change_export_macros.sh.
       
    45 #if defined(EAP_NO_EXPORT_TLS_RECORD_H)
       
    46 	#define EAP_CLASS_VISIBILITY_TLS_RECORD_H EAP_NONSHARABLE 
       
    47 	#define EAP_FUNC_VISIBILITY_TLS_RECORD_H 
       
    48 	#define EAP_C_FUNC_VISIBILITY_TLS_RECORD_H 
       
    49 	#define EAP_FUNC_EXPORT_TLS_RECORD_H 
       
    50 	#define EAP_C_FUNC_EXPORT_TLS_RECORD_H 
       
    51 #elif defined(EAP_EXPORT_TLS_RECORD_H)
       
    52 	#define EAP_CLASS_VISIBILITY_TLS_RECORD_H EAP_EXPORT 
       
    53 	#define EAP_FUNC_VISIBILITY_TLS_RECORD_H EAP_FUNC_EXPORT 
       
    54 	#define EAP_C_FUNC_VISIBILITY_TLS_RECORD_H EAP_C_FUNC_EXPORT 
       
    55 	#define EAP_FUNC_EXPORT_TLS_RECORD_H EAP_FUNC_EXPORT 
       
    56 	#define EAP_C_FUNC_EXPORT_TLS_RECORD_H EAP_C_FUNC_EXPORT 
       
    57 #else
       
    58 	#define EAP_CLASS_VISIBILITY_TLS_RECORD_H EAP_IMPORT 
       
    59 	#define EAP_FUNC_VISIBILITY_TLS_RECORD_H EAP_FUNC_IMPORT 
       
    60 	#define EAP_C_FUNC_VISIBILITY_TLS_RECORD_H EAP_C_FUNC_IMPORT 
       
    61 	#define EAP_FUNC_EXPORT_TLS_RECORD_H 
       
    62 	#define EAP_C_FUNC_EXPORT_TLS_RECORD_H 
       
    63 #endif
       
    64 // End: added by script change_export_macros.sh.
       
    65 
    40 
    66 
    41 
    67 
    42 class abs_tls_base_record_c;
    68 class abs_tls_base_record_c;
    43 class abs_eap_am_tools_c;
    69 class abs_eap_am_tools_c;
    44 class eap_am_network_id_c;
    70 class eap_am_network_id_c;
    50 class abs_crypto_cbc_block_algorithm_c;
    76 class abs_crypto_cbc_block_algorithm_c;
    51 class abs_crypto_block_algorithm_c;
    77 class abs_crypto_block_algorithm_c;
    52 class abs_crypto_stream_algorithm_c;
    78 class abs_crypto_stream_algorithm_c;
    53 
    79 
    54 #if defined(USE_FAST_EAP_TYPE)
    80 #if defined(USE_FAST_EAP_TYPE)
    55 #if !defined(USE_EAP_TLS_SESSION_TICKET)
    81 	#if !defined(USE_EAP_TLS_SESSION_TICKET)
    56 #error ERROR: With USE_FAST_EAP_TYPE you must use USE_EAP_TLS_SESSION_TICKET flag too.
    82 		#error ERROR: With USE_FAST_EAP_TYPE you must use USE_EAP_TLS_SESSION_TICKET flag too.
    57 #endif //#if !defined(USE_EAP_TLS_SESSION_TICKET)
    83 	#endif //#if !defined(USE_EAP_TLS_SESSION_TICKET)
    58 #endif //#if defined(USE_FAST_EAP_TYPE)
    84 #endif //#if defined(USE_FAST_EAP_TYPE)
    59 
    85 
    60 //--------------------------------------------------------------------
    86 //--------------------------------------------------------------------
    61 
    87 
    62 /**
    88 /**
    63  * The tls_record_c class implements tls_base_record_c.
    89  * The tls_record_c class implements tls_base_record_c.
    64  * See more detailed design and architecture document <a href="../../type/tls_peap/documentation/EAP_TLS_PEAP.doc">EAP_TLS_PEAP.doc</a>
    90  * See more detailed design and architecture document <a href="../../type/tls_peap/documentation/EAP_TLS_PEAP.doc">EAP_TLS_PEAP.doc</a>
    65  * and <a href="../../type/tls_peap/documentation/rfc2246.txt">RFC 2246</a>.
    91  * and <a href="../../type/tls_peap/documentation/rfc2246.txt">RFC 2246</a>.
    66  */
    92  */
    67 class EAP_EXPORT tls_record_c
    93 class EAP_CLASS_VISIBILITY_TLS_RECORD_H tls_record_c
    68 : public tls_base_record_c
    94 : public tls_base_record_c
    69 , public abs_tls_am_services_c
    95 , public abs_tls_am_services_c
    70 , public abs_tls_message_hash_c
    96 , public abs_tls_message_hash_c
    71 , public abs_tls_change_cipher_spec_c
    97 , public abs_tls_change_cipher_spec_c
    72 , public abs_tls_apply_cipher_spec_c
    98 , public abs_tls_apply_cipher_spec_c
    73 , public abs_tls_base_application_c
    99 , public abs_tls_base_application_c
       
   100 #if defined(USE_FAST_EAP_TYPE)
       
   101 , public abs_pac_store_initializer_c
       
   102 #endif //#if defined(USE_FAST_EAP_TYPE)
    74 {
   103 {
    75 private:
   104 private:
    76 	//--------------------------------------------------
   105 	//--------------------------------------------------
    77 
   106 
    78 	/// This is pointer to the tools class. @see abs_eap_am_tools_c.
   107 	/// This is pointer to the tools class. @see abs_eap_am_tools_c.
   536 
   565 
   537 	/**
   566 	/**
   538 	 * The set_is_valid() function sets the state of the object valid.
   567 	 * The set_is_valid() function sets the state of the object valid.
   539 	 * The creator of this object calls this function after it is initialized. 
   568 	 * The creator of this object calls this function after it is initialized. 
   540 	 */
   569 	 */
   541 	EAP_FUNC_IMPORT void set_is_valid();
   570 	EAP_FUNC_VISIBILITY_TLS_RECORD_H void set_is_valid();
   542 
   571 
   543 	EAP_FUNC_IMPORT eap_status_e allocate_handshake_message(
   572 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e allocate_handshake_message(
   544 		tls_handshake_message_c ** const tls_handshake_message,
   573 		tls_handshake_message_c ** const tls_handshake_message,
   545 		eap_automatic_variable_c<tls_handshake_message_c> * const automatic_tls_handshake_message,
   574 		eap_automatic_variable_c<tls_handshake_message_c> * const automatic_tls_handshake_message,
   546 		const tls_handshake_type_e handshake_type);
   575 		const tls_handshake_type_e handshake_type);
   547 
   576 
   548 	EAP_FUNC_IMPORT eap_status_e allocate_handshake_message_copy(
   577 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e allocate_handshake_message_copy(
   549 		tls_handshake_message_c ** const tls_handshake_message,
   578 		tls_handshake_message_c ** const tls_handshake_message,
   550 		eap_automatic_variable_c<tls_handshake_message_c> * const automatic_tls_handshake_message,
   579 		eap_automatic_variable_c<tls_handshake_message_c> * const automatic_tls_handshake_message,
   551 		tls_handshake_header_c * const tls_handshake_header);
   580 		tls_handshake_header_c * const tls_handshake_header);
   552 
   581 
   553 	/**
   582 	/**
   554 	 * This function creates TLS Handshake/HelloRequest message.
   583 	 * This function creates TLS Handshake/HelloRequest message.
   555 	 */
   584 	 */
   556 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_hello_request();
   585 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_hello_request();
   557 
   586 
   558 	/**
   587 	/**
   559 	 * This function creates TLS Handshake/ClientHello message.
   588 	 * This function creates TLS Handshake/ClientHello message.
   560 	 */
   589 	 */
   561 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_client_hello();
   590 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_client_hello();
   562 
   591 
   563 	/**
   592 	/**
   564 	 * This function creates TLS Handshake/ServerHello message.
   593 	 * This function creates TLS Handshake/ServerHello message.
   565 	 */
   594 	 */
   566 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_server_hello(
   595 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_server_hello(
   567 		const u16_t selected_cipher_suite,
   596 		const u16_t selected_cipher_suite,
   568 		const u8_t selected_compression_method);
   597 		const u8_t selected_compression_method);
   569 
   598 
   570 	/**
   599 	/**
   571 	 * This function creates TLS Handshake/Certificate message.
   600 	 * This function creates TLS Handshake/Certificate message.
   572 	 */
   601 	 */
   573 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_certificate(
   602 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_certificate(
   574 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const certificate_chain);
   603 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const certificate_chain);
   575 
   604 
   576 	/**
   605 	/**
   577 	 * This function creates TLS Handshake/CertificateRequest message.
   606 	 * This function creates TLS Handshake/CertificateRequest message.
   578 	 */
   607 	 */
   579 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_certificate_request(
   608 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_certificate_request(
   580 		EAP_TEMPLATE_CONST eap_array_c<u8_t> * const certificate_types,
   609 		EAP_TEMPLATE_CONST eap_array_c<u8_t> * const certificate_types,
   581 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const certificate_authorities);
   610 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const certificate_authorities);
   582 
   611 
   583 	/**
   612 	/**
   584 	 * This function creates TLS Handshake/ServerHelloDone message.
   613 	 * This function creates TLS Handshake/ServerHelloDone message.
   585 	 */
   614 	 */
   586 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_server_hello_done();
   615 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_server_hello_done();
   587 
   616 
   588 	/**
   617 	/**
   589 	 * This function completes creation of TLS Handshake/ServerKeyExchange message.
   618 	 * This function completes creation of TLS Handshake/ServerKeyExchange message.
   590 	 */
   619 	 */
   591 	EAP_FUNC_IMPORT eap_status_e complete_create_handshake_type_server_key_exchange();
   620 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_create_handshake_type_server_key_exchange();
   592 
   621 
   593 	/**
   622 	/**
   594 	 * This function creates TLS Handshake/ServerKeyExchange message.
   623 	 * This function creates TLS Handshake/ServerKeyExchange message.
   595 	 * NOTE: this function is asyncronous. complete_create_handshake_type_server_key_exchange()
   624 	 * NOTE: this function is asyncronous. complete_create_handshake_type_server_key_exchange()
   596 	 * completes this operation.
   625 	 * completes this operation.
   597 	 */
   626 	 */
   598 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_server_key_exchange();
   627 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_server_key_exchange();
   599 
   628 
   600 	/**
   629 	/**
   601 	 * This function completes creation of TLS Handshake/ClientKeyExchange message.
   630 	 * This function completes creation of TLS Handshake/ClientKeyExchange message.
   602 	 */
   631 	 */
   603 	EAP_FUNC_IMPORT eap_status_e complete_create_handshake_type_client_key_exchange();
   632 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_create_handshake_type_client_key_exchange();
   604 
   633 
   605 	/**
   634 	/**
   606 	 * This function creates TLS Handshake/ClientKeyExchange message.
   635 	 * This function creates TLS Handshake/ClientKeyExchange message.
   607 	 * NOTE: this function is asyncronous. complete_create_handshake_type_client_key_exchange()
   636 	 * NOTE: this function is asyncronous. complete_create_handshake_type_client_key_exchange()
   608 	 * completes this operation.
   637 	 * completes this operation.
   609 	 */
   638 	 */
   610 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_client_key_exchange();
   639 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_client_key_exchange();
   611 
   640 
   612 	/**
   641 	/**
   613 	 * This function completes creation of TLS Handshake/CertificateVerify message.
   642 	 * This function completes creation of TLS Handshake/CertificateVerify message.
   614 	 */
   643 	 */
   615 	EAP_FUNC_IMPORT eap_status_e complete_create_handshake_type_certificate_verify();
   644 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_create_handshake_type_certificate_verify();
   616 
   645 
   617 	/**
   646 	/**
   618 	 * This function creates TLS Handshake/CertificateVerify message.
   647 	 * This function creates TLS Handshake/CertificateVerify message.
   619 	 * NOTE: this function is asyncronous.
   648 	 * NOTE: this function is asyncronous.
   620 	 */
   649 	 */
   621 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_certificate_verify();
   650 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_certificate_verify();
   622 
   651 
   623 	/**
   652 	/**
   624 	 * This function creates TLS Handshake/Finished message.
   653 	 * This function creates TLS Handshake/Finished message.
   625 	 */
   654 	 */
   626 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_finished();
   655 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_finished();
   627 
   656 
   628 	/**
   657 	/**
   629 	 * This function creates TLS Handshake/NewSessionTicket message.
   658 	 * This function creates TLS Handshake/NewSessionTicket message.
   630 	 */
   659 	 */
   631 	EAP_FUNC_IMPORT eap_status_e create_handshake_type_new_session_ticket();
   660 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_handshake_type_new_session_ticket();
   632 
   661 
   633 	/**
   662 	/**
   634 	 * This function creates TLS ChangeCipherSpec/ChangeCipherSpec message.
   663 	 * This function creates TLS ChangeCipherSpec/ChangeCipherSpec message.
   635 	 */
   664 	 */
   636 	EAP_FUNC_IMPORT eap_status_e create_change_cipher_spec_type_change_cipher_spec();
   665 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_change_cipher_spec_type_change_cipher_spec();
   637 
   666 
   638 	/**
   667 	/**
   639 	 * This function finish TLS handshake.
   668 	 * This function finish TLS handshake.
   640 	 */
   669 	 */
   641 	EAP_FUNC_IMPORT eap_status_e finish_handshake();
   670 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e finish_handshake();
   642 
   671 
   643 	/**
   672 	/**
   644 	 * This function creates TLS Alert/Alert message.
   673 	 * This function creates TLS Alert/Alert message.
   645 	 */
   674 	 */
   646 	EAP_FUNC_IMPORT eap_status_e create_tls_protocol_alert(
   675 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_tls_protocol_alert(
   647 		const tls_alert_description_e alert_description,
   676 		const tls_alert_description_e alert_description,
   648 		const tls_alert_level_e alert_level,
   677 		const tls_alert_level_e alert_level,
   649 		const eap_status_e result);
   678 		const eap_status_e result);
   650 
   679 
   651 	/**
   680 	/**
   652 	 * This function creates TLS ApplicationData message.
   681 	 * This function creates TLS ApplicationData message.
   653 	 */
   682 	 */
   654 	EAP_FUNC_IMPORT eap_status_e create_tls_application_data(
   683 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_tls_application_data(
   655 		eap_buf_chain_wr_c * const sent_packet,
   684 		eap_buf_chain_wr_c * const sent_packet,
   656 		const u32_t header_offset);
   685 		const u32_t header_offset);
   657 
   686 
   658 	/**
   687 	/**
   659 	 * This function starts tunneled authentication.
   688 	 * This function starts tunneled authentication.
   660 	 */
   689 	 */
   661 	EAP_FUNC_IMPORT eap_status_e start_peap_tunneled_authentication(
   690 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e start_peap_tunneled_authentication(
   662 		const eap_am_network_id_c * const receive_network_id,
   691 		const eap_am_network_id_c * const receive_network_id,
   663 		const u8_t received_eap_identifier,
   692 		const u8_t received_eap_identifier,
   664 		const tls_session_type_e tls_session_type);
   693 		const tls_session_type_e tls_session_type);
   665 
   694 
   666 	/**
   695 	/**
   667 	 * This function parses TLS extension list, see RFC 4366.
   696 	 * This function parses TLS extension list, see RFC 4366.
   668 	 */
   697 	 */
   669 	EAP_FUNC_IMPORT eap_status_e parse_tls_extension_list(
   698 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_tls_extension_list(
   670 		const u32_t handshake_data_length,
   699 		const u32_t handshake_data_length,
   671 		u32_t * const data_offset,
   700 		u32_t * const data_offset,
   672 		const tls_handshake_header_c * const tls_handshake_header,
   701 		const tls_handshake_header_c * const tls_handshake_header,
   673 		tls_handshake_message_c * const tls_handshake_message);
   702 		tls_handshake_message_c * const tls_handshake_message);
   674 
   703 
   675 	/**
   704 	/**
   676 	 * This function parses TLS Handshake/HelloRequest message.
   705 	 * This function parses TLS Handshake/HelloRequest message.
   677 	 */
   706 	 */
   678 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_hello_request(
   707 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_hello_request(
   679 		tls_record_message_c * const received_tls_record_message,
   708 		tls_record_message_c * const received_tls_record_message,
   680 		tls_handshake_header_c * const tls_handshake_header,
   709 		tls_handshake_header_c * const tls_handshake_header,
   681 		const u32_t handshake_data_length);
   710 		const u32_t handshake_data_length);
   682 
   711 
   683 
   712 
   684 	/**
   713 	/**
   685 	 * This function parses TLS Handshake/ClientHello message.
   714 	 * This function parses TLS Handshake/ClientHello message.
   686 	 */
   715 	 */
   687 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_client_hello(
   716 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_client_hello(
   688 		tls_record_message_c * const received_tls_record_message,
   717 		tls_record_message_c * const received_tls_record_message,
   689 		tls_handshake_header_c * const tls_handshake_header,
   718 		tls_handshake_header_c * const tls_handshake_header,
   690 		const u32_t handshake_data_length);
   719 		const u32_t handshake_data_length);
   691 
   720 
   692 	/**
   721 	/**
   693 	 * This function parses TLS Handshake/ServerHello message.
   722 	 * This function parses TLS Handshake/ServerHello message.
   694 	 */
   723 	 */
   695 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_server_hello(
   724 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_server_hello(
   696 		tls_record_message_c * const received_tls_record_message,
   725 		tls_record_message_c * const received_tls_record_message,
   697 		tls_handshake_header_c * const tls_handshake_header,
   726 		tls_handshake_header_c * const tls_handshake_header,
   698 		const u32_t handshake_data_length);
   727 		const u32_t handshake_data_length);
   699 
   728 
   700 	/**
   729 	/**
   701 	 * This function parses TLS Handshake/Certificate message.
   730 	 * This function parses TLS Handshake/Certificate message.
   702 	 */
   731 	 */
   703 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_certificate(
   732 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_certificate(
   704 		tls_record_message_c * const received_tls_record_message,
   733 		tls_record_message_c * const received_tls_record_message,
   705 		tls_handshake_header_c * const tls_handshake_header,
   734 		tls_handshake_header_c * const tls_handshake_header,
   706 		const u32_t handshake_data_length);
   735 		const u32_t handshake_data_length);
   707 
   736 
   708 	/**
   737 	/**
   709 	 * This function parses TLS Handshake/CertificateRequest message.
   738 	 * This function parses TLS Handshake/CertificateRequest message.
   710 	 */
   739 	 */
   711 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_certificate_request(
   740 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_certificate_request(
   712 		tls_record_message_c * const received_tls_record_message,
   741 		tls_record_message_c * const received_tls_record_message,
   713 		tls_handshake_header_c * const tls_handshake_header,
   742 		tls_handshake_header_c * const tls_handshake_header,
   714 		const u32_t handshake_data_length);
   743 		const u32_t handshake_data_length);
   715 
   744 
   716 	/**
   745 	/**
   717 	 * This function parses TLS Handshake/ServerHelloDone message.
   746 	 * This function parses TLS Handshake/ServerHelloDone message.
   718 	 */
   747 	 */
   719 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_server_hello_done(
   748 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_server_hello_done(
   720 		tls_record_message_c * const received_tls_record_message,
   749 		tls_record_message_c * const received_tls_record_message,
   721 		tls_handshake_header_c * const tls_handshake_header,
   750 		tls_handshake_header_c * const tls_handshake_header,
   722 		const u32_t handshake_data_length);
   751 		const u32_t handshake_data_length);
   723 
   752 
   724 	/**
   753 	/**
   725 	 * This function parses TLS Handshake/ServerKeyExchange message.
   754 	 * This function parses TLS Handshake/ServerKeyExchange message.
   726 	 */
   755 	 */
   727 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_server_key_exchange(
   756 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_server_key_exchange(
   728 		tls_record_message_c * const received_tls_record_message,
   757 		tls_record_message_c * const received_tls_record_message,
   729 		tls_handshake_header_c * const tls_handshake_header,
   758 		tls_handshake_header_c * const tls_handshake_header,
   730 		const u32_t handshake_data_length);
   759 		const u32_t handshake_data_length);
   731 
   760 
   732 	/**
   761 	/**
   733 	 * This function parses TLS Handshake/ClientKeyExchange message.
   762 	 * This function parses TLS Handshake/ClientKeyExchange message.
   734 	 */
   763 	 */
   735 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_client_key_exchange(
   764 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_client_key_exchange(
   736 		tls_record_message_c * const received_tls_record_message,
   765 		tls_record_message_c * const received_tls_record_message,
   737 		tls_handshake_header_c * const tls_handshake_header,
   766 		tls_handshake_header_c * const tls_handshake_header,
   738 		const u32_t handshake_data_length);
   767 		const u32_t handshake_data_length);
   739 
   768 
   740 	/**
   769 	/**
   741 	 * This function parses TLS Handshake/CertificateVerify message.
   770 	 * This function parses TLS Handshake/CertificateVerify message.
   742 	 */
   771 	 */
   743 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_certificate_verify(
   772 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_certificate_verify(
   744 		tls_record_message_c * const received_tls_record_message,
   773 		tls_record_message_c * const received_tls_record_message,
   745 		tls_handshake_header_c * const tls_handshake_header,
   774 		tls_handshake_header_c * const tls_handshake_header,
   746 		const u32_t handshake_data_length);
   775 		const u32_t handshake_data_length);
   747 
   776 
   748 	/**
   777 	/**
   749 	 * This function parses TLS Handshake/Finished message.
   778 	 * This function parses TLS Handshake/Finished message.
   750 	 */
   779 	 */
   751 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_finished(
   780 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_finished(
   752 		tls_record_message_c * const received_tls_record_message,
   781 		tls_record_message_c * const received_tls_record_message,
   753 		tls_handshake_header_c * const tls_handshake_header,
   782 		tls_handshake_header_c * const tls_handshake_header,
   754 		const u32_t handshake_data_length);
   783 		const u32_t handshake_data_length);
   755 
   784 
   756 
   785 
   757 #if defined(USE_EAP_TLS_SESSION_TICKET)
   786 #if defined(USE_EAP_TLS_SESSION_TICKET)
   758 
   787 
   759 	/**
   788 	/**
   760 	 * This function parses TLS Handshake/NewSessionTicket message.
   789 	 * This function parses TLS Handshake/NewSessionTicket message.
   761 	 */
   790 	 */
   762 	EAP_FUNC_IMPORT eap_status_e parse_handshake_type_new_session_ticket(
   791 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_handshake_type_new_session_ticket(
   763 		tls_record_message_c * const received_tls_record_message,
   792 		tls_record_message_c * const received_tls_record_message,
   764 		tls_handshake_header_c * const tls_handshake_header,
   793 		tls_handshake_header_c * const tls_handshake_header,
   765 		const u32_t handshake_data_length);
   794 		const u32_t handshake_data_length);
   766 
   795 
   767 #endif // #if defined(USE_EAP_TLS_SESSION_TICKET)
   796 #endif // #if defined(USE_EAP_TLS_SESSION_TICKET)
   768 
   797 
   769 
   798 
   770 	/**
   799 	/**
   771 	 * This function parses TLS ChangeCipherSpec protocol.
   800 	 * This function parses TLS ChangeCipherSpec protocol.
   772 	 */
   801 	 */
   773 	EAP_FUNC_IMPORT eap_status_e parse_tls_protocol_change_cipher_spec(
   802 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_tls_protocol_change_cipher_spec(
   774 		tls_record_message_c * const tls_record_message,
   803 		tls_record_message_c * const tls_record_message,
   775 		eap_variable_data_c * const tls_protocols_messages_buffer);
   804 		eap_variable_data_c * const tls_protocols_messages_buffer);
   776 
   805 
   777 	/**
   806 	/**
   778 	 * This function parses TLS Alert protocol.
   807 	 * This function parses TLS Alert protocol.
   779 	 */
   808 	 */
   780 	EAP_FUNC_IMPORT eap_status_e parse_tls_protocol_alert(
   809 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_tls_protocol_alert(
   781 		tls_record_message_c * const tls_record_message,
   810 		tls_record_message_c * const tls_record_message,
   782 		eap_variable_data_c * const tls_protocols_messages_buffer);
   811 		eap_variable_data_c * const tls_protocols_messages_buffer);
   783 
   812 
   784 	/**
   813 	/**
   785 	 * This function parses TLS Handshake protocol.
   814 	 * This function parses TLS Handshake protocol.
   786 	 */
   815 	 */
   787 	EAP_FUNC_IMPORT eap_status_e parse_tls_protocol_handshake(
   816 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_tls_protocol_handshake(
   788 		tls_record_message_c * const tls_record_message,
   817 		tls_record_message_c * const tls_record_message,
   789 		eap_variable_data_c * const tls_protocols_messages_buffer);
   818 		eap_variable_data_c * const tls_protocols_messages_buffer);
   790 
   819 
   791 	/**
   820 	/**
   792 	 * This function parses TLS ApplicationData protocol.
   821 	 * This function parses TLS ApplicationData protocol.
   793 	 */
   822 	 */
   794 	EAP_FUNC_IMPORT eap_status_e parse_tls_protocol_application_data(
   823 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e parse_tls_protocol_application_data(
   795 		tls_record_message_c * const tls_record_message,
   824 		tls_record_message_c * const tls_record_message,
   796 		eap_variable_data_c * const tls_protocols_messages_buffer);
   825 		eap_variable_data_c * const tls_protocols_messages_buffer);
   797 
   826 
   798 	/**
   827 	/**
   799 	 * This function reassembles data of received consecutive TLS-records with same protocol to tls_record_message.
   828 	 * This function reassembles data of received consecutive TLS-records with same protocol to tls_record_message.
   800 	 */
   829 	 */
   801 	EAP_FUNC_IMPORT eap_status_e reassemble_tls_records(
   830 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e reassemble_tls_records(
   802 		tls_record_message_c * const tls_record_message,
   831 		tls_record_message_c * const tls_record_message,
   803 		tls_record_header_c * const next_tls_record_header);
   832 		tls_record_header_c * const next_tls_record_header);
   804 
   833 
   805 	/**
   834 	/**
   806 	 * This function processes received TLS records.
   835 	 * This function processes received TLS records.
   807 	 */
   836 	 */
   808 	EAP_FUNC_IMPORT eap_status_e process_tls_records();
   837 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e process_tls_records();
   809 
   838 
   810 	/**
   839 	/**
   811 	 * This function processes received TLS message.
   840 	 * This function processes received TLS message.
   812 	 */
   841 	 */
   813 	EAP_FUNC_IMPORT eap_status_e process_tls_message();
   842 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e process_tls_message();
   814 
   843 
   815 	EAP_FUNC_IMPORT tls_record_protocol_e get_next_tls_record_message_protocol();
   844 	EAP_FUNC_VISIBILITY_TLS_RECORD_H tls_record_protocol_e get_next_tls_record_message_protocol();
   816 
   845 
   817 	EAP_FUNC_IMPORT tls_handshake_type_e get_next_tls_handshake_message_type();
   846 	EAP_FUNC_VISIBILITY_TLS_RECORD_H tls_handshake_type_e get_next_tls_handshake_message_type();
   818 
   847 
   819 	/**
   848 	/**
   820 	 * This function analyses TLS Handshake/HelloRequest message.
   849 	 * This function analyses TLS Handshake/HelloRequest message.
   821 	 */
   850 	 */
   822 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_hello_request(
   851 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_hello_request(
   823 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   852 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   824 
   853 
   825 	/**
   854 	/**
   826 	 * This function analyses TLS Handshake/ClientHello message.
   855 	 * This function analyses TLS Handshake/ClientHello message.
   827 	 */
   856 	 */
   828 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_client_hello(
   857 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_client_hello(
   829 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   858 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   830 
   859 
   831 	/**
   860 	/**
   832 	 * This function analyses TLS Handshake/ServerHello message.
   861 	 * This function analyses TLS Handshake/ServerHello message.
   833 	 */
   862 	 */
   834 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_server_hello(
   863 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_server_hello(
   835 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   864 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   836 
   865 
   837 	/**
   866 	/**
   838 	 * This function analyses TLS Handshake/Certificate message.
   867 	 * This function analyses TLS Handshake/Certificate message.
   839 	 */
   868 	 */
   840 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_certificate(
   869 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_certificate(
   841 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   870 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   842 
   871 
   843 	/**
   872 	/**
   844 	 * This function analyses TLS Handshake/CertificateRequest message.
   873 	 * This function analyses TLS Handshake/CertificateRequest message.
   845 	 */
   874 	 */
   846 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_certificate_request(
   875 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_certificate_request(
   847 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   876 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   848 
   877 
   849 	/**
   878 	/**
   850 	 * This function analyses TLS Handshake/ServerHelloDone message.
   879 	 * This function analyses TLS Handshake/ServerHelloDone message.
   851 	 */
   880 	 */
   852 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_server_hello_done(
   881 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_server_hello_done(
   853 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   882 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   854 
   883 
   855 	/**
   884 	/**
   856 	 * This function analyses TLS Handshake/ServerKeyExchange message.
   885 	 * This function analyses TLS Handshake/ServerKeyExchange message.
   857 	 */
   886 	 */
   858 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_server_key_exchange(
   887 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_server_key_exchange(
   859 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   888 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   860 
   889 
   861 	/**
   890 	/**
   862 	 * This function analyses TLS Handshake/ClientKeyExchange message.
   891 	 * This function analyses TLS Handshake/ClientKeyExchange message.
   863 	 */
   892 	 */
   864 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_client_key_exchange(
   893 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_client_key_exchange(
   865 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   894 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   866 
   895 
   867 	/**
   896 	/**
   868 	 * This function analyses TLS Handshake/CertificateVerify message.
   897 	 * This function analyses TLS Handshake/CertificateVerify message.
   869 	 */
   898 	 */
   870 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_certificate_verify(
   899 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_certificate_verify(
   871 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   900 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message);
   872 
   901 
   873 	/**
   902 	/**
   874 	 * This function analyses TLS Handshake/Finished message.
   903 	 * This function analyses TLS Handshake/Finished message.
   875 	 */
   904 	 */
   876 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_finished(
   905 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_finished(
   877 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message,
   906 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message,
   878 		const u8_t received_eap_identifier);
   907 		const u8_t received_eap_identifier);
   879 
   908 
   880 #if defined(USE_EAP_TLS_SESSION_TICKET)
   909 #if defined(USE_EAP_TLS_SESSION_TICKET)
   881 
   910 
   882 	/**
   911 	/**
   883 	 * This function analyses TLS Handshake/NewSessionTicket message.
   912 	 * This function analyses TLS Handshake/NewSessionTicket message.
   884 	 */
   913 	 */
   885 	EAP_FUNC_IMPORT eap_status_e analyse_handshake_type_new_session_ticket(
   914 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_handshake_type_new_session_ticket(
   886 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message,
   915 		EAP_TEMPLATE_CONST tls_handshake_message_c * const handshake_message,
   887 		const u8_t received_eap_identifier);
   916 		const u8_t received_eap_identifier);
   888 
   917 
   889 #endif // #if defined(USE_EAP_TLS_SESSION_TICKET)
   918 #endif // #if defined(USE_EAP_TLS_SESSION_TICKET)
   890 
   919 
   891 	/**
   920 	/**
   892 	 * This function analyses TLS ChangeCipherSpec protocol.
   921 	 * This function analyses TLS ChangeCipherSpec protocol.
   893 	 */
   922 	 */
   894 	EAP_FUNC_IMPORT eap_status_e analyse_tls_protocol_change_cipher_spec(
   923 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_tls_protocol_change_cipher_spec(
   895 		const tls_record_message_c * const record);
   924 		const tls_record_message_c * const record);
   896 
   925 
   897 	/**
   926 	/**
   898 	 * This function analyses TLS Alert protocol.
   927 	 * This function analyses TLS Alert protocol.
   899 	 */
   928 	 */
   900 	EAP_FUNC_IMPORT eap_status_e analyse_tls_protocol_alert(
   929 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_tls_protocol_alert(
   901 		const tls_record_message_c * const record);
   930 		const tls_record_message_c * const record);
   902 
   931 
   903 	/**
   932 	/**
   904 	 * This function analyses TLS Handshake protocol.
   933 	 * This function analyses TLS Handshake protocol.
   905 	 */
   934 	 */
   906 	EAP_FUNC_IMPORT eap_status_e analyse_tls_protocol_handshake(
   935 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_tls_protocol_handshake(
   907 		tls_record_message_c * const record,
   936 		tls_record_message_c * const record,
   908 		const u8_t received_eap_identifier);
   937 		const u8_t received_eap_identifier);
   909 
   938 
   910 	/**
   939 	/**
   911 	 * This function analyses TLS ApplicationData protocol.
   940 	 * This function analyses TLS ApplicationData protocol.
   912 	 */
   941 	 */
   913 	EAP_FUNC_IMPORT eap_status_e analyse_tls_protocol_application_data(
   942 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e analyse_tls_protocol_application_data(
   914 		const tls_record_message_c * const record,
   943 		const tls_record_message_c * const record,
   915 		const u8_t received_eap_identifier);
   944 		const u8_t received_eap_identifier);
   916 
   945 
   917 	/**
   946 	/**
   918 	 * This function checks whether all pending queries are completed.
   947 	 * This function checks whether all pending queries are completed.
   919 	 */
   948 	 */
   920 	EAP_FUNC_IMPORT eap_status_e are_pending_queries_completed();
   949 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e are_pending_queries_completed();
   921 
   950 
   922 	/**
   951 	/**
   923 	 * This function indicates state to lower layer.
   952 	 * This function indicates state to lower layer.
   924 	 */
   953 	 */
   925 	EAP_FUNC_IMPORT eap_status_e indicate_state_to_lower_layer(
   954 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e indicate_state_to_lower_layer(
   926 		const tls_peap_state_e indicated_state);
   955 		const tls_peap_state_e indicated_state);
   927 
   956 
   928 	/**
   957 	/**
   929 	 * This function indicates all message processed to lower layer.
   958 	 * This function indicates all message processed to lower layer.
   930 	 */
   959 	 */
   931 	EAP_FUNC_IMPORT eap_status_e indicate_messages_processed();
   960 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e indicate_messages_processed();
   932 
   961 
   933 	/**
   962 	/**
   934 	 * This function combines TLS-protocols data to a buffer and sends TLS-message.
   963 	 * This function combines TLS-protocols data to a buffer and sends TLS-message.
   935 	 */
   964 	 */
   936 	EAP_FUNC_IMPORT eap_status_e send_tls_message();
   965 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e send_tls_message();
   937 
   966 
   938 	/**
   967 	/**
   939 	 * This function checks all queries are completed.
   968 	 * This function checks all queries are completed.
   940 	 * If all queries are completed this function send the pending LS-messages.
   969 	 * If all queries are completed this function send the pending LS-messages.
   941 	 */
   970 	 */
   942 	EAP_FUNC_IMPORT eap_status_e check_sent_tls_message();
   971 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e check_sent_tls_message();
   943 
   972 
   944 	/**
   973 	/**
   945 	 * This function check the selected cipher suite is one of the proposed cipher suites.
   974 	 * This function check the selected cipher suite is one of the proposed cipher suites.
   946 	 */
   975 	 */
   947 	EAP_FUNC_IMPORT eap_status_e check_selected_cipher_suite(
   976 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e check_selected_cipher_suite(
   948 		const tls_cipher_suites_e selected_cipher_suite);
   977 		const tls_cipher_suites_e selected_cipher_suite);
   949 
   978 
   950 	/**
   979 	/**
   951 	 * This function check the selected compression method is one of the proposed compression method.
   980 	 * This function check the selected compression method is one of the proposed compression method.
   952 	 */
   981 	 */
   953 	EAP_FUNC_IMPORT eap_status_e check_selected_compression_method(
   982 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e check_selected_compression_method(
   954 		const tls_compression_method_e selected_compression_method);
   983 		const tls_compression_method_e selected_compression_method);
   955 
   984 
   956 	/**
   985 	/**
   957 	 * This function changes one 16-bit value pointed by parameter value from network order to host order.
   986 	 * This function changes one 16-bit value pointed by parameter value from network order to host order.
   958 	 */
   987 	 */
   959 	EAP_FUNC_IMPORT static eap_status_e u16_t_to_host_order(
   988 	EAP_FUNC_VISIBILITY_TLS_RECORD_H static eap_status_e u16_t_to_host_order(
   960 		u16_t * const value,
   989 		u16_t * const value,
   961 		abs_eap_am_tools_c * const m_am_tools);
   990 		abs_eap_am_tools_c * const m_am_tools);
   962 
   991 
   963 	/**
   992 	/**
   964 	 * This function changes one 16-bit value pointed by parameter value from host order to network order.
   993 	 * This function changes one 16-bit value pointed by parameter value from host order to network order.
   965 	 */
   994 	 */
   966 	EAP_FUNC_IMPORT static eap_status_e u16_t_to_network_order(
   995 	EAP_FUNC_VISIBILITY_TLS_RECORD_H static eap_status_e u16_t_to_network_order(
   967 		u16_t * const value,
   996 		u16_t * const value,
   968 		abs_eap_am_tools_c * const m_am_tools);
   997 		abs_eap_am_tools_c * const m_am_tools);
   969 
   998 
   970 	/**
   999 	/**
   971 	 * This function initializes MD5 and SHA hashes.
  1000 	 * This function initializes MD5 and SHA hashes.
   972 	 */
  1001 	 */
   973 	EAP_FUNC_IMPORT eap_status_e message_hash_init();
  1002 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e message_hash_init();
   974 
  1003 
   975 	/**
  1004 	/**
   976 	 * This function adds the send and received TLS-handshake message to MD5 and SHA hashes.
  1005 	 * This function adds the send and received TLS-handshake message to MD5 and SHA hashes.
   977 	 * @param eap includes the buffer of the whole reassembled TLS-packet.
  1006 	 * @param eap includes the buffer of the whole reassembled TLS-packet.
   978 	 * @param packet_length is length in bytes of the TLS-packet.
  1007 	 * @param packet_length is length in bytes of the TLS-packet.
   979 	 */
  1008 	 */
   980 	EAP_FUNC_IMPORT eap_status_e message_hash_update(
  1009 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e message_hash_update(
   981 		const bool true_when_parse_message,
  1010 		const bool true_when_parse_message,
   982 		const tls_handshake_type_e type,
  1011 		const tls_handshake_type_e type,
   983 		u8_t * const tls_packet,
  1012 		u8_t * const tls_packet,
   984 		const u32_t tls_packet_length);
  1013 		const u32_t tls_packet_length);
   985 
  1014 
   987 	 * This function obtains and concatenates the message digest of MD5 and SHA hashes.
  1016 	 * This function obtains and concatenates the message digest of MD5 and SHA hashes.
   988 	 * @param type tells the handshake type where the message digest is used.
  1017 	 * @param type tells the handshake type where the message digest is used.
   989 	 * @param message_hash includes the buffer of the message digest. The message_hash_create() function initializes the buffer.
  1018 	 * @param message_hash includes the buffer of the message digest. The message_hash_create() function initializes the buffer.
   990 	 * @param client_originated is boolean flag. When client calls this function value is true, when server calls this function value is false.
  1019 	 * @param client_originated is boolean flag. When client calls this function value is true, when server calls this function value is false.
   991 	 */
  1020 	 */
   992 	EAP_FUNC_IMPORT eap_status_e message_hash_create(
  1021 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e message_hash_create(
   993 		const bool true_when_parse_message,
  1022 		const bool true_when_parse_message,
   994 		const tls_handshake_type_e type,
  1023 		const tls_handshake_type_e type,
   995 		eap_variable_data_c * const message_hash,
  1024 		eap_variable_data_c * const message_hash,
   996 		const bool client_originated);
  1025 		const bool client_originated);
   997 
  1026 
   998 	EAP_FUNC_IMPORT eap_status_e message_hash_final(
  1027 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e message_hash_final(
   999 		eap_variable_data_c * const md5_digest,
  1028 		eap_variable_data_c * const md5_digest,
  1000 		eap_variable_data_c * const sha1_digest);
  1029 		eap_variable_data_c * const sha1_digest);
  1001 
  1030 
  1002 	/**
  1031 	/**
  1003 	 * This function saves MD5 and SHA hashes for certificate verify message to
  1032 	 * This function saves MD5 and SHA hashes for certificate verify message to
  1004 	 * member attributes m_message_hash_md5_certificate_verify and m_message_hash_sha1_certificate_verify.
  1033 	 * member attributes m_message_hash_md5_certificate_verify and m_message_hash_sha1_certificate_verify.
  1005 	 */
  1034 	 */
  1006 	EAP_FUNC_IMPORT eap_status_e message_hash_save_certificate_verify();
  1035 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e message_hash_save_certificate_verify();
  1007 
  1036 
  1008 	/**
  1037 	/**
  1009 	 * This function saves MD5 and SHA hashes for finished message to
  1038 	 * This function saves MD5 and SHA hashes for finished message to
  1010 	 * member attributes message_hash_md5_finished and message_hash_sha1_finished.
  1039 	 * member attributes message_hash_md5_finished and message_hash_sha1_finished.
  1011 	 */
  1040 	 */
  1012 	EAP_FUNC_IMPORT eap_status_e message_hash_save_finished(
  1041 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e message_hash_save_finished(
  1013 		const bool client_originated);
  1042 		const bool client_originated);
  1014 
  1043 
  1015 	/**
  1044 	/**
  1016 	 * This function creates certificate verfy message hash.
  1045 	 * This function creates certificate verfy message hash.
  1017 	 */
  1046 	 */
  1018 	EAP_FUNC_IMPORT eap_status_e message_hash_create_certificate_verify(
  1047 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e message_hash_create_certificate_verify(
  1019 		const bool client_originated);
  1048 		const bool client_originated);
  1020 
  1049 
  1021 	/**
  1050 	/**
  1022 	 * This function creates finished message hash.
  1051 	 * This function creates finished message hash.
  1023 	 * @param signed_message_hash is pointer to buffer of the message hash.
  1052 	 * @param signed_message_hash is pointer to buffer of the message hash.
  1024 	 */
  1053 	 */
  1025 	EAP_FUNC_IMPORT eap_status_e message_hash_create_finished(
  1054 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e message_hash_create_finished(
  1026 		const bool client_originated_message,
  1055 		const bool client_originated_message,
  1027 		eap_variable_data_c * const signed_message_hash);
  1056 		eap_variable_data_c * const signed_message_hash);
  1028 
  1057 
  1029 
  1058 
  1030 	/**
  1059 	/**
  1031 	 * This function creates SHA1 HASH of server key exchange message when DHE cipher suite is used.
  1060 	 * This function creates SHA1 HASH of server key exchange message when DHE cipher suite is used.
  1032 	 */
  1061 	 */
  1033 	EAP_FUNC_IMPORT eap_status_e create_server_key_exchange_sha1_hash(
  1062 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_server_key_exchange_sha1_hash(
  1034 		const eap_variable_data_c * const dhe_prime,
  1063 		const eap_variable_data_c * const dhe_prime,
  1035 		const eap_variable_data_c * const dhe_group_generator,
  1064 		const eap_variable_data_c * const dhe_group_generator,
  1036 		const eap_variable_data_c * const public_dhe_key,
  1065 		const eap_variable_data_c * const public_dhe_key,
  1037 		eap_variable_data_c * const hash);
  1066 		eap_variable_data_c * const hash);
  1038 
  1067 
  1039 	/**
  1068 	/**
  1040 	 * This function creates MD5 HASH of server key exchange message when DHE cipher suite is used.
  1069 	 * This function creates MD5 HASH of server key exchange message when DHE cipher suite is used.
  1041 	 */
  1070 	 */
  1042 	EAP_FUNC_IMPORT eap_status_e create_server_key_exchange_md5_hash(
  1071 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e create_server_key_exchange_md5_hash(
  1043 		const eap_variable_data_c * const dhe_prime,
  1072 		const eap_variable_data_c * const dhe_prime,
  1044 		const eap_variable_data_c * const dhe_group_generator,
  1073 		const eap_variable_data_c * const dhe_group_generator,
  1045 		const eap_variable_data_c * const public_dhe_key,
  1074 		const eap_variable_data_c * const public_dhe_key,
  1046 		eap_variable_data_c * const hash);
  1075 		eap_variable_data_c * const hash);
  1047 
  1076 
  1048 	/**
  1077 	/**
  1049 	 * This function verifies the HASH of server key exchange message is valid.
  1078 	 * This function verifies the HASH of server key exchange message is valid.
  1050 	 */
  1079 	 */
  1051 	EAP_FUNC_IMPORT eap_status_e verify_signature_of_server_key_exchange(
  1080 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e verify_signature_of_server_key_exchange(
  1052 		const eap_variable_data_c * const signed_server_key_exchange_hash);
  1081 		const eap_variable_data_c * const signed_server_key_exchange_hash);
  1053 
  1082 
  1054 
  1083 
  1055 
  1084 
  1056 	/**
  1085 	/**
  1057 	 * This function verifies the cipher suite is one of using 3DES_EDE_CBC_SHA.
  1086 	 * This function verifies the cipher suite is one of using 3DES_EDE_CBC_SHA.
  1058 	 */
  1087 	 */
  1059 	EAP_FUNC_IMPORT bool cipher_suite_is_3DES_EDE_CBC_SHA(tls_cipher_suites_e cipher_suite) const;
  1088 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool cipher_suite_is_3DES_EDE_CBC_SHA(tls_cipher_suites_e cipher_suite) const;
  1060 
  1089 
  1061 	/**
  1090 	/**
  1062 	 * This function verifies the cipher suite is one of using AES_128_CBC_SHA.
  1091 	 * This function verifies the cipher suite is one of using AES_128_CBC_SHA.
  1063 	 */
  1092 	 */
  1064 	EAP_FUNC_IMPORT bool cipher_suite_is_AES_128_CBC_SHA(tls_cipher_suites_e cipher_suite) const;
  1093 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool cipher_suite_is_AES_128_CBC_SHA(tls_cipher_suites_e cipher_suite) const;
  1065 
  1094 
  1066 	/**
  1095 	/**
  1067 	 * This function verifies the cipher suite is one of using RC4_128_MD5.
  1096 	 * This function verifies the cipher suite is one of using RC4_128_MD5.
  1068 	 */
  1097 	 */
  1069 	EAP_FUNC_IMPORT bool cipher_suite_is_RC4_128_MD5(tls_cipher_suites_e cipher_suite) const;
  1098 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool cipher_suite_is_RC4_128_MD5(tls_cipher_suites_e cipher_suite) const;
  1070 
  1099 
  1071 	/**
  1100 	/**
  1072 	 * This function verifies the cipher suite is one of using RC4_128_SHA.
  1101 	 * This function verifies the cipher suite is one of using RC4_128_SHA.
  1073 	 */
  1102 	 */
  1074 	EAP_FUNC_IMPORT bool cipher_suite_is_RC4_128_SHA(tls_cipher_suites_e cipher_suite) const;
  1103 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool cipher_suite_is_RC4_128_SHA(tls_cipher_suites_e cipher_suite) const;
  1075 
  1104 
  1076 
  1105 
  1077 
  1106 
  1078 	/**
  1107 	/**
  1079 	 * This function verifies the current cipher suite is one of using TLS_RSA.
  1108 	 * This function verifies the current cipher suite is one of using TLS_RSA.
  1080 	 */
  1109 	 */
  1081 	EAP_FUNC_IMPORT bool cipher_suite_is_TLS_RSA() const;
  1110 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool cipher_suite_is_TLS_RSA() const;
  1082 
  1111 
  1083 	/**
  1112 	/**
  1084 	 * This function verifies the current cipher suite is one of using TLS_DHE_RSA.
  1113 	 * This function verifies the current cipher suite is one of using TLS_DHE_RSA.
  1085 	 */
  1114 	 */
  1086 	EAP_FUNC_IMPORT bool cipher_suite_is_TLS_DHE_RSA() const;
  1115 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool cipher_suite_is_TLS_DHE_RSA() const;
  1087 
  1116 
  1088 	/**
  1117 	/**
  1089 	 * This function verifies the current cipher suite is one of using TLS_DHE_DSS.
  1118 	 * This function verifies the current cipher suite is one of using TLS_DHE_DSS.
  1090 	 */
  1119 	 */
  1091 	EAP_FUNC_IMPORT bool cipher_suite_is_TLS_DHE_DSS() const;
  1120 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool cipher_suite_is_TLS_DHE_DSS() const;
  1092 
  1121 
  1093 #if defined(USE_FAST_EAP_TYPE)
  1122 #if defined(USE_FAST_EAP_TYPE)
  1094 	/**
  1123 	/**
  1095 	 * This function verifies the current cipher suite is one of using TLS_DH_anon.
  1124 	 * This function verifies the current cipher suite is one of using TLS_DH_anon.
  1096 	 */
  1125 	 */
  1097 	EAP_FUNC_IMPORT bool cipher_suite_is_TLS_DH_anon() const;
  1126 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool cipher_suite_is_TLS_DH_anon() const;
  1098 #endif //#if defined(USE_FAST_EAP_TYPE)
  1127 #endif //#if defined(USE_FAST_EAP_TYPE)
  1099 
  1128 
  1100 
  1129 
  1101 #if EAP_TLS_NOT_SUPPORTED_CIPHER_SUITE
  1130 #if EAP_TLS_NOT_SUPPORTED_CIPHER_SUITE
  1102 	This is not implemented yet
  1131 	This is not implemented yet
  1103 	EAP_FUNC_IMPORT bool cipher_suite_is_TLS_DH_DSS() const;
  1132 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool cipher_suite_is_TLS_DH_DSS() const;
  1104 #endif
  1133 #endif
  1105 
  1134 
  1106 
  1135 
  1107 
  1136 
  1108 	/**
  1137 	/**
  1109 	 * This function generates ephemeral Diffie-Hellman keys.
  1138 	 * This function generates ephemeral Diffie-Hellman keys.
  1110 	 * Keys are stored to m_own_private_dhe_key and m_own_public_dhe_key.
  1139 	 * Keys are stored to m_own_private_dhe_key and m_own_public_dhe_key.
  1111 	 */
  1140 	 */
  1112 	EAP_FUNC_IMPORT eap_status_e generate_dhe_keys();
  1141 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e generate_dhe_keys();
  1113 
  1142 
  1114 	/**
  1143 	/**
  1115 	 * This function generates master secret.
  1144 	 * This function generates master secret.
  1116 	 */
  1145 	 */
  1117 	EAP_FUNC_IMPORT eap_status_e generate_master_secret();
  1146 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e generate_master_secret();
  1118 
  1147 
  1119 	/**
  1148 	/**
  1120 	 * This function generates premaster secret.
  1149 	 * This function generates premaster secret.
  1121 	 */
  1150 	 */
  1122 	EAP_FUNC_IMPORT eap_status_e generate_premaster_secret();
  1151 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e generate_premaster_secret();
  1123 
  1152 
  1124 #if defined(USE_FAST_EAP_TYPE)
  1153 #if defined(USE_FAST_EAP_TYPE)
  1125 	/**
  1154 	/**
  1126 	 * This function generates master secret from EAP-FAST PAC-Key.
  1155 	 * This function generates master secret from EAP-FAST PAC-Key.
  1127 	 */
  1156 	 */
  1128 	EAP_FUNC_IMPORT eap_status_e generate_eap_fast_master_secret_from_pac_key(
  1157 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e generate_eap_fast_master_secret_from_pac_key(
  1129 		const eap_variable_data_c * const pac_key);
  1158 		const eap_variable_data_c * const pac_key);
  1130 #endif //#if defined(USE_FAST_EAP_TYPE)
  1159 #endif //#if defined(USE_FAST_EAP_TYPE)
  1131 
  1160 
  1132 
  1161 
  1133 	EAP_FUNC_IMPORT void send_error_notification(const eap_status_e error);
  1162 	EAP_FUNC_VISIBILITY_TLS_RECORD_H void send_error_notification(const eap_status_e error);
  1134 
  1163 
  1135 	/**
  1164 	/**
  1136 	 * This function adds new completion action to the end of the m_completion_queue.
  1165 	 * This function adds new completion action to the end of the m_completion_queue.
  1137 	 */
  1166 	 */
  1138 	EAP_FUNC_IMPORT eap_status_e completion_action_add(
  1167 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e completion_action_add(
  1139 		tls_completion_action_e action);
  1168 		tls_completion_action_e action);
  1140 
  1169 
  1141 	/**
  1170 	/**
  1142 	 * This function verifies all completion actions are completed.
  1171 	 * This function verifies all completion actions are completed.
  1143 	 */
  1172 	 */
  1144 	EAP_FUNC_IMPORT eap_status_e completion_action_clenup();
  1173 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e completion_action_clenup();
  1145 
  1174 
  1146 	/**
  1175 	/**
  1147 	 * This function checks and completes completion actions.
  1176 	 * This function checks and completes completion actions.
  1148 	 * This function could return eap_status_pending_request if the
  1177 	 * This function could return eap_status_pending_request if the
  1149 	 * first completion action cannot be completed yet.
  1178 	 * first completion action cannot be completed yet.
  1150 	 */
  1179 	 */
  1151 	EAP_FUNC_IMPORT eap_status_e completion_action_check();
  1180 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e completion_action_check();
  1152 
  1181 
  1153 
  1182 
  1154 
  1183 
  1155 
  1184 
  1156 	/**
  1185 	/**
  1157 	 * This function generates random padding length. See chapter "6.2.3.2. CBC block cipher" in <a href="../../type/tls_peap/documentation/rfc2246.txt">RFC 2246</a>.
  1186 	 * This function generates random padding length. See chapter "6.2.3.2. CBC block cipher" in <a href="../../type/tls_peap/documentation/rfc2246.txt">RFC 2246</a>.
  1158 	 */
  1187 	 */
  1159 	EAP_FUNC_IMPORT u8_t get_extra_padding_length(const u8_t padding_length, const u32_t block_size);
  1188 	EAP_FUNC_VISIBILITY_TLS_RECORD_H u8_t get_extra_padding_length(const u8_t padding_length, const u32_t block_size);
  1160 
  1189 
  1161 	/**
  1190 	/**
  1162 	 * This function applies the current block cipher suite to send TLS-record.
  1191 	 * This function applies the current block cipher suite to send TLS-record.
  1163 	 */
  1192 	 */
  1164 	EAP_FUNC_IMPORT eap_status_e apply_send_block_cipher_suite(
  1193 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e apply_send_block_cipher_suite(
  1165 		eap_variable_data_c * const tls_record_message_buffer,
  1194 		eap_variable_data_c * const tls_record_message_buffer,
  1166 		abs_crypto_cbc_block_algorithm_c * const encrypt,
  1195 		abs_crypto_cbc_block_algorithm_c * const encrypt,
  1167 		abs_crypto_hmac_algorithm_c * const mac);
  1196 		abs_crypto_hmac_algorithm_c * const mac);
  1168 
  1197 
  1169 	/**
  1198 	/**
  1170 	 * This function applies the current block cipher suite to received TLS-record.
  1199 	 * This function applies the current block cipher suite to received TLS-record.
  1171 	 */
  1200 	 */
  1172 	EAP_FUNC_IMPORT eap_status_e apply_receive_block_cipher_suite(
  1201 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e apply_receive_block_cipher_suite(
  1173 		eap_variable_data_c * const tls_record_message_buffer,
  1202 		eap_variable_data_c * const tls_record_message_buffer,
  1174 		abs_crypto_cbc_block_algorithm_c * const decrypt,
  1203 		abs_crypto_cbc_block_algorithm_c * const decrypt,
  1175 		abs_crypto_hmac_algorithm_c * const mac);
  1204 		abs_crypto_hmac_algorithm_c * const mac);
  1176 
  1205 
  1177 	/**
  1206 	/**
  1178 	 * This function applies the current stream cipher suite to send TLS-record.
  1207 	 * This function applies the current stream cipher suite to send TLS-record.
  1179 	 */
  1208 	 */
  1180 	EAP_FUNC_IMPORT eap_status_e apply_send_stream_cipher_suite(
  1209 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e apply_send_stream_cipher_suite(
  1181 		eap_variable_data_c * const tls_record_message_buffer,
  1210 		eap_variable_data_c * const tls_record_message_buffer,
  1182 		abs_crypto_stream_algorithm_c * const encrypt,
  1211 		abs_crypto_stream_algorithm_c * const encrypt,
  1183 		abs_crypto_hmac_algorithm_c * const mac);
  1212 		abs_crypto_hmac_algorithm_c * const mac);
  1184 
  1213 
  1185 	/**
  1214 	/**
  1186 	 * This function applies the current stream cipher suite to received TLS-record.
  1215 	 * This function applies the current stream cipher suite to received TLS-record.
  1187 	 */
  1216 	 */
  1188 	EAP_FUNC_IMPORT eap_status_e apply_receive_stream_cipher_suite(
  1217 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e apply_receive_stream_cipher_suite(
  1189 		eap_variable_data_c * const tls_record_message_buffer,
  1218 		eap_variable_data_c * const tls_record_message_buffer,
  1190 		abs_crypto_stream_algorithm_c * const decrypt,
  1219 		abs_crypto_stream_algorithm_c * const decrypt,
  1191 		abs_crypto_hmac_algorithm_c * const mac);
  1220 		abs_crypto_hmac_algorithm_c * const mac);
  1192 
  1221 
  1193 	/**
  1222 	/**
  1194 	 * This function applies the current cipher suite to send TLS-record.
  1223 	 * This function applies the current cipher suite to send TLS-record.
  1195 	 */
  1224 	 */
  1196 	EAP_FUNC_IMPORT eap_status_e apply_send_cipher_suite(
  1225 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e apply_send_cipher_suite(
  1197 		eap_variable_data_c * const tls_record_message_buffer);
  1226 		eap_variable_data_c * const tls_record_message_buffer);
  1198 
  1227 
  1199 	/**
  1228 	/**
  1200 	 * This function applies the current cipher suite to received TLS-record.
  1229 	 * This function applies the current cipher suite to received TLS-record.
  1201 	 */
  1230 	 */
  1202 	EAP_FUNC_IMPORT eap_status_e apply_receive_cipher_suite(
  1231 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e apply_receive_cipher_suite(
  1203 		eap_variable_data_c * const tls_record_message_buffer);
  1232 		eap_variable_data_c * const tls_record_message_buffer);
  1204 
  1233 
  1205 	/** This function hides create_tls_protocol_alert() call.
  1234 	/** This function hides create_tls_protocol_alert() call.
  1206 	 */
  1235 	 */
  1207 	EAP_FUNC_IMPORT eap_status_e eap_status_return_and_create_tls_protocol_alert(
  1236 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e eap_status_return_and_create_tls_protocol_alert(
  1208 		const eap_status_e status);
  1237 		const eap_status_e status);
  1209 
  1238 
  1210 
  1239 
  1211 	/**
  1240 	/**
  1212 	 * This function sets the state of TLS.
  1241 	 * This function sets the state of TLS.
  1213 	 */
  1242 	 */
  1214 	EAP_FUNC_IMPORT tls_peap_state_e get_state() const;
  1243 	EAP_FUNC_VISIBILITY_TLS_RECORD_H tls_peap_state_e get_state() const;
  1215 
  1244 
  1216 	/**
  1245 	/**
  1217 	 * This function gets the state of TLS.
  1246 	 * This function gets the state of TLS.
  1218 	 */
  1247 	 */
  1219 	EAP_FUNC_IMPORT void set_state(const tls_peap_state_e state);
  1248 	EAP_FUNC_VISIBILITY_TLS_RECORD_H void set_state(const tls_peap_state_e state);
  1220 
  1249 
  1221 	/**
  1250 	/**
  1222 	 * This function verified the current state of TLS and parameter state are equal.
  1251 	 * This function verified the current state of TLS and parameter state are equal.
  1223 	 */
  1252 	 */
  1224 	EAP_FUNC_IMPORT bool verify_state(const tls_peap_state_e state);
  1253 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool verify_state(const tls_peap_state_e state);
  1225 
  1254 
  1226 
  1255 
  1227 
  1256 
  1228 	/**
  1257 	/**
  1229 	 * This function initializes encryption and decryption objects for block cipher suite.
  1258 	 * This function initializes encryption and decryption objects for block cipher suite.
  1230 	 */
  1259 	 */
  1231 	EAP_FUNC_IMPORT eap_status_e cipher_suite_initialization_cbc(
  1260 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e cipher_suite_initialization_cbc(
  1232 		abs_crypto_cbc_block_algorithm_c ** const cbc_crypto_block_algorithm,
  1261 		abs_crypto_cbc_block_algorithm_c ** const cbc_crypto_block_algorithm,
  1233 		abs_crypto_block_algorithm_c * const crypto_block_algorithm,
  1262 		abs_crypto_block_algorithm_c * const crypto_block_algorithm,
  1234 		const eap_variable_data_c * const iv,
  1263 		const eap_variable_data_c * const iv,
  1235 		const eap_variable_data_c * const key,
  1264 		const eap_variable_data_c * const key,
  1236 		const bool true_when_encrypt);
  1265 		const bool true_when_encrypt);
  1237 
  1266 
  1238 	/**
  1267 	/**
  1239 	 * This function initializes HMAC algorithm objects.
  1268 	 * This function initializes HMAC algorithm objects.
  1240 	 */
  1269 	 */
  1241 	EAP_FUNC_IMPORT eap_status_e cipher_suite_initialization_hmac(
  1270 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e cipher_suite_initialization_hmac(
  1242 		abs_crypto_hmac_algorithm_c * const hmac_algorithm,
  1271 		abs_crypto_hmac_algorithm_c * const hmac_algorithm,
  1243 		const eap_variable_data_c * const key);
  1272 		const eap_variable_data_c * const key);
  1244 
  1273 
  1245 	/**
  1274 	/**
  1246 	 * This function initializes encryption and decryption objects for stream cipher suite.
  1275 	 * This function initializes encryption and decryption objects for stream cipher suite.
  1247 	 */
  1276 	 */
  1248 	EAP_FUNC_IMPORT eap_status_e cipher_suite_initialization_stream(
  1277 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e cipher_suite_initialization_stream(
  1249 		abs_crypto_stream_algorithm_c * const crypto_stream_algorithm,
  1278 		abs_crypto_stream_algorithm_c * const crypto_stream_algorithm,
  1250 		const eap_variable_data_c * const key,
  1279 		const eap_variable_data_c * const key,
  1251 		const bool true_when_encrypt);
  1280 		const bool true_when_encrypt);
  1252 
  1281 
  1253 	/**
  1282 	/**
  1254 	 * This function initializes HMAC-SHA1 objects for current cipher suite.
  1283 	 * This function initializes HMAC-SHA1 objects for current cipher suite.
  1255 	 */
  1284 	 */
  1256 	EAP_FUNC_IMPORT eap_status_e cipher_suite_initialization_hmac_sha1(const bool send_when_true);
  1285 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e cipher_suite_initialization_hmac_sha1(const bool send_when_true);
  1257 
  1286 
  1258 	/**
  1287 	/**
  1259 	 * This function initializes HMAC-MD5 objects for current cipher suite.
  1288 	 * This function initializes HMAC-MD5 objects for current cipher suite.
  1260 	 */
  1289 	 */
  1261 	EAP_FUNC_IMPORT eap_status_e cipher_suite_initialization_hmac_md5(const bool send_when_true);
  1290 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e cipher_suite_initialization_hmac_md5(const bool send_when_true);
  1262 
  1291 
  1263 	/**
  1292 	/**
  1264 	 * This function initializes encryption and decryption objects for current cipher suite.
  1293 	 * This function initializes encryption and decryption objects for current cipher suite.
  1265 	 */
  1294 	 */
  1266 	EAP_FUNC_IMPORT eap_status_e cipher_suite_initialization(
  1295 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e cipher_suite_initialization(
  1267 		const bool send_when_true);
  1296 		const bool send_when_true);
  1268 
  1297 
  1269 
  1298 
  1270 
  1299 
  1271 	/**
  1300 	/**
  1272 	 * This function creates a new TLS-record message or returns tha last one if
  1301 	 * This function creates a new TLS-record message or returns tha last one if
  1273 	 * parameter protocol and ther last TLS-record message match.
  1302 	 * parameter protocol and ther last TLS-record message match.
  1274 	 */
  1303 	 */
  1275 	EAP_FUNC_IMPORT eap_status_e new_record_message(
  1304 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e new_record_message(
  1276 		tls_record_message_c ** const tls_record_message,
  1305 		tls_record_message_c ** const tls_record_message,
  1277 		const tls_record_protocol_e protocol);
  1306 		const tls_record_protocol_e protocol);
  1278 
  1307 
  1279 	/**
  1308 	/**
  1280 	 * This function creates a new TLS-record including handshake protocol message.
  1309 	 * This function creates a new TLS-record including handshake protocol message.
  1281 	 */
  1310 	 */
  1282 	EAP_FUNC_IMPORT eap_status_e add_record_message(
  1311 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e add_record_message(
  1283 		tls_handshake_message_c * const tls_handshake_message);
  1312 		tls_handshake_message_c * const tls_handshake_message);
  1284 
  1313 
  1285 	/**
  1314 	/**
  1286 	 * This function creates a new TLS-record including change cipher spec protocol message.
  1315 	 * This function creates a new TLS-record including change cipher spec protocol message.
  1287 	 */
  1316 	 */
  1288 	EAP_FUNC_IMPORT eap_status_e add_record_message(
  1317 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e add_record_message(
  1289 		tls_change_cipher_spec_message_c * const change_cipher_spec_message);
  1318 		tls_change_cipher_spec_message_c * const change_cipher_spec_message);
  1290 
  1319 
  1291 	/**
  1320 	/**
  1292 	 * This function creates a new TLS-record including alert protocol message.
  1321 	 * This function creates a new TLS-record including alert protocol message.
  1293 	 */
  1322 	 */
  1294 	EAP_FUNC_IMPORT eap_status_e add_record_message(
  1323 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e add_record_message(
  1295 		tls_alert_message_c * const alert_message);
  1324 		tls_alert_message_c * const alert_message);
  1296 
  1325 
  1297 	/**
  1326 	/**
  1298 	 * This function creates a new TLS-record including application data protocol message.
  1327 	 * This function creates a new TLS-record including application data protocol message.
  1299 	 */
  1328 	 */
  1300 	EAP_FUNC_IMPORT eap_status_e add_record_message(
  1329 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e add_record_message(
  1301 		tls_application_data_message_c * const application_data_message);
  1330 		tls_application_data_message_c * const application_data_message);
  1302 
  1331 
  1303 	EAP_FUNC_IMPORT void reset_block_ciphers(const bool send_when_true);
  1332 	EAP_FUNC_VISIBILITY_TLS_RECORD_H void reset_block_ciphers(const bool send_when_true);
  1304 
  1333 
  1305 	EAP_FUNC_IMPORT void reset_stream_ciphers(const bool send_when_true);
  1334 	EAP_FUNC_VISIBILITY_TLS_RECORD_H void reset_stream_ciphers(const bool send_when_true);
  1306 
  1335 
  1307 	EAP_FUNC_IMPORT void reset_hmac_algorithms(const bool send_when_true);
  1336 	EAP_FUNC_VISIBILITY_TLS_RECORD_H void reset_hmac_algorithms(const bool send_when_true);
  1308 
  1337 
  1309 	EAP_FUNC_IMPORT eap_status_e get_tls_prf_data(
  1338 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e get_tls_prf_data(
  1310 		const eap_variable_data_c * const master_secret,
  1339 		const eap_variable_data_c * const master_secret,
  1311 		const eap_variable_data_c * const client_random,
  1340 		const eap_variable_data_c * const client_random,
  1312 		const eap_variable_data_c * const server_random,
  1341 		const eap_variable_data_c * const server_random,
  1313 		const eap_variable_data_c * const label,
  1342 		const eap_variable_data_c * const label,
  1314 		eap_variable_data_c * const prf_data,
  1343 		eap_variable_data_c * const prf_data,
  1315 		const u32_t required_prf_data_length);
  1344 		const u32_t required_prf_data_length);
  1316 
  1345 
  1317 	EAP_FUNC_IMPORT eap_status_e set_tls_session_type(const tls_session_type_e tls_session_type);
  1346 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e set_tls_session_type(const tls_session_type_e tls_session_type);
  1318 
  1347 
  1319 	EAP_FUNC_IMPORT tls_session_type_e get_tls_session_type();
  1348 	EAP_FUNC_VISIBILITY_TLS_RECORD_H tls_session_type_e get_tls_session_type();
  1320 
  1349 
  1321 	EAP_FUNC_IMPORT void set_tls_identity_privacy_handshake_state(const tls_identity_privacy_handshake_state_e state);
  1350 	EAP_FUNC_VISIBILITY_TLS_RECORD_H void set_tls_identity_privacy_handshake_state(const tls_identity_privacy_handshake_state_e state);
  1322 
  1351 
  1323 	EAP_FUNC_IMPORT void set_selected_cipher_suite(const tls_cipher_suites_e cipher_suite);
  1352 	EAP_FUNC_VISIBILITY_TLS_RECORD_H void set_selected_cipher_suite(const tls_cipher_suites_e cipher_suite);
  1324 
  1353 
  1325 	EAP_FUNC_IMPORT eap_status_e set_receive_cipher_suite(const tls_cipher_suites_e cipher_suite);
  1354 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e set_receive_cipher_suite(const tls_cipher_suites_e cipher_suite);
  1326 
  1355 
  1327 	EAP_FUNC_IMPORT eap_status_e set_send_cipher_suite(const tls_cipher_suites_e cipher_suite);
  1356 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e set_send_cipher_suite(const tls_cipher_suites_e cipher_suite);
  1328 
  1357 
  1329 	//--------------------------------------------------
  1358 	//--------------------------------------------------
  1330 protected:
  1359 protected:
  1331 	//--------------------------------------------------
  1360 	//--------------------------------------------------
  1332 
  1361 
  1335 	//--------------------------------------------------
  1364 	//--------------------------------------------------
  1336 
  1365 
  1337 	/**
  1366 	/**
  1338 	 * The destructor of the tls_record_c class does nothing special.
  1367 	 * The destructor of the tls_record_c class does nothing special.
  1339 	 */
  1368 	 */
  1340 	EAP_FUNC_IMPORT virtual ~tls_record_c();
  1369 	EAP_FUNC_VISIBILITY_TLS_RECORD_H virtual ~tls_record_c();
  1341 
  1370 
  1342 	/**
  1371 	/**
  1343 	 * The constructor of the tls_record_c class simply initializes the attributes.
  1372 	 * The constructor of the tls_record_c class simply initializes the attributes.
  1344 	 * The tls_record_c object sends packets to the network using tls_base_record_c::get_type_partner() object.
  1373 	 * The tls_record_c object sends packets to the network using tls_base_record_c::get_type_partner() object.
  1345 	 */
  1374 	 */
  1346 	EAP_FUNC_IMPORT tls_record_c(
  1375 	EAP_FUNC_VISIBILITY_TLS_RECORD_H tls_record_c(
  1347 		abs_eap_am_tools_c * const tools, ///< tools is pointer to the tools class. @see abs_eap_am_tools_c.
  1376 		abs_eap_am_tools_c * const tools, ///< tools is pointer to the tools class. @see abs_eap_am_tools_c.
  1348 		tls_am_services_c * const am_tls_services, ///< This is pointer to adaoptation module of TLS.
  1377 		tls_am_services_c * const am_tls_services, ///< This is pointer to adaoptation module of TLS.
  1349 		const bool free_am_tls_services,
  1378 		const bool free_am_tls_services,
  1350 		tls_base_application_c * const application, ///< application is pointer to application object.
  1379 		tls_base_application_c * const application, ///< application is pointer to application object.
  1351 		const bool free_application,
  1380 		const bool free_application,
  1354 		const eap_am_network_id_c * const receive_network_id);
  1383 		const eap_am_network_id_c * const receive_network_id);
  1355 
  1384 
  1356 	/**
  1385 	/**
  1357 	 * This function returns true when EAP-type is TTLS or PEAP.
  1386 	 * This function returns true when EAP-type is TTLS or PEAP.
  1358 	 */
  1387 	 */
  1359 	EAP_FUNC_IMPORT bool get_is_tunneled_tls();
  1388 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool get_is_tunneled_tls();
  1360 
  1389 
  1361 	/**
  1390 	/**
  1362 	 * This function sets the tunnel type.
  1391 	 * This function sets the tunnel type.
  1363 	 */
  1392 	 */
  1364 	void set_peap_version(
  1393 	void set_peap_version(
  1369 	/**
  1398 	/**
  1370 	 * The configure() function is called after the constructor of the 
  1399 	 * The configure() function is called after the constructor of the 
  1371 	 * object is successfully executed. During the function call the object 
  1400 	 * object is successfully executed. During the function call the object 
  1372 	 * could query the configuration. Each derived class must define this function.
  1401 	 * could query the configuration. Each derived class must define this function.
  1373 	 */
  1402 	 */
  1374 	EAP_FUNC_IMPORT eap_status_e configure();
  1403 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e configure();
  1375 
  1404 
  1376 	/**
  1405 	/**
  1377 	 * The shutdown() function is called before the destructor of the 
  1406 	 * The shutdown() function is called before the destructor of the 
  1378 	 * object is executed. During the function call the object 
  1407 	 * object is executed. During the function call the object 
  1379 	 * could shutdown the operations, for example cancel timers.
  1408 	 * could shutdown the operations, for example cancel timers.
  1380 	 * Each derived class must define this function.
  1409 	 * Each derived class must define this function.
  1381 	 */
  1410 	 */
  1382 	EAP_FUNC_IMPORT eap_status_e shutdown();
  1411 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e shutdown();
  1383 
  1412 
  1384 	EAP_FUNC_IMPORT eap_status_e get_ttls_implicit_challenge(
  1413 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e get_ttls_implicit_challenge(
  1385 		eap_variable_data_c * const ttls_implicit_challenge,
  1414 		eap_variable_data_c * const ttls_implicit_challenge,
  1386 		const u32_t required_ttls_implicit_challenge_length);
  1415 		const u32_t required_ttls_implicit_challenge_length);
  1387 
  1416 
  1388 	/**
  1417 	/**
  1389 	 * This function sets the NAI realm.
  1418 	 * This function sets the NAI realm.
  1390 	 */
  1419 	 */
  1391 	EAP_FUNC_IMPORT eap_status_e set_nai_realm(
  1420 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e set_nai_realm(
  1392 		const eap_variable_data_c * const NAI_realm ///< This is the full NAI realm.
  1421 		const eap_variable_data_c * const NAI_realm ///< This is the full NAI realm.
  1393 		);
  1422 		);
  1394 
  1423 
  1395 	// This is commented in abs_tls_base_application_c.
  1424 	// This is commented in abs_tls_base_application_c.
  1396 	EAP_FUNC_IMPORT eap_status_e packet_send(
  1425 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e packet_send(
  1397 		eap_buf_chain_wr_c * const sent_packet,
  1426 		eap_buf_chain_wr_c * const sent_packet,
  1398 		const u32_t header_offset,
  1427 		const u32_t header_offset,
  1399 		const u32_t data_length,
  1428 		const u32_t data_length,
  1400 		const u32_t buffer_length);
  1429 		const u32_t buffer_length);
  1401 
  1430 
  1402 	// This is commented in abs_tls_base_application_c.
  1431 	// This is commented in abs_tls_base_application_c.
  1403 	EAP_FUNC_IMPORT u32_t get_header_offset(
  1432 	EAP_FUNC_VISIBILITY_TLS_RECORD_H u32_t get_header_offset(
  1404 		u32_t * const MTU_length,
  1433 		u32_t * const MTU_length,
  1405 		u32_t * const trailer_length);
  1434 		u32_t * const trailer_length);
  1406 
  1435 
  1407 	// This is commented in abs_tls_base_application_c.
  1436 	// This is commented in abs_tls_base_application_c.
  1408 	EAP_FUNC_IMPORT eap_status_e read_configure(
  1437 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e read_configure(
  1409 		const eap_configuration_field_c * const field,
  1438 		const eap_configuration_field_c * const field,
  1410 		eap_variable_data_c * const data);
  1439 		eap_variable_data_c * const data);
  1411 
  1440 
  1412 	// This is commented in abs_tls_base_application_c.
  1441 	// This is commented in abs_tls_base_application_c.
  1413 	EAP_FUNC_IMPORT eap_status_e write_configure(
  1442 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e write_configure(
  1414 		const eap_configuration_field_c * const field,
  1443 		const eap_configuration_field_c * const field,
  1415 		eap_variable_data_c * const data);
  1444 		eap_variable_data_c * const data);
  1416 
  1445 
  1417 	// This is commented in abs_tls_base_application_c.
  1446 	// This is commented in abs_tls_base_application_c.
  1418 	EAP_FUNC_IMPORT void state_notification(
  1447 	EAP_FUNC_VISIBILITY_TLS_RECORD_H void state_notification(
  1419 		const abs_eap_state_notification_c * const state);
  1448 		const abs_eap_state_notification_c * const state);
  1420 
  1449 
  1421 	// This is commented in abs_tls_base_application_c.
  1450 	// This is commented in abs_tls_base_application_c.
  1422 	EAP_FUNC_IMPORT eap_status_e set_timer(
  1451 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e set_timer(
  1423 		abs_eap_base_timer_c * const initializer, 
  1452 		abs_eap_base_timer_c * const initializer, 
  1424 		const u32_t id, 
  1453 		const u32_t id, 
  1425 		void * const data,
  1454 		void * const data,
  1426 		const u32_t p_time_ms);
  1455 		const u32_t p_time_ms);
  1427 
  1456 
  1428 	// This is commented in abs_tls_base_application_c.
  1457 	// This is commented in abs_tls_base_application_c.
  1429 	EAP_FUNC_IMPORT eap_status_e cancel_timer(
  1458 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e cancel_timer(
  1430 		abs_eap_base_timer_c * const initializer, 
  1459 		abs_eap_base_timer_c * const initializer, 
  1431 		const u32_t id);
  1460 		const u32_t id);
  1432 
  1461 
  1433 	// This is commented in abs_tls_base_application_c.
  1462 	// This is commented in abs_tls_base_application_c.
  1434 	EAP_FUNC_IMPORT eap_status_e load_module(
  1463 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e load_module(
  1435 		const eap_type_value_e type,
  1464 		const eap_type_value_e type,
  1436 		const eap_type_value_e /* tunneling_type */,
  1465 		const eap_type_value_e /* tunneling_type */,
  1437 		abs_eap_base_type_c * const partner,
  1466 		abs_eap_base_type_c * const partner,
  1438 		eap_base_type_c ** const eap_type,
  1467 		eap_base_type_c ** const eap_type,
  1439 		const bool is_client_when_true,
  1468 		const bool is_client_when_true,
  1440 		const eap_am_network_id_c * const receive_network_id);
  1469 		const eap_am_network_id_c * const receive_network_id);
  1441 
  1470 
  1442 	// This is commented in abs_tls_base_application_c.
  1471 	// This is commented in abs_tls_base_application_c.
  1443 	EAP_FUNC_IMPORT eap_status_e unload_module(const eap_type_value_e type);
  1472 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e unload_module(const eap_type_value_e type);
  1444 
  1473 
  1445 	// This is commented in abs_tls_base_application_c.
  1474 	// This is commented in abs_tls_base_application_c.
  1446 	EAP_FUNC_IMPORT eap_status_e restart_authentication(
  1475 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e restart_authentication(
  1447 		const eap_am_network_id_c * const receive_network_id,
  1476 		const eap_am_network_id_c * const receive_network_id,
  1448 		const bool is_client_when_true,
  1477 		const bool is_client_when_true,
  1449 		const bool force_clean_restart,
  1478 		const bool force_clean_restart,
  1450 		const bool from_timer);
  1479 		const bool from_timer);
  1451 
  1480 
  1452 	// This is commented in abs_tls_base_application_c.
  1481 	// This is commented in abs_tls_base_application_c.
  1453 	EAP_FUNC_IMPORT eap_status_e packet_data_crypto_keys(
  1482 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e packet_data_crypto_keys(
  1454 		const eap_am_network_id_c * const send_network_id,
  1483 		const eap_am_network_id_c * const send_network_id,
  1455 		const eap_master_session_key_c * const master_session_key);
  1484 		const eap_master_session_key_c * const master_session_key);
  1456 
  1485 
  1457 	// This is commented in abs_tls_base_application_c.
  1486 	// This is commented in abs_tls_base_application_c.
  1458 	EAP_FUNC_IMPORT eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type);
  1487 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type);
  1459 
  1488 
  1460 	// This is commented in abs_tls_base_application_c::get_eap_type_list().
  1489 	// This is commented in abs_tls_base_application_c::get_eap_type_list().
  1461 	EAP_FUNC_IMPORT eap_status_e get_eap_type_list(
  1490 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e get_eap_type_list(
  1462 		eap_array_c<eap_type_value_e> * const eap_type_list);
  1491 		eap_array_c<eap_type_value_e> * const eap_type_list);
  1463 
  1492 
  1464 	/**
  1493 	/**
  1465 	 * This function sends starts EAP-TLS/PEAP after a start message is received.
  1494 	 * This function sends starts EAP-TLS/PEAP after a start message is received.
  1466 	 */
  1495 	 */
  1467 	EAP_FUNC_IMPORT eap_status_e start_tls_peap_authentication(
  1496 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e start_tls_peap_authentication(
  1468 		const eap_variable_data_c * const received_authority_identity
  1497 		const eap_variable_data_c * const received_authority_identity
  1469 		);
  1498 		);
  1470 
  1499 
  1471 	/**
  1500 	/**
  1472 	 * This function processes the received packet.
  1501 	 * This function processes the received packet.
  1473 	 * @param tls_packet includes the buffer of the whole reassembled TLS-packet.
  1502 	 * @param tls_packet includes the buffer of the whole reassembled TLS-packet.
  1474 	 */
  1503 	 */
  1475 	EAP_FUNC_IMPORT eap_status_e packet_process(
  1504 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e packet_process(
  1476 		eap_variable_data_c * const tls_packet,
  1505 		eap_variable_data_c * const tls_packet,
  1477 		const u8_t received_eap_identifier);
  1506 		const u8_t received_eap_identifier);
  1478 
  1507 
  1479 	/**
  1508 	/**
  1480 	 * This function indicates the plain text EAP-Success or EAP-Failure packet is received.
  1509 	 * This function indicates the plain text EAP-Success or EAP-Failure packet is received.
  1481 	 * @param receive_network_id includes the addresses (network identity) and packet type.
  1510 	 * @param receive_network_id includes the addresses (network identity) and packet type.
  1482 	 * @param received_eap_identifier is the EAP-Identifier of the received EAP-Success packet.
  1511 	 * @param received_eap_identifier is the EAP-Identifier of the received EAP-Success packet.
  1483 	 */
  1512 	 */
  1484 	EAP_FUNC_IMPORT eap_status_e plain_eap_success_failure_packet_received(
  1513 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e plain_eap_success_failure_packet_received(
  1485 		const eap_am_network_id_c * const receive_network_id,
  1514 		const eap_am_network_id_c * const receive_network_id,
  1486 		const eap_code_value_e received_eap_code,
  1515 		const eap_code_value_e received_eap_code,
  1487 		const u8_t received_eap_identifier);
  1516 		const u8_t received_eap_identifier);
  1488 
  1517 
  1489 	/**
  1518 	/**
  1490 	 * This function indicates the empty Ack packet is received.
  1519 	 * This function indicates the empty Ack packet is received.
  1491 	 * This is used in TTLS.
  1520 	 * This is used in TTLS.
  1492 	 * @param receive_network_id includes the addresses (network identity) and packet type.
  1521 	 * @param receive_network_id includes the addresses (network identity) and packet type.
  1493 	 * @param received_eap_identifier is the EAP-Identifier of the received EAP-Success packet.
  1522 	 * @param received_eap_identifier is the EAP-Identifier of the received EAP-Success packet.
  1494 	 */
  1523 	 */
  1495 	EAP_FUNC_IMPORT eap_status_e empty_ack_packet_received(
  1524 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e empty_ack_packet_received(
  1496 		const eap_am_network_id_c * const receive_network_id,
  1525 		const eap_am_network_id_c * const receive_network_id,
  1497 		const u8_t received_eap_identifier);
  1526 		const u8_t received_eap_identifier);
  1498 
  1527 
  1499 	/**
  1528 	/**
  1500 	 * Object must indicate it's validity.
  1529 	 * Object must indicate it's validity.
  1501 	 * If object initialization fails this function must return false.
  1530 	 * If object initialization fails this function must return false.
  1502 	 * @return This function returns the validity of this object.
  1531 	 * @return This function returns the validity of this object.
  1503 	 */
  1532 	 */
  1504 	EAP_FUNC_IMPORT bool get_is_valid();
  1533 	EAP_FUNC_VISIBILITY_TLS_RECORD_H bool get_is_valid();
  1505 
  1534 
  1506 	/**
  1535 	/**
  1507 	 * This function must reset the state of object to same as 
  1536 	 * This function must reset the state of object to same as 
  1508 	 * state was after the configure() function call.
  1537 	 * state was after the configure() function call.
  1509 	 * If object reset succeeds this function must return eap_status_ok.
  1538 	 * If object reset succeeds this function must return eap_status_ok.
  1510 	 * If object reset fails this function must return corresponding error status.
  1539 	 * If object reset fails this function must return corresponding error status.
  1511 	 * @return This function returns the status of reset operation.
  1540 	 * @return This function returns the status of reset operation.
  1512 	 */
  1541 	 */
  1513 	EAP_FUNC_IMPORT eap_status_e reset();
  1542 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e reset();
  1514 
  1543 
  1515 	/**
  1544 	/**
  1516 	 * This function calculates the required key lengths. This function consults current cipher suite.
  1545 	 * This function calculates the required key lengths. This function consults current cipher suite.
  1517 	 */
  1546 	 */
  1518 	EAP_FUNC_IMPORT u32_t get_key_expansion_size(
  1547 	EAP_FUNC_VISIBILITY_TLS_RECORD_H u32_t get_key_expansion_size(
  1519 		u32_t * const mac_key_length,
  1548 		u32_t * const mac_key_length,
  1520 		u32_t * const encryption_key_length,
  1549 		u32_t * const encryption_key_length,
  1521 		u32_t * const iv_length,
  1550 		u32_t * const iv_length,
  1522 		u32_t * const session_key_seed_length,
  1551 		u32_t * const session_key_seed_length,
  1523 		u32_t * const mschapv2_challenges_length);
  1552 		u32_t * const mschapv2_challenges_length);
  1524 
  1553 
  1525 	/**
  1554 	/**
  1526 	 * This function generates the key material for the current cipher suite.
  1555 	 * This function generates the key material for the current cipher suite.
  1527 	 */
  1556 	 */
  1528 	EAP_FUNC_IMPORT eap_status_e generate_key_material();
  1557 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e generate_key_material();
  1529 
  1558 
  1530 	EAP_FUNC_IMPORT eap_status_e set_tls_master_secret(
  1559 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e set_tls_master_secret(
  1531 		const eap_variable_data_c * const master_secret,
  1560 		const eap_variable_data_c * const master_secret,
  1532 		const eap_variable_data_c * const client_random,
  1561 		const eap_variable_data_c * const client_random,
  1533 		const eap_variable_data_c * const server_random);
  1562 		const eap_variable_data_c * const server_random);
  1534 
  1563 
  1535 	/**
  1564 	/**
  1536 	 * This function changes the current cipher suite to negotiated cipher suite.
  1565 	 * This function changes the current cipher suite to negotiated cipher suite.
  1537 	 * Parameter send_when_true tells whether the send cipher suite (true) or receive cipher suite (false)
  1566 	 * Parameter send_when_true tells whether the send cipher suite (true) or receive cipher suite (false)
  1538 	 * is acquired to be changed.
  1567 	 * is acquired to be changed.
  1539 	 */
  1568 	 */
  1540 	EAP_FUNC_IMPORT eap_status_e change_cipher_spec(const bool send_when_true);
  1569 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e change_cipher_spec(const bool send_when_true);
  1541 
  1570 
  1542 
  1571 
  1543 	// This is commented in tls_base_record_c::read_authority_identity().
  1572 	// This is commented in tls_base_record_c::read_authority_identity().
  1544 	EAP_FUNC_IMPORT eap_status_e read_authority_identity(eap_variable_data_c * const authority_identity_payload);
  1573 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e read_authority_identity(eap_variable_data_c * const authority_identity_payload);
  1545 
  1574 
  1546 	
  1575 	
  1547 	// This is commented in abs_tls_am_services_c::complete_query_cipher_suites_and_previous_session().
  1576 	// This is commented in abs_tls_am_services_c::complete_query_cipher_suites_and_previous_session().
  1548 	EAP_FUNC_IMPORT eap_status_e complete_query_cipher_suites_and_previous_session(
  1577 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_query_cipher_suites_and_previous_session(
  1549 		const tls_session_type_e session_type,
  1578 		const tls_session_type_e session_type,
  1550 		EAP_TEMPLATE_CONST eap_array_c<u16_t> * const cipher_suites,
  1579 		EAP_TEMPLATE_CONST eap_array_c<u16_t> * const cipher_suites,
  1551 		EAP_TEMPLATE_CONST eap_array_c<u8_t> * const compression_methods,
  1580 		EAP_TEMPLATE_CONST eap_array_c<u8_t> * const compression_methods,
  1552 #if defined(USE_EAP_TLS_SESSION_TICKET)
  1581 #if defined(USE_EAP_TLS_SESSION_TICKET)
  1553 		EAP_TEMPLATE_CONST eap_array_c<tls_extension_c> * const tls_extensions,
  1582 		EAP_TEMPLATE_CONST eap_array_c<tls_extension_c> * const tls_extensions,
  1556 		const eap_variable_data_c * const resumed_master_secret,
  1585 		const eap_variable_data_c * const resumed_master_secret,
  1557 		const tls_cipher_suites_e resumed_cipher_suite,
  1586 		const tls_cipher_suites_e resumed_cipher_suite,
  1558 		const eap_status_e completion_status);
  1587 		const eap_status_e completion_status);
  1559 
  1588 
  1560 	// This is commented in abs_tls_am_services_c::complete_select_cipher_suite_and_check_session_id().
  1589 	// This is commented in abs_tls_am_services_c::complete_select_cipher_suite_and_check_session_id().
  1561 	EAP_FUNC_IMPORT eap_status_e complete_select_cipher_suite_and_check_session_id(
  1590 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_select_cipher_suite_and_check_session_id(
  1562 		const tls_session_type_e session_type,
  1591 		const tls_session_type_e session_type,
  1563 		const u16_t selected_cipher_suite,
  1592 		const u16_t selected_cipher_suite,
  1564 		const eap_variable_data_c * const session_id,
  1593 		const eap_variable_data_c * const session_id,
  1565 		const eap_variable_data_c * const master_secret,
  1594 		const eap_variable_data_c * const master_secret,
  1566 #if defined(USE_EAP_TLS_SESSION_TICKET)
  1595 #if defined(USE_EAP_TLS_SESSION_TICKET)
  1568 #endif //#if defined(USE_EAP_TLS_SESSION_TICKET)
  1597 #endif //#if defined(USE_EAP_TLS_SESSION_TICKET)
  1569 		const eap_status_e completion_status);
  1598 		const eap_status_e completion_status);
  1570 
  1599 
  1571 #if defined(USE_EAP_TLS_SESSION_TICKET)
  1600 #if defined(USE_EAP_TLS_SESSION_TICKET)
  1572 	// This is commented in abs_tls_am_services_c::complete_query_new_session_ticket().
  1601 	// This is commented in abs_tls_am_services_c::complete_query_new_session_ticket().
  1573 	EAP_FUNC_IMPORT eap_status_e complete_query_new_session_ticket(
  1602 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_query_new_session_ticket(
  1574 		const tls_extension_c * const new_session_ticket_or_null);
  1603 		const tls_extension_c * const new_session_ticket_or_null);
  1575 #endif //#if defined(USE_EAP_TLS_SESSION_TICKET)
  1604 #endif //#if defined(USE_EAP_TLS_SESSION_TICKET)
  1576 
  1605 
  1577 	// This is commented in abs_tls_am_services_c::complete_verify_certificate_chain().
  1606 	// This is commented in abs_tls_am_services_c::complete_verify_certificate_chain().
  1578 	EAP_FUNC_IMPORT eap_status_e complete_verify_certificate_chain(
  1607 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_verify_certificate_chain(
  1579 		const eap_status_e result);
  1608 		const eap_status_e result);
  1580 
  1609 
  1581 	// This is commented in abs_tls_am_services_c::complete_query_certificate_chain().
  1610 	// This is commented in abs_tls_am_services_c::complete_query_certificate_chain().
  1582 	EAP_FUNC_IMPORT eap_status_e complete_query_certificate_chain(
  1611 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_query_certificate_chain(
  1583 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const certificate_chain,
  1612 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const certificate_chain,
  1584 		const eap_status_e completion_status);
  1613 		const eap_status_e completion_status);
  1585 
  1614 
  1586 	// This is commented in abs_tls_am_services_c::complete_query_certificate_authorities_and_types().
  1615 	// This is commented in abs_tls_am_services_c::complete_query_certificate_authorities_and_types().
  1587 	EAP_FUNC_IMPORT eap_status_e complete_query_certificate_authorities_and_types(
  1616 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_query_certificate_authorities_and_types(
  1588 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const authorities,
  1617 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const authorities,
  1589 		EAP_TEMPLATE_CONST eap_array_c<u8_t> * const types,
  1618 		EAP_TEMPLATE_CONST eap_array_c<u8_t> * const types,
  1590 		const eap_status_e completion_status);
  1619 		const eap_status_e completion_status);
  1591 
  1620 
  1592 	// This is commented in abs_tls_am_services_c::complete_query_dh_parameters().
  1621 	// This is commented in abs_tls_am_services_c::complete_query_dh_parameters().
  1593 	EAP_FUNC_IMPORT eap_status_e complete_query_dh_parameters(
  1622 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_query_dh_parameters(
  1594 		const eap_variable_data_c * const dhe_prime,
  1623 		const eap_variable_data_c * const dhe_prime,
  1595 		const eap_variable_data_c * const dhe_group_generator,
  1624 		const eap_variable_data_c * const dhe_group_generator,
  1596 		const eap_status_e completion_status);
  1625 		const eap_status_e completion_status);
  1597 
  1626 
  1598 	// This is commented in abs_tls_am_services_c::complete_query_realm().
  1627 	// This is commented in abs_tls_am_services_c::complete_query_realm().
  1599 	EAP_FUNC_IMPORT eap_status_e complete_query_realm(
  1628 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_query_realm(
  1600 		const eap_variable_data_c * const realm,
  1629 		const eap_variable_data_c * const realm,
  1601 		const eap_status_e completion_status);
  1630 		const eap_status_e completion_status);
  1602 
  1631 
  1603 	// This is commented in abs_tls_am_services_c::complete_rsa_encrypt_with_public_key().
  1632 	// This is commented in abs_tls_am_services_c::complete_rsa_encrypt_with_public_key().
  1604 	EAP_FUNC_IMPORT eap_status_e complete_rsa_encrypt_with_public_key(
  1633 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_rsa_encrypt_with_public_key(
  1605 		const eap_variable_data_c * const encrypted_premaster_secret,
  1634 		const eap_variable_data_c * const encrypted_premaster_secret,
  1606 		const eap_status_e completion_status);
  1635 		const eap_status_e completion_status);
  1607 
  1636 
  1608 	// This is commented in abs_tls_am_services_c::complete_rsa_decrypt_with_private_key().
  1637 	// This is commented in abs_tls_am_services_c::complete_rsa_decrypt_with_private_key().
  1609 	EAP_FUNC_IMPORT eap_status_e complete_rsa_decrypt_with_private_key(
  1638 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_rsa_decrypt_with_private_key(
  1610 		const eap_variable_data_c * const premaster_secret,
  1639 		const eap_variable_data_c * const premaster_secret,
  1611 		const eap_status_e completion_status);
  1640 		const eap_status_e completion_status);
  1612 
  1641 
  1613 	// This is commented in abs_tls_am_services_c::complete_sign_with_private_key().
  1642 	// This is commented in abs_tls_am_services_c::complete_sign_with_private_key().
  1614 	EAP_FUNC_IMPORT eap_status_e complete_sign_with_private_key(
  1643 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_sign_with_private_key(
  1615 		const eap_variable_data_c * const message_hash,
  1644 		const eap_variable_data_c * const message_hash,
  1616 		const eap_status_e completion_status);
  1645 		const eap_status_e completion_status);
  1617 
  1646 
  1618 	// This is commented in abs_tls_am_services_c::complete_verify_with_public_key().
  1647 	// This is commented in abs_tls_am_services_c::complete_verify_with_public_key().
  1619 	EAP_FUNC_IMPORT eap_status_e complete_verify_with_public_key(
  1648 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_verify_with_public_key(
  1620 		const eap_status_e verify_status);
  1649 		const eap_status_e verify_status);
  1621 
  1650 
  1622 	// See abs_tls_base_application_c::get_eap_tls_master_session_key().
  1651 	// See abs_tls_base_application_c::get_eap_tls_master_session_key().
  1623 	EAP_FUNC_IMPORT eap_status_e get_eap_tls_master_session_key(
  1652 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e get_eap_tls_master_session_key(
  1624 		eap_variable_data_c * const eap_tls_master_session_key,
  1653 		eap_variable_data_c * const eap_tls_master_session_key,
  1625 		eap_variable_data_c * const mschapv2_challenges
  1654 		eap_variable_data_c * const mschapv2_challenges
  1626 		);
  1655 		);
  1627 
  1656 
  1628 	EAP_FUNC_IMPORT eap_status_e add_rogue_ap(eap_array_c<eap_rogue_ap_entry_c> & rogue_ap_list);
  1657 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e add_rogue_ap(eap_array_c<eap_rogue_ap_entry_c> & rogue_ap_list);
  1629 
  1658 
  1630 	// This is documented in abs_tls_base_application_c::set_session_timeout().
  1659 	// This is documented in abs_tls_base_application_c::set_session_timeout().
  1631 	EAP_FUNC_IMPORT eap_status_e set_session_timeout(
  1660 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e set_session_timeout(
  1632 		const u32_t session_timeout_ms);
  1661 		const u32_t session_timeout_ms);
  1633 
  1662 
  1634 #if defined(USE_FAST_EAP_TYPE)
  1663 #if defined(USE_FAST_EAP_TYPE)
  1635 
  1664 
  1636 	EAP_FUNC_IMPORT eap_status_e complete_query_tunnel_PAC(
  1665 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_query_tunnel_PAC(
  1637 		const eap_status_e in_completion_status,
  1666 		const eap_status_e in_completion_status,
  1638 		const eap_fast_pac_type_e in_pac_type,
  1667 		const eap_fast_pac_type_e in_pac_type,
  1639 		const eap_fast_variable_data_c * const in_tunnel_PAC_key_tlv,
  1668 		const eap_fast_variable_data_c * const in_tunnel_PAC_key_tlv,
  1640 		const eap_fast_variable_data_c * const in_tunnel_PAC_opaque_tlv);
  1669 		const eap_fast_variable_data_c * const in_tunnel_PAC_opaque_tlv);
  1641 
  1670 
       
  1671 	eap_status_e complete_start_initialize_PAC_store(
       
  1672 		const eap_fast_completion_operation_e completion_operation,
       
  1673 		const eap_fast_initialize_pac_store_completion_e completion);
       
  1674 
  1642 #endif //#if defined(USE_FAST_EAP_TYPE)
  1675 #endif //#if defined(USE_FAST_EAP_TYPE)
  1643 
  1676 
  1644 	EAP_FUNC_IMPORT eap_status_e query_ttls_pap_username_and_password(
  1677 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e query_ttls_pap_username_and_password(
  1645 		const eap_variable_data_c * const reply_message);
  1678 		const eap_variable_data_c * const reply_message);
  1646 
  1679 
  1647 	EAP_FUNC_IMPORT eap_status_e complete_query_ttls_pap_username_and_password(
  1680 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_query_ttls_pap_username_and_password(
  1648 		const eap_variable_data_c * const ttls_pap_username,
  1681 		const eap_variable_data_c * const ttls_pap_username,
  1649 		const eap_variable_data_c * const ttls_pap_password,
  1682 		const eap_variable_data_c * const ttls_pap_password,
  1650 		const eap_status_e query_result);
  1683 		const eap_status_e query_result);
  1651 
  1684 
  1652 	EAP_FUNC_IMPORT eap_status_e verify_ttls_pap_username_and_password(
  1685 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e verify_ttls_pap_username_and_password(
  1653 		const eap_variable_data_c * const user_name,
  1686 		const eap_variable_data_c * const user_name,
  1654 		const eap_variable_data_c * const user_password);
  1687 		const eap_variable_data_c * const user_password);
  1655 
  1688 
  1656 	EAP_FUNC_IMPORT eap_status_e complete_verify_ttls_pap_username_and_password(
  1689 	EAP_FUNC_VISIBILITY_TLS_RECORD_H eap_status_e complete_verify_ttls_pap_username_and_password(
  1657 		const eap_status_e authentication_result,
  1690 		const eap_status_e authentication_result,
  1658 		const eap_variable_data_c * const ttls_pap_reply_message);
  1691 		const eap_variable_data_c * const ttls_pap_reply_message);
  1659 
  1692 
  1660 	//--------------------------------------------------
  1693 	//--------------------------------------------------
  1661 }; // class tls_record_c
  1694 }; // class tls_record_c