Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/wh_server_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -2112,6 +2112,33 @@ static int _HandleAesGcmDma(whServerContext* ctx, uint16_t magic, uint16_t seq,
}
}

/* Post-write DMA address processing for output/authTag (on success) */
if (ret == WH_ERROR_OK) {
if (req.output.sz > 0) {
int rc2 = wh_Server_DmaProcessClientAddress(
ctx, req.output.addr, &outAddr, req.output.sz,
WH_DMA_OPER_CLIENT_WRITE_POST, (whServerDmaFlags){0});
if (rc2 != WH_ERROR_OK) {
if (rc2 == WH_ERROR_ACCESS) {
res.dmaAddrStatus.badAddr = req.output;
}
ret = rc2;
}
}
/* During encryption, the auth tag is written to client memory */
if (ret == WH_ERROR_OK && req.enc && req.authTag.sz > 0) {
int rc2 = wh_Server_DmaProcessClientAddress(
ctx, req.authTag.addr, &authTagAddr, req.authTag.sz,
WH_DMA_OPER_CLIENT_WRITE_POST, (whServerDmaFlags){0});
if (rc2 != WH_ERROR_OK) {
if (rc2 == WH_ERROR_ACCESS) {
res.dmaAddrStatus.badAddr = req.authTag;
}
ret = rc2;
}
}
}

wc_AesFree(aes);
res.outSz = outSz;

Expand Down