Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758773AbcCVKm0 (ORCPT ); Tue, 22 Mar 2016 06:42:26 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56450 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758681AbcCVKls (ORCPT ); Tue, 22 Mar 2016 06:41:48 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Ben Hutchings , Luis Henriques Subject: [PATCH 3.16.y-ckt 026/142] crypto: {blk,giv}cipher: Set has_setkey Date: Tue, 22 Mar 2016 10:39:15 +0000 Message-Id: <1458643271-4227-27-git-send-email-luis.henriques@canonical.com> In-Reply-To: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> References: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1495 Lines: 43 3.16.7-ckt26 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Ben Hutchings Commit a1383cd86a06 ("crypto: skcipher - Add crypto_skcipher_has_setkey") was incorrectly backported to the 3.2.y and 3.16.y stable branches. We need to set ablkcipher_tfm::has_setkey in the crypto_init_blkcipher_ops_async() and crypto_init_givcipher_ops() functions as well as crypto_init_ablkcipher_ops(). Signed-off-by: Ben Hutchings Signed-off-by: Luis Henriques --- crypto/ablkcipher.c | 1 + crypto/blkcipher.c | 1 + 2 files changed, 2 insertions(+) diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index 5da16526c890..970b48e70624 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c @@ -457,6 +457,7 @@ static int crypto_init_givcipher_ops(struct crypto_tfm *tfm, u32 type, crt->givdecrypt = alg->givdecrypt ?: no_givdecrypt; crt->base = __crypto_ablkcipher_cast(tfm); crt->ivsize = alg->ivsize; + crt->has_setkey = alg->max_keysize; return 0; } diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c index 7180cb2fe026..3c551d46aa3b 100644 --- a/crypto/blkcipher.c +++ b/crypto/blkcipher.c @@ -471,6 +471,7 @@ static int crypto_init_blkcipher_ops_async(struct crypto_tfm *tfm) } crt->base = __crypto_ablkcipher_cast(tfm); crt->ivsize = alg->ivsize; + crt->has_setkey = alg->max_keysize; return 0; }