eapol/eapol_framework/eapol_common/type/tls_peap/tls/include/tls_change_cipher_spec_message.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(_TLS_CHANGE_CIPHER_SPEC_MESSAGE_H_)
       
    22 #define _TLS_CHANGE_CIPHER_SPEC_MESSAGE_H_
       
    23 
       
    24 #include "eap_tools.h"
       
    25 #include "eap_array.h"
       
    26 #include "abs_tls_change_cipher_spec.h"
       
    27 
       
    28 
       
    29 /** @file */
       
    30 
       
    31 /**
       
    32  * This is enumeration of change cipher spec messages.
       
    33  */
       
    34 enum tls_change_cipher_spec_type_e
       
    35 {
       
    36 	tls_change_cipher_spec_type_change_cipher_spec = (1), ///< This is the only one that is defined.
       
    37 	tls_change_cipher_spec_type_none = (255), ///< This is initialization value that means no type is defined.
       
    38  };
       
    39 
       
    40 //----------------------------------------------------------------------------
       
    41 
       
    42 /// This class defines one TLS change cipher spec message.
       
    43 /**
       
    44  * This class includes data of TLS-ChangeCipherSpec message.
       
    45  */
       
    46 class EAP_EXPORT tls_change_cipher_spec_message_c
       
    47 {
       
    48 private:
       
    49 	//--------------------------------------------------
       
    50 
       
    51 	/// This is pointer to the tools class. @see abs_eap_am_tools_c.
       
    52 	abs_eap_am_tools_c * const m_am_tools;
       
    53 
       
    54 	/// This is pointer to interface of TLS-record.
       
    55 	/// Interface includes function to inform change cipher spec related events.
       
    56 	abs_tls_change_cipher_spec_c * m_change_cipher_spec;
       
    57 
       
    58 	/// This buffer includes data of TLS-ChangeCipherSpec message.
       
    59 	eap_variable_data_c m_tls_change_cipher_spec_message_buffer;
       
    60 
       
    61 	tls_change_cipher_spec_type_e m_type;
       
    62 
       
    63 	/// This indicates whether this object is client (true) or server (false). This mostly for traces.
       
    64 	bool m_is_client;
       
    65 
       
    66 	/// This indicates whether this object was generated successfully.
       
    67 	bool m_is_valid;
       
    68 
       
    69 	//--------------------------------------------------
       
    70 
       
    71 	/**
       
    72 	 * The set_is_valid() function sets the state of the object valid.
       
    73 	 * The creator of this object calls this function after it is initialized. 
       
    74 	 */
       
    75 	EAP_FUNC_IMPORT void set_is_valid();
       
    76 
       
    77 	//--------------------------------------------------
       
    78 protected:
       
    79 	//--------------------------------------------------
       
    80 
       
    81 	//--------------------------------------------------
       
    82 public:
       
    83 	//--------------------------------------------------
       
    84 
       
    85 	/**
       
    86 	 * Destructor does nothing special.
       
    87 	 */
       
    88 	EAP_FUNC_IMPORT virtual ~tls_change_cipher_spec_message_c();
       
    89 
       
    90 	/**
       
    91 	 * Constructor initializes class.
       
    92 	 */
       
    93 	EAP_FUNC_IMPORT tls_change_cipher_spec_message_c(
       
    94 		abs_eap_am_tools_c * const tools,
       
    95 		abs_tls_change_cipher_spec_c * const change_cipher_spec,
       
    96 		const bool is_client);
       
    97 
       
    98 	/**
       
    99 	 * Object must indicate it's validity.
       
   100 	 * If object initialization fails this function must return false.
       
   101 	 * @return This function returns the validity of this object.
       
   102 	 */
       
   103 	EAP_FUNC_IMPORT bool get_is_valid();
       
   104 
       
   105 	/**
       
   106 	 * This function creates data of the Handshake message to internal buffer.
       
   107 	 * Later this data is added to final TLS-record buffer.
       
   108 	 */
       
   109 	EAP_FUNC_IMPORT eap_status_e create_message_data();
       
   110 
       
   111 
       
   112 	/**
       
   113 	 * This function sets the change cipher spec message type.
       
   114 	 */
       
   115 	EAP_FUNC_IMPORT eap_status_e set_change_cipher_spec_type(tls_change_cipher_spec_type_e type);
       
   116 
       
   117 	/**
       
   118 	 * This function gets the change cipher spec message type.
       
   119 	 */
       
   120 	EAP_FUNC_IMPORT tls_change_cipher_spec_type_e get_change_cipher_spec_type() const;
       
   121 
       
   122 	/**
       
   123 	 * This function adds data of the TLS-CahneCipherSpec data message from m_tls_change_cipher_spec_message_buffer to tls_message_buffer.
       
   124 	 */
       
   125 	EAP_FUNC_IMPORT eap_status_e add_message_data(
       
   126 		eap_variable_data_c * const tls_message_buffer);
       
   127 
       
   128 	// 
       
   129 	//--------------------------------------------------
       
   130 }; // class tls_change_cipher_spec_message_c
       
   131 
       
   132 
       
   133 //--------------------------------------------------
       
   134 
       
   135 #endif //#if !defined(_TLS_CHANGE_CIPHER_SPEC_MESSAGE_H_)
       
   136 
       
   137 
       
   138 
       
   139 // End.