eapol/eapol_framework/eapol_common/am/include/abs_tls_am_services.h
changeset 0 c8830336c852
child 2 1c7bc153c08e
equal deleted inserted replaced
-1:000000000000 0:c8830336c852
       
     1 /*
       
     2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  EAP and WLAN authentication protocols.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #if !defined(_ABS_TLS_AM_SERVICES_H_)
       
    22 #define _ABS_TLS_AM_SERVICES_H_
       
    23 
       
    24 #include "eap_am_export.h"
       
    25 #include "eap_array.h"
       
    26 
       
    27 #if defined(USE_EAP_TLS_SESSION_TICKET)
       
    28 class tls_extension_c;
       
    29 #endif // #if defined(USE_EAP_TLS_SESSION_TICKET)
       
    30 
       
    31 /// This class declares the functions adaptation module of TLS
       
    32 /// requires from the TLS.
       
    33 class EAP_EXPORT abs_tls_am_services_c
       
    34 {
       
    35 private:
       
    36 	//--------------------------------------------------
       
    37 
       
    38 	//--------------------------------------------------
       
    39 protected:
       
    40 	//--------------------------------------------------
       
    41 
       
    42 	//--------------------------------------------------
       
    43 public:
       
    44 	//--------------------------------------------------
       
    45 
       
    46 	/// Destructor does nothing.
       
    47 	virtual ~abs_tls_am_services_c()
       
    48 	{
       
    49 	}
       
    50 
       
    51 	/// Constructor does nothing.
       
    52 	abs_tls_am_services_c()
       
    53 	{
       
    54 	}
       
    55 
       
    56 	// This is commented in eap_base_type_c::configure().
       
    57 	virtual eap_status_e configure() = 0;
       
    58 
       
    59 	/**
       
    60 	 * This function completes the asyncronous
       
    61 	 * tls_am_services_c::query_cipher_suites_and_previous_session() function call.
       
    62 	 * The list of cipher suites and the list of compression methods are saved.
       
    63 	 * All pending actions are checked and completed during this call.
       
    64 	 * The parameter completion_status must be eap_status_ok when query is successfull.
       
    65 	 */
       
    66 	virtual eap_status_e complete_query_cipher_suites_and_previous_session(
       
    67 		const tls_session_type_e session_type,
       
    68 		EAP_TEMPLATE_CONST eap_array_c<u16_t> * const cipher_suites,
       
    69 		EAP_TEMPLATE_CONST eap_array_c<u8_t> * const compression_methods,
       
    70 #if defined(USE_EAP_TLS_SESSION_TICKET)
       
    71 		EAP_TEMPLATE_CONST eap_array_c<tls_extension_c> * const tls_extensions,
       
    72 #endif // #if defined(USE_EAP_TLS_SESSION_TICKET)
       
    73 		const eap_variable_data_c * const resumed_session_id,
       
    74 		const eap_variable_data_c * const resumed_master_secret,
       
    75 		const tls_cipher_suites_e resumed_cipher_suite,
       
    76 		const eap_status_e completion_status) = 0;
       
    77 
       
    78 	/**
       
    79 	 * This function completes the asyncronous
       
    80 	 * tls_am_services_c::select_cipher_suite_and_check_session_id() function call.
       
    81 	 * The cipher suite, the session id and master secret are saved.
       
    82 	 * NOTE the the session id and master secret are optional.
       
    83 	 * Adaptation module can make independent
       
    84 	 * decision to restore previous session or not. The selected cipher suite must be the same as
       
    85 	 * was used in resumed session. The resumed cipher suite must be read from database.
       
    86 	 * All pending actions are checked and completed during this call.
       
    87 	 * The parameter completion_status must be eap_status_ok when query is successfull.
       
    88 	 */
       
    89 	virtual eap_status_e complete_select_cipher_suite_and_check_session_id(
       
    90 		const tls_session_type_e session_type,
       
    91 		const u16_t selected_cipher_suite,
       
    92 		const eap_variable_data_c * const resumed_session_id,
       
    93 		const eap_variable_data_c * const resumed_master_secret,
       
    94 #if defined(USE_EAP_TLS_SESSION_TICKET)
       
    95 		const tls_extension_c * const new_session_ticket_or_null,
       
    96 #endif // #if defined(USE_EAP_TLS_SESSION_TICKET)
       
    97 		const eap_status_e completion_status) = 0;
       
    98 
       
    99 #if defined(USE_EAP_TLS_SESSION_TICKET)
       
   100 	/**
       
   101 	 * This function completes the asyncronous
       
   102 	 * tls_am_services_c::query_new_session_ticket() function call.
       
   103 	 * The parameter new_session_ticket_or_null is pointer to the
       
   104 	 * new session ticket or null if new session ticket is omitted.
       
   105 	 */
       
   106 	virtual eap_status_e complete_query_new_session_ticket(
       
   107 		const tls_extension_c * const new_session_ticket_or_null) = 0;
       
   108 #endif //#if defined(USE_EAP_TLS_SESSION_TICKET)
       
   109 
       
   110 	/**
       
   111 	 * This function completes the tls_am_services_c::asyncronous verify_certificate_chain()
       
   112 	 * function call.
       
   113 	 * The parameter result must be eap_status_ok when certificate chain is valid.
       
   114 	 * All pending actions are checked and completed during this call.
       
   115 	 */
       
   116 	virtual eap_status_e complete_verify_certificate_chain(
       
   117 		const eap_status_e result) = 0;
       
   118 
       
   119 	/**
       
   120 	 * This function completes the tls_am_services_c::asyncronous
       
   121 	 * query_certificate_chain() function call.
       
   122 	 * The parameter certificate_chain is saved.
       
   123 	 * All pending actions are checked and completed during this call.
       
   124 	 * The parameter completion_status must be eap_status_ok when query is successfull.
       
   125 	 */
       
   126 	virtual eap_status_e complete_query_certificate_chain(
       
   127 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const certificate_chain,
       
   128 		const eap_status_e completion_status) = 0;
       
   129 
       
   130 	/**
       
   131 	 * This function completes the tls_am_services_c::asyncronous
       
   132 	 * query_certificate_authorities_and_types() function call.
       
   133 	 * The parameters authorities and types are saved.
       
   134 	 * All pending actions are checked and completed during this call.
       
   135 	 * The parameter completion_status must be eap_status_ok when query is successfull.
       
   136 	 */
       
   137 	virtual eap_status_e complete_query_certificate_authorities_and_types(
       
   138 		EAP_TEMPLATE_CONST eap_array_c<eap_variable_data_c> * const authorities,
       
   139 		EAP_TEMPLATE_CONST eap_array_c<u8_t> * const types,
       
   140 		const eap_status_e completion_status) = 0;
       
   141 
       
   142 	/**
       
   143 	 * This function completes the tls_am_services_c::asyncronous query_dh_parameters()
       
   144 	 * function call.
       
   145 	 * The parameter dhe_prime and dhe_group_generator are saved.
       
   146 	 * All pending actions are checked and completed during this call.
       
   147 	 * The parameter completion_status must be eap_status_ok when query is successfull.
       
   148 	 */
       
   149 	virtual eap_status_e complete_query_dh_parameters(
       
   150 		const eap_variable_data_c * const dh_prime,
       
   151 		const eap_variable_data_c * const dh_group_generator,
       
   152 		const eap_status_e completion_status) = 0;
       
   153 
       
   154 	/**
       
   155 	 * This function completes the asyncronous tls_am_services_c::query_realm() function call.
       
   156 	 * The parameter realm is saved.
       
   157 	 * All pending actions are checked and completed during this call.
       
   158 	 * The parameter completion_status must be eap_status_ok when query is successfull.
       
   159 	 */
       
   160 	virtual eap_status_e complete_query_realm(
       
   161 		const eap_variable_data_c * const realm,
       
   162 		const eap_status_e completion_status) = 0;
       
   163 
       
   164 	/**
       
   165 	 * This function completes the asyncronous tls_am_services_c::rsa_encrypt_with_public_key() function call.
       
   166 	 * The parameter encrypted_premaster_secret is saved.
       
   167 	 * All pending actions are checked and completed during this call.
       
   168 	 * The parameter completion_status must be eap_status_ok when query is successfull.
       
   169 	 */
       
   170 	virtual eap_status_e complete_rsa_encrypt_with_public_key(
       
   171 		const eap_variable_data_c * const encrypted_premaster_secret,
       
   172 		const eap_status_e completion_status) = 0;
       
   173 
       
   174 	/**
       
   175 	 * This function completes the asyncronous tls_am_services_c::rsa_decrypt_with_private_key() function call.
       
   176 	 * The parameter premaster_secret is saved.
       
   177 	 * All pending actions are checked and completed during this call.
       
   178 	 * The parameter completion_status must be eap_status_ok when query is successfull.
       
   179 	 */
       
   180 	virtual eap_status_e complete_rsa_decrypt_with_private_key(
       
   181 		const eap_variable_data_c * const premaster_secret,
       
   182 		const eap_status_e completion_status) = 0;
       
   183 
       
   184 	/**
       
   185 	 * This function completes the asyncronous tls_am_services_c::sign_with_private_key() function call.
       
   186 	 * The parameter message_hash is saved.
       
   187 	 * All pending actions are checked and completed during this call.
       
   188 	 * The parameter completion_status must be eap_status_ok when query is successfull.
       
   189 	 */
       
   190 	virtual eap_status_e complete_sign_with_private_key(
       
   191 		const eap_variable_data_c * const signed_message_hash,
       
   192 		const eap_status_e completion_status) = 0;
       
   193 
       
   194 	/**
       
   195 	 * This function completes the asyncronous tls_am_services_c::verify_with_public_key() function call.
       
   196 	 * The parameter verify_status must be eap_status_ok when verification is successfull.
       
   197 	 * All pending actions are checked and completed during this call.
       
   198 	 */
       
   199 	virtual eap_status_e complete_verify_with_public_key(
       
   200 		const eap_status_e verify_status) = 0;
       
   201 
       
   202 	virtual eap_status_e complete_query_ttls_pap_username_and_password(
       
   203 		const eap_variable_data_c * const ttls_pap_username,
       
   204 		const eap_variable_data_c * const ttls_pap_password,
       
   205 		const eap_status_e query_result) = 0;
       
   206 
       
   207 	virtual eap_status_e complete_verify_ttls_pap_username_and_password(
       
   208 		const eap_status_e authentication_result,
       
   209 		const eap_variable_data_c * const ttls_pap_reply_message) = 0;
       
   210 
       
   211 	//--------------------------------------------------
       
   212 }; // class abs_tls_am_services_c
       
   213 
       
   214 #endif //#if !defined(_ABS_TLS_AM_SERVICES_H_)
       
   215 
       
   216 //--------------------------------------------------
       
   217 
       
   218 
       
   219 
       
   220 // End.