diff mbox

[05/13] crypto: ccm-aes-ce - copy AAD during encryption

Message ID 23557836.vhvS21O3kI@positron.chronox.de (mailing list archive)
State Deferred
Delegated to: Herbert Xu
Headers show

Commit Message

Stephan Mueller Jan. 10, 2017, 1:38 a.m. UTC
From acad5f6af68d18bc1dbac460bd44f2298902018b Mon Sep 17 00:00:00 2001
From: Stephan Mueller <smueller@chronox.de>
Date: Mon, 9 Jan 2017 14:32:02 +0100
Subject: 

Invoke the crypto_aead_copy_ad function during the encryption code path
to copy the AAD from the source to the destination buffer.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
 arch/arm64/crypto/aes-ce-ccm-glue.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/arch/arm64/crypto/aes-ce-ccm-glue.c b/arch/arm64/crypto/aes-ce-ccm-glue.c
index cc5515d..7dfcb1f 100644
--- a/arch/arm64/crypto/aes-ce-ccm-glue.c
+++ b/arch/arm64/crypto/aes-ce-ccm-glue.c
@@ -155,6 +155,10 @@  static int ccm_encrypt(struct aead_request *req)
 	u32 len = req->cryptlen;
 	int err;
 
+	err = crypto_aead_copy_ad(req);
+	if (err)
+		return err;
+
 	err = ccm_init_mac(req, mac, len);
 	if (err)
 		return err;