mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
gate access to wc_Sha512.devId on !NO_SHA2_CRYPTO_CB.
This commit is contained in:
@ -785,10 +785,13 @@ int wc_CryptoCb_Sha384Hash(wc_Sha384* sha384, const byte* in,
|
||||
CryptoCb* dev;
|
||||
|
||||
/* locate registered callback */
|
||||
#ifndef NO_SHA2_CRYPTO_CB
|
||||
if (sha384) {
|
||||
dev = wc_CryptoCb_FindDevice(sha384->devId);
|
||||
}
|
||||
else {
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* locate first callback and try using it */
|
||||
dev = wc_CryptoCb_FindDeviceByIndex(0);
|
||||
}
|
||||
@ -818,10 +821,13 @@ int wc_CryptoCb_Sha512Hash(wc_Sha512* sha512, const byte* in,
|
||||
CryptoCb* dev;
|
||||
|
||||
/* locate registered callback */
|
||||
#ifndef NO_SHA2_CRYPTO_CB
|
||||
if (sha512) {
|
||||
dev = wc_CryptoCb_FindDevice(sha512->devId);
|
||||
}
|
||||
else {
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* locate first callback and try using it */
|
||||
dev = wc_CryptoCb_FindDeviceByIndex(0);
|
||||
}
|
||||
|
@ -38075,8 +38075,10 @@ static int myCryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
|
||||
if (info->hash.sha384 == NULL)
|
||||
return NOT_COMPILED_IN;
|
||||
|
||||
#ifndef NO_SHA2_CRYPTO_CB
|
||||
/* set devId to invalid, so software is used */
|
||||
info->hash.sha384->devId = INVALID_DEVID;
|
||||
#endif
|
||||
|
||||
if (info->hash.in != NULL) {
|
||||
ret = wc_Sha384Update(
|
||||
@ -38090,8 +38092,10 @@ static int myCryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
|
||||
info->hash.digest);
|
||||
}
|
||||
|
||||
#ifndef NO_SHA2_CRYPTO_CB
|
||||
/* reset devId */
|
||||
info->hash.sha384->devId = devIdArg;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@ -38100,8 +38104,10 @@ static int myCryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
|
||||
if (info->hash.sha512 == NULL)
|
||||
return NOT_COMPILED_IN;
|
||||
|
||||
#ifndef NO_SHA2_CRYPTO_CB
|
||||
/* set devId to invalid, so software is used */
|
||||
info->hash.sha512->devId = INVALID_DEVID;
|
||||
#endif
|
||||
|
||||
if (info->hash.in != NULL) {
|
||||
ret = wc_Sha512Update(
|
||||
@ -38115,8 +38121,10 @@ static int myCryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
|
||||
info->hash.digest);
|
||||
}
|
||||
|
||||
#ifndef NO_SHA2_CRYPTO_CB
|
||||
/* reset devId */
|
||||
info->hash.sha512->devId = devIdArg;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user