|
70 | 70 | #include <wolfcrypt/src/misc.c> |
71 | 71 | #endif |
72 | 72 |
|
| 73 | +#include <pthread.h> |
| 74 | + |
73 | 75 | /* Async enables (1=non-block, 0=block) */ |
74 | 76 | #ifndef QAT_RSA_ASYNC |
75 | 77 | #define QAT_RSA_ASYNC 1 |
@@ -802,6 +804,7 @@ static int IntelQaPollBlockRet(WC_ASYNC_DEV* dev, int ret_wait) |
802 | 804 |
|
803 | 805 | do { |
804 | 806 | ret = IntelQaPoll(dev); |
| 807 | + (void)ret; /* not used */ |
805 | 808 |
|
806 | 809 | if (dev->qat.ret != ret_wait) { |
807 | 810 | break; |
@@ -1996,9 +1999,10 @@ static int IntelQaSymOpen(WC_ASYNC_DEV* dev, CpaCySymSessionSetupData* setup, |
1996 | 1999 | /* Determine size of session context to allocate - use max size */ |
1997 | 2000 | status = cpaCySymSessionCtxGetSize(dev->qat.handle, setup, &sessionCtxSize); |
1998 | 2001 |
|
1999 | | - if (ctx->symCtxSize > 0 && ctx->symCtxSize > sessionCtxSize) { |
2000 | | - printf("Symmetric context size error! Buf %d, Exp %d\n", |
2001 | | - ctx->symCtxSize, sessionCtxSize); |
| 2002 | + if (status != CPA_STATUS_SUCCESS || (ctx->symCtxSize > 0 && |
| 2003 | + ctx->symCtxSize > sessionCtxSize)) { |
| 2004 | + printf("Symmetric context size error %d! Buf %d, Exp %d\n", |
| 2005 | + status, ctx->symCtxSize, sessionCtxSize); |
2002 | 2006 | return ASYNC_OP_E; |
2003 | 2007 | } |
2004 | 2008 |
|
@@ -3797,14 +3801,11 @@ static void IntelQaEcdsaSignCallback(void *pCallbackTag, |
3797 | 3801 | ret = ECC_CURVE_OID_E; |
3798 | 3802 | } |
3799 | 3803 | else { |
3800 | | - /* mark event result */ |
3801 | | - ret = 0; /* success */ |
3802 | | - } |
3803 | | - |
3804 | | - /* populate result */ |
3805 | | - ret = IntelQaFlatBufferToBigInt(pR, dev->qat.op.ecc_sign.pR); |
3806 | | - if (ret == 0) { |
3807 | | - ret = IntelQaFlatBufferToBigInt(pS, dev->qat.op.ecc_sign.pS); |
| 3804 | + /* success - populate result */ |
| 3805 | + ret = IntelQaFlatBufferToBigInt(pR, dev->qat.op.ecc_sign.pR); |
| 3806 | + if (ret == 0) { |
| 3807 | + ret = IntelQaFlatBufferToBigInt(pS, dev->qat.op.ecc_sign.pS); |
| 3808 | + } |
3808 | 3809 | } |
3809 | 3810 | } |
3810 | 3811 | (void)opData; |
|
0 commit comments