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