|
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_ALERT_MESSAGE_H_) |
|
22 #define _TLS_ALERT_MESSAGE_H_ |
|
23 |
|
24 #include "eap_tools.h" |
|
25 #include "eap_array.h" |
|
26 #include "tls_peap_types.h" |
|
27 |
|
28 |
|
29 /** @file */ |
|
30 |
|
31 |
|
32 /// This class defines one TLS alert message. |
|
33 /** |
|
34 * This class defines TLS-Alert message. |
|
35 */ |
|
36 class EAP_EXPORT tls_alert_message_c |
|
37 { |
|
38 private: |
|
39 //-------------------------------------------------- |
|
40 |
|
41 /// This is pointer to the tools class. @see abs_eap_am_tools_c. |
|
42 abs_eap_am_tools_c * const m_am_tools; |
|
43 |
|
44 /// This is buffer for geneated TLS-Alert message. |
|
45 eap_variable_data_c m_tls_alert_message_buffer; |
|
46 |
|
47 /// This is the alert level. |
|
48 tls_alert_level_e m_alert_level; |
|
49 |
|
50 /// This is the alert description. |
|
51 tls_alert_description_e m_alert_description; |
|
52 |
|
53 /// This indicates whether this object is client (true) or server (false). This mostly for traces. |
|
54 bool m_is_client; |
|
55 |
|
56 /// This indicates whether this object was generated successfully. |
|
57 bool m_is_valid; |
|
58 |
|
59 //-------------------------------------------------- |
|
60 |
|
61 /** |
|
62 * The set_is_valid() function sets the state of the object valid. |
|
63 * The creator of this object calls this function after it is initialized. |
|
64 */ |
|
65 EAP_FUNC_IMPORT void set_is_valid(); |
|
66 |
|
67 //-------------------------------------------------- |
|
68 protected: |
|
69 //-------------------------------------------------- |
|
70 |
|
71 //-------------------------------------------------- |
|
72 public: |
|
73 //-------------------------------------------------- |
|
74 |
|
75 /// Destructor does nothing. |
|
76 EAP_FUNC_IMPORT virtual ~tls_alert_message_c(); |
|
77 |
|
78 /// Constructor initializes the object. |
|
79 EAP_FUNC_IMPORT tls_alert_message_c( |
|
80 abs_eap_am_tools_c * const tools, |
|
81 const bool is_client); |
|
82 |
|
83 |
|
84 /** |
|
85 * Object must indicate it's validity. |
|
86 * If object initialization fails this function must return false. |
|
87 * @return This function returns the validity of this object. |
|
88 */ |
|
89 EAP_FUNC_IMPORT bool get_is_valid(); |
|
90 |
|
91 |
|
92 /** |
|
93 * This function creates data of the Handshake message to internal buffer. |
|
94 * Later this data is added to final TLS-record buffer. |
|
95 */ |
|
96 EAP_FUNC_IMPORT eap_status_e create_message_data(); |
|
97 |
|
98 |
|
99 |
|
100 /** |
|
101 * This function sets alert level. |
|
102 */ |
|
103 EAP_FUNC_IMPORT eap_status_e set_alert_level(const tls_alert_level_e alert_level); |
|
104 |
|
105 /** |
|
106 * This function gets alert level. |
|
107 */ |
|
108 EAP_FUNC_IMPORT tls_alert_level_e get_alert_level() const; |
|
109 |
|
110 |
|
111 /** |
|
112 * This function sets alert description. |
|
113 */ |
|
114 EAP_FUNC_IMPORT eap_status_e set_alert_description(const tls_alert_description_e alert_description); |
|
115 |
|
116 /** |
|
117 * This function gets alert description. |
|
118 */ |
|
119 EAP_FUNC_IMPORT tls_alert_description_e get_alert_description() const; |
|
120 |
|
121 |
|
122 /** |
|
123 * This function adds data of the TLS-Alert message 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_alert_message_c |
|
131 |
|
132 |
|
133 //-------------------------------------------------- |
|
134 |
|
135 #endif //#if !defined(_TLS_ALERT_MESSAGE_H_) |
|
136 |
|
137 |
|
138 |
|
139 // End. |