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 broadcastKeyNone.c
35 * \brief broadcast key None implementation
37 * \see broadcastKeyNone.h
40 /****************************************************************************
42 * MODULE: None station broadcast key SM *
43 * PURPOSE: None station broadcast key SM implementation *
45 ****************************************************************************/
47 #define __FILE_ID__ FILE_ID_23
52 #include "keyDerive.h"
54 #include "broadcastKeyNone.h"
55 #include "mainKeysSm.h"
59 TI_STATUS broadcastKeyNone_distribute(struct _broadcastKey_t *pBroadcastKey, encodedKeyMaterial_t *pEncodedKeyMaterial);
60 TI_STATUS broadcastKeyNone_start(struct _broadcastKey_t *pBroadcastKey);
66 * Function - Init KEY Parser module.
70 * Called by RSN Manager.
71 * Registers the function 'rsn_BroadcastKeyRecv()' at the distributor to receive KEY frames upon receiving a KEY_RECV event.
78 * TI_STATUS - 0 on success, any other value on failure.
82 TI_STATUS broadcastKeyNone_config(struct _broadcastKey_t *pBroadcastKey)
85 pBroadcastKey->start = broadcastKeyNone_start;
86 pBroadcastKey->stop = broadcastKeySmNop;
87 pBroadcastKey->recvFailure = broadcastKeySmNop;
88 pBroadcastKey->recvSuccess = broadcastKeyNone_distribute;
90 pBroadcastKey->currentState = 0;
98 * broadcastKeyNone_start
102 * report the main key SM of broadcast complete, whithout wating for keys.
106 * I - pBroadcastKey - context \n
110 * TI_OK on success, TI_NOK otherwise.
112 TI_STATUS broadcastKeyNone_start(struct _broadcastKey_t *pBroadcastKey)
114 TI_STATUS status=TI_NOK;
116 if (pBroadcastKey->pParent->reportBcastStatus!=NULL)
118 status = pBroadcastKey->pParent->reportBcastStatus(pBroadcastKey->pParent, TI_OK);
126 * broadcastKeyNone_distribute
130 * Distribute broadcast key material to the driver and report the main key SM on broadcast complete.
134 * I - pData - Encoded key material \n
138 * TI_OK on success, TI_NOK otherwise.
140 TI_STATUS broadcastKeyNone_distribute(struct _broadcastKey_t *pBroadcastKey, encodedKeyMaterial_t *pEncodedKeyMaterial)
142 TI_STATUS status=TI_NOK;
144 if (pBroadcastKey->pKeyDerive->derive!=NULL)
146 status = pBroadcastKey->pKeyDerive->derive(pBroadcastKey->pKeyDerive,
147 pEncodedKeyMaterial);
154 if (pBroadcastKey->pParent->reportBcastStatus!=NULL)
156 status = pBroadcastKey->pParent->reportBcastStatus(pBroadcastKey->pParent, TI_OK);