• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * mainSecNull.c
3  *
4  * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  *  * Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *  * Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  *  * Neither the name Texas Instruments nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 /** \file mainSecSm.c
35  *  \brief 802.1X finite state machine header file
36  *
37  *  \see mainSecSm.h
38  */
39 
40 
41 /***************************************************************************/
42 /*																		   */
43 /*		MODULE:	mainSecSm.c											   	   */
44 /*    PURPOSE:	Main Security State Machine API					   		   */
45 /*																	 	   */
46 /***************************************************************************/
47 
48 #define __FILE_ID__  FILE_ID_38
49 #include "osApi.h"
50 #include "paramOut.h"
51 #include "report.h"
52 #include "DataCtrl_Api.h"
53 #include "smeApi.h"
54 #include "rsn.h"
55 #include "rsnApi.h"
56 #include "mainSecSm.h"
57 #include "mainSecNull.h"
58 
59 /* Constants */
60 
61 /* Enumerations */
62 
63 /* Typedefs */
64 
65 /* Structures */
66 
67 /* External data definitions */
68 
69 /* External functions definitions */
70 
71 /* Global variables */
72 
73 /* Local function prototypes */
74 
75 /* functions */
76 
77 /**
78 *
79 * rsn_mainSecSmFullInit
80 *
81 * \b Description:
82 *
83 * Init main security state machine state machine
84 *
85 * \b ARGS:
86 *
87 *  none
88 *
89 * \b RETURNS:
90 *
91 *  TI_OK on success, TI_NOK otherwise.
92 *
93 * \sa
94 */
mainSecSmNull_config(mainSec_t * pMainSec,TRsnPaeConfig * pPaeConfig)95 TI_STATUS mainSecSmNull_config(mainSec_t *pMainSec,
96                             TRsnPaeConfig *pPaeConfig)
97 {
98     pMainSec->start = (mainSecSmStart_t)mainSecSmNull_start;
99 	pMainSec->stop = mainSecSmNull_stop;
100 	pMainSec->reportAuthStatus = NULL;
101 	pMainSec->reportKeysStatus = mainSecNull_reportKeysStatus;
102 	pMainSec->reportReAuthenticate = NULL;
103 	pMainSec->getAuthIdentity  = NULL;
104 	pMainSec->setAuthIdentity  = (mainSecSm_getAuthIdentity_t)mainSecNull_setAuthIdentity;
105     pMainSec->getAuthState = mainSecNull_getAuthState;
106     pMainSec->reportAuthFailure  = (mainSecSm_reportAuthFailure_t)mainSecNull_reportAuthFailure;
107     return TI_OK;
108 }
109 
110 /**
111 *
112 * mainSecSmNull_Start
113 *
114 * \b Description:
115 *
116 * Start the NULL main security SM. Reports success to the rsn module immediately.
117 *
118 * \b ARGS:
119 *
120 *  none
121 *
122 * \b RETURNS:
123 *
124 *  TI_OK on success, TI_NOK otherwise.
125 *
126 * \sa
127 */
mainSecSmNull_start(mainSec_t * pMainSec)128 TI_STATUS mainSecSmNull_start(mainSec_t *pMainSec)
129 {
130     TI_STATUS status;
131 
132     status = rsn_reportStatus(pMainSec->pParent, TI_OK);
133 
134     return status;
135 }
136 
137 /**
138 *
139 * mainSecSmNull_Stop
140 *
141 * \b Description:
142 *
143 * Start the NULL main security SM. Reports success to the rsn module immediately.
144 *
145 * \b ARGS:
146 *
147 *  none
148 *
149 * \b RETURNS:
150 *
151 *  TI_OK on success, TI_NOK otherwise.
152 *
153 * \sa
154 */
mainSecSmNull_stop(mainSec_t * pMainSec)155 TI_STATUS mainSecSmNull_stop(mainSec_t *pMainSec)
156 {
157     return TI_OK;
158 }
159 
160 /**
161 *
162 * mainSecNull_reportKeysStatus
163 *
164 * \b Description:
165 *
166 * Start the NULL main security SM. Reports success to the rsn module immediately.
167 *
168 * \b ARGS:
169 *
170 *  none
171 *
172 * \b RETURNS:
173 *
174 *  TI_OK on success, TI_NOK otherwise.
175 *
176 * \sa
177 */
mainSecNull_reportKeysStatus(mainSec_t * pMainSec,TI_STATUS keysStatus)178 TI_STATUS mainSecNull_reportKeysStatus(mainSec_t *pMainSec, TI_STATUS keysStatus)
179 {
180 
181 	return TI_OK;
182 }
183 /**
184 *
185 * mainSecKeysOnly_getAuthState:  \n
186 *
187 * \b Description:
188 *
189 * Get authentication state from supp1x SM.
190 *
191 * \b ARGS:
192 *
193 *  I   - pMainSec - pMainSec SM context  \n
194 *  I   - authIdentity - pointer to authentication state \n
195 *
196 * \b RETURNS:
197 *
198 *  TI_OK if successful, TI_NOK otherwise.
199 *
200 * \sa
201 */
202 
mainSecNull_getAuthState(mainSec_t * pMainSec,TIWLN_SECURITY_STATE * secState)203 TI_STATUS mainSecNull_getAuthState(mainSec_t *pMainSec, TIWLN_SECURITY_STATE *secState)
204 {
205 	*secState = eSecurityStateHalted;
206 	return TI_OK;
207 
208 } /*mainSecKeysOnly_getAuthState*/
209 
210 
mainSecSmNull_nop(mainSec_t * pMainSec)211 TI_STATUS mainSecSmNull_nop(mainSec_t *pMainSec)
212 {
213 	return TI_OK;
214 
215 } /*mainSecKeysOnly_getAuthState*/
216 
217 
mainSecNull_reportAuthFailure(mainSec_t * pMainSec,EAuthStatus authStatus)218 TI_STATUS mainSecNull_reportAuthFailure(mainSec_t *pMainSec, EAuthStatus authStatus)
219 {
220     return TI_OK;
221 }
222 
223 
mainSecNull_setAuthIdentity(mainSec_t * pMainSec,authIdentity_t * authIdentity)224 TI_STATUS mainSecNull_setAuthIdentity(mainSec_t *pMainSec, authIdentity_t *authIdentity)
225 {
226 
227 	return TI_OK;
228 }
229