mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
adds WC_NO_DEFAULT_DEVID to disallow automatic use of "default" devId
This commit is contained in:
@@ -1882,6 +1882,12 @@ int wc_CryptoCb_DefaultDevID(void)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/* Explicitly disable the "default devId" behavior. Ensures that any devId
|
||||||
|
* will only be used if explicitly passed as an argument to crypto functions,
|
||||||
|
* and never automatically selected. */
|
||||||
|
#ifdef WC_NO_DEFAULT_DEVID
|
||||||
|
ret = INVALID_DEVID;
|
||||||
|
#else
|
||||||
/* conditional macro selection based on build */
|
/* conditional macro selection based on build */
|
||||||
#ifdef WOLFSSL_CAAM_DEVID
|
#ifdef WOLFSSL_CAAM_DEVID
|
||||||
ret = WOLFSSL_CAAM_DEVID;
|
ret = WOLFSSL_CAAM_DEVID;
|
||||||
@@ -1893,6 +1899,7 @@ int wc_CryptoCb_DefaultDevID(void)
|
|||||||
/* try first available */
|
/* try first available */
|
||||||
ret = wc_CryptoCb_GetDevIdAtIndex(0);
|
ret = wc_CryptoCb_GetDevIdAtIndex(0);
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* WC_NO_DEFAULT_DEVID */
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user