Skip to content

Commit 6deef7c

Browse files
committed
QAT fix to properly handle a finish with no update
1 parent 6d55b42 commit 6deef7c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

wolfcrypt/src/port/intel/quickassist.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,6 +2832,16 @@ static int IntelQaSymHashCache(WC_ASYNC_DEV* dev, byte* out, const byte* in,
28322832
ret = 0; /* success */
28332833
goto exit;
28342834
}
2835+
else if (out != NULL && dev->qat.op.hash.tmpIn == NULL) {
2836+
/* QAT requires an input buffer even for an empty hash */
2837+
dev->qat.op.hash.tmpInSz = 0;
2838+
dev->qat.op.hash.tmpInBufSz = 16; /* use minimum alignment (16 bytes) */
2839+
dev->qat.op.hash.tmpIn = (byte*)XMALLOC(dev->qat.op.hash.tmpInBufSz,
2840+
dev->heap, DYNAMIC_TYPE_ASYNC_NUMA);
2841+
if (dev->qat.op.hash.tmpIn == NULL) {
2842+
ret = MEMORY_E; goto exit;
2843+
}
2844+
}
28352845

28362846
/* handle output processing */
28372847
packetType = CPA_CY_SYM_PACKET_TYPE_FULL;

0 commit comments

Comments
 (0)