/** * * mainSec_config * * \b Description: * * Init main security state machine state machine * * \b ARGS: * * none * * \b RETURNS: * * TI_OK on success, TI_NOK otherwise. * * \sa */ TI_STATUS mainSec_unload(mainSec_t *pMainSec) { TI_STATUS status; if (pMainSec == NULL) { return TI_NOK; } status = mainKeys_unload(pMainSec->pMainKeys); if (status != TI_OK) { /* report failure but don't stop... */ TRACE0(pMainSec->hReport, REPORT_SEVERITY_ERROR, "MAIN_SEC_SM: Error releasing Main Keys SM memory \n"); } status = fsm_Unload(pMainSec->hOs, pMainSec->pMainSecSm); if (status != TI_OK) { /* report failure but don't stop... */ TRACE0(pMainSec->hReport, REPORT_SEVERITY_ERROR, "MAIN_SEC_SM: Error releasing FSM memory \n"); } status = externalSec_Destroy (pMainSec->pExternalSec); if (status != TI_OK) { /* report failure but don't stop... */ TRACE0(pMainSec->hReport, REPORT_SEVERITY_ERROR, "MAIN_SEC_SM: Error releasing External Security SM memory \n"); } os_memoryFree(pMainSec->hOs, pMainSec, sizeof(mainSec_t)); return TI_OK; }
/** * * mainSec_config * * \b Description: * * Init main security state machine state machine * * \b ARGS: * * none * * \b RETURNS: * * TI_OK on success, TI_NOK otherwise. * * \sa */ TI_STATUS mainSec_unload(mainSec_t *pMainSec) { TI_STATUS status; if (pMainSec == NULL) { return TI_NOK; } status = mainKeys_unload(pMainSec->pMainKeys); status = fsm_Unload(pMainSec->hOs, pMainSec->pMainSecSm); status = externalSec_Destroy (pMainSec->pExternalSec); os_memoryFree(pMainSec->hOs, pMainSec, sizeof(mainSec_t)); return TI_OK; }