From patchwork Tue Jan 10 01:38:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Mueller X-Patchwork-Id: 9506219 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AAFB760710 for ; Tue, 10 Jan 2017 01:42:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98B0A28375 for ; Tue, 10 Jan 2017 01:42:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D87328461; Tue, 10 Jan 2017 01:42:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4286028375 for ; Tue, 10 Jan 2017 01:42:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941455AbdAJBmL (ORCPT ); Mon, 9 Jan 2017 20:42:11 -0500 Received: from mail.eperm.de ([89.247.134.16]:55392 "EHLO mail.eperm.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933311AbdAJBmL (ORCPT ); Mon, 9 Jan 2017 20:42:11 -0500 Received: from positron.chronox.de (50-255-10-49-static.hfc.comcastbusiness.net [50.255.10.49]) by mail.eperm.de (Postfix) with ESMTPA id 366DE1816195; Tue, 10 Jan 2017 02:42:09 +0100 (CET) From: Stephan =?ISO-8859-1?Q?M=FCller?= To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org Subject: [PATCH 06/13] crypto: talitos - copy AAD during encryption Date: Tue, 10 Jan 2017 02:38:26 +0100 Message-ID: <3113222.IBgeSqlAuS@positron.chronox.de> User-Agent: KMail/5.3.3 (Linux/4.8.15-300.fc25.x86_64; KDE/5.29.0; x86_64; ; ) In-Reply-To: <10526995.lyZ7Je1KMx@positron.chronox.de> References: <10526995.lyZ7Je1KMx@positron.chronox.de> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/crypto/talitos.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 0bba6a1..6a6e343 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -1429,6 +1429,11 @@ static int aead_encrypt(struct aead_request *req) struct crypto_aead *authenc = crypto_aead_reqtfm(req); struct talitos_ctx *ctx = crypto_aead_ctx(authenc); struct talitos_edesc *edesc; + int err; + + err = crypto_aead_copy_ad(req); + if (err) + return err; /* allocate extended descriptor */ edesc = aead_edesc_alloc(req, req->iv, 0, true);