crypto: omap-aes-gcm - fix failure with assocdata only

If we only have assocdata with an omap-aes-gcm, it currently just
completes it directly without passing it over to the crypto HW. This
produces wrong results.

Fix by passing the request down to the crypto HW, and fix the DMA
support code to accept a case where we don't expect any output data.
In the case where only assocdata is provided, it just passes through
the accelerator and provides authentication results, without any
encrypted/decrypted buffer via DMA.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Tero Kristo
2019-11-05 16:01:06 +02:00
committed by Herbert Xu
parent f0956d42c1
commit 5d5f3eed29
2 changed files with 42 additions and 27 deletions

View File

@@ -244,7 +244,7 @@ static int omap_aes_gcm_handle_queue(struct omap_aes_dev *dd,
err = omap_aes_write_ctrl(dd);
if (!err) {
if (dd->in_sg_len && dd->out_sg_len)
if (dd->in_sg_len)
err = omap_aes_crypt_dma_start(dd);
else
omap_aes_gcm_dma_out_callback(dd);