Skip to content

Commit 90942b7

Browse files
authored
Merge pull request #19 from wolfSSL/async_fixes
Various async fixes for release prep v3.15.5
2 parents e5297c8 + c072725 commit 90942b7

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

File renamed without changes.

wolfcrypt/src/port/intel/quickassist.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ int IntelQaHardwareStart(const char* process_name, int limitDevAccess)
348348
Cpa32U coreAffinity = 0;
349349
CpaCySymCapabilitiesInfo capabilities;
350350
int j;
351+
XMEMSET(&capabilities, 0, sizeof(capabilities));
351352

352353
status = cpaCyInstanceGetInfo2(g_cyInstances[i],
353354
&g_cyInstanceInfo[i]);
@@ -1416,11 +1417,11 @@ static int IntelQaSymClose(WC_ASYNC_DEV* dev, int doFree)
14161417
#endif
14171418

14181419
#ifdef QAT_DEBUG
1419-
printf("IntelQaSymClose: dev %p, symCtx %p (src %p), symCtxSize %d, isCopy %d, isOpen %d, doFree %d\n",
1420-
dev, ctx->symCtx, ctx->symCtxSrc, ctx->symCtxSize, ctx->isCopy, ctx->isOpen, doFree);
1420+
printf("IntelQaSymClose: dev %p, ctx %p, symCtx %p (src %p), symCtxSize %d, isCopy %d, isOpen %d, doFree %d\n",
1421+
dev, ctx, ctx->symCtx, ctx->symCtxSrc, ctx->symCtxSize, ctx->isCopy, ctx->isOpen, doFree);
14211422
#endif
14221423

1423-
if (ctx->symCtx == ctx->symCtxSrc) {
1424+
if (ctx->symCtx == ctx->symCtxSrc && ctx->symCtx != NULL) {
14241425
if (ctx->isOpen) {
14251426
ctx->isOpen = 0;
14261427
#ifdef QAT_DEBUG
@@ -2842,7 +2843,7 @@ int IntelQaEcdsaVerify(WC_ASYNC_DEV* dev, WC_BIGINT* m,
28422843
WC_BIGINT* r, WC_BIGINT* s,
28432844
WC_BIGINT* a, WC_BIGINT* b,
28442845
WC_BIGINT* q, WC_BIGINT* n,
2845-
WC_BIGINT* xg, WC_BIGINT* yg, int* stat)
2846+
WC_BIGINT* xg, WC_BIGINT* yg, int* pVerifyStatus)
28462847
{
28472848
int ret, retryCount = 0;
28482849
CpaStatus status = CPA_STATUS_SUCCESS;
@@ -2878,7 +2879,7 @@ int IntelQaEcdsaVerify(WC_ASYNC_DEV* dev, WC_BIGINT* m,
28782879
}
28792880

28802881
/* store info needed for output */
2881-
dev->qat.op.ecc_verify.stat = stat;
2882+
dev->qat.op.ecc_verify.stat = pVerifyStatus;
28822883
IntelQaOpInit(dev, IntelQaEcdsaVerifyFree);
28832884

28842885
/* Perform ECDSA verify */
@@ -3342,10 +3343,15 @@ int IntelQaDrbg(WC_ASYNC_DEV* dev, byte* rngBuf, word32 rngSz)
33423343
CpaFlatBuffer* pOut = NULL;
33433344
word32 idx = 0, gen = 0;
33443345

3345-
if (dev == NULL || rngBuf == NULL || rngSz == 0) {
3346+
if (dev == NULL || rngBuf == NULL) {
33463347
return BAD_FUNC_ARG;
33473348
}
33483349

3350+
/* This function can be called with rngSz == 0 */
3351+
if (rngSz == 0) {
3352+
return 0; /* no data to get */
3353+
}
3354+
33493355
#ifdef QAT_DEBUG
33503356
printf("IntelQaDrbg: dev %p, buf %p, sz %d\n", dev, rngBuf, rngSz);
33513357
#endif

wolfcrypt/src/port/intel/quickassist_mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static void* _qaeMemAlloc(size_t size, void* heap, int type
428428

429429
#ifdef WOLFSSL_DEBUG_MEMORY
430430
#ifdef WOLFSSL_DEBUG_MEMORY_PRINT
431-
printf("Malloc: %p (%u) at %s:%d, heap %p, type %d\n",
431+
printf("Alloc: %p (%u) at %s:%d, heap %p, type %d\n",
432432
ptr, (unsigned int)size, func, line, heap, type);
433433
#else
434434
(void)func;

0 commit comments

Comments
 (0)