add check on NETX duo build and return value of opening driver

This commit is contained in:
Jacob Barthelmeh
2020-01-20 09:33:14 -07:00
parent c01cd808da
commit 3508579f4c
3 changed files with 8 additions and 3 deletions

View File

@@ -2324,7 +2324,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
word32 len = sz;
ret = g_sce_trng.p_api->open(g_sce_trng.p_ctrl, g_sce_trng.p_cfg);
if (ret != SSP_SUCCESS) {
if (ret != SSP_SUCCESS && ret != SSP_ERR_CRYPTO_ALREADY_OPEN) {
/* error opening TRNG driver */
return -1;
}

View File

@@ -229,7 +229,8 @@ int wolfCrypt_Init(void)
#endif
#ifdef WOLFSSL_SCE
if ((ret = g_sce.p_api->open(g_sce.p_ctrl, g_sce.p_cfg)) != SSP_SUCCESS) {
ret = (int)g_sce.p_api->open(g_sce.p_ctrl, g_sce.p_cfg);
if (ret != SSP_SUCCESS && ret != SSP_ERR_CRYPTO_ALREADY_OPEN) {
WOLFSSL_MSG("Error opening SCE\n");
return -1; /* FATAL_ERROR */
}

View File

@@ -83,7 +83,11 @@
#elif defined(WOLFSSL_IAR_ARM)
/* nothing */
#elif defined(HAVE_NETX_BSD)
#include "nx_bsd.h"
#ifdef NETX_DUO
#include "nxd_bsd.h"
#else
#include "nx_bsd.h"
#endif
#elif defined(WOLFSSL_VXWORKS)
#include <sockLib.h>
#include <errno.h>