4 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
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
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.
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.
34 /** \file mainKeysSm.h
35 * \brief RSN main security SM
41 /***************************************************************************/
43 /* MODULE: mainKeysSm.h */
44 /* PURPOSE: RSN main security SM */
46 /***************************************************************************/
48 #ifndef _MAIN_KEYS_SM_H
49 #define _MAIN_KEYS_SM_H
55 #include "keyParser.h"
56 #include "unicastKeySM.h"
57 #include "broadcastKeySM.h"
61 #define MAIN_KEYS_TIMEOUT 20000
67 typedef struct _mainKeys_t mainKeys_t;
69 /* Main Sec SM functions */
70 typedef TI_STATUS (*mainKeysSmStart_t)(struct _mainKeys_t *pMainKeys);
71 typedef TI_STATUS (*mainKeysSmStop_t)(struct _mainKeys_t *pMainKeys);
72 typedef TI_STATUS (*mainKeysSmReportUcastStatus_t)(struct _mainKeys_t *pMainKeys, TI_STATUS authStatus);
73 typedef TI_STATUS (*mainKeysSmReportBcastStatus_t)(struct _mainKeys_t *pMainKeys, TI_STATUS authStatus);
74 typedef TI_STATUS (*mainKeysSmReportReKey_t)(struct _mainKeys_t *pMainKeys);
75 typedef TI_STATUS (*mainKeysSmSetKey_t)(struct _mainKeys_t *pMainKeys, TSecurityKeys *pKey);
76 typedef TI_STATUS (*mainKeysSmRemoveKey_t)(struct _mainKeys_t *pMainKeys, TSecurityKeys *pKey);
77 typedef TI_STATUS (*mainKeysSmSetDefaultKeyId_t)(struct _mainKeys_t *pMainKeys, TI_UINT8 keyId);
78 typedef TI_STATUS (*mainKeysSmGetSessionKey_t)(struct _mainKeys_t *pMainKeys, TI_UINT8 *pKey, TI_UINT32 *pKeyLen);
89 TI_UINT8 currentState;
90 TI_UINT32 keysTimeout;
92 fsm_stateMachine_t *pMainKeysSm;
93 TI_BOOL mainKeysTimeoutCounter;
103 TI_HANDLE hSessionTimer;
105 keyParser_t *pKeyParser;
106 unicastKey_t *pUcastSm;
107 broadcastKey_t *pBcastSm;
108 struct _mainSec_t *pParent;
110 mainKeysSmStart_t start;
111 mainKeysSmStop_t stop;
112 mainKeysSmReportUcastStatus_t reportUcastStatus;
113 mainKeysSmReportBcastStatus_t reportBcastStatus;
114 mainKeysSmReportReKey_t reportReKey;
115 mainKeysSmSetKey_t setKey;
116 mainKeysSmRemoveKey_t removeKey;
117 mainKeysSmSetDefaultKeyId_t setDefaultKeyId;
118 mainKeysSmGetSessionKey_t getSessionKey;
121 /* External data definitions */
123 /* External functions definitions */
125 /* Function prototypes */
127 mainKeys_t* mainKeys_create(TI_HANDLE hOs);
129 TI_STATUS mainKeys_unload(mainKeys_t *pmainKeys);
131 TI_STATUS mainKeys_config (mainKeys_t *pMainKeys,
132 TRsnPaeConfig *pPaeConfig,
137 TI_HANDLE hEvHandler,
142 void mainKeys_reAuth(TI_HANDLE pHandle);