From patchwork Fri Mar 25 16:01:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 602030 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3qWp2M6N2Yz9s4x; Sat, 26 Mar 2016 03:01:31 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ajUAw-0007Y0-SH; Fri, 25 Mar 2016 16:01:26 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ajUAk-0007T1-1a for kernel-team@lists.ubuntu.com; Fri, 25 Mar 2016 16:01:14 +0000 Received: from 1.general.kamal.us.vpn ([10.172.68.52] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ajUAj-0005W8-KQ for kernel-team@lists.ubuntu.com; Fri, 25 Mar 2016 16:01:13 +0000 Received: from kamal by fourier with local (Exim 4.86) (envelope-from ) id 1ajUAg-0007WQ-Vy for kernel-team@lists.ubuntu.com; Fri, 25 Mar 2016 09:01:10 -0700 From: Kamal Mostafa To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/4] crypto: algif_skcipher - Add key check exception for cipher_null Date: Fri, 25 Mar 2016 09:01:05 -0700 Message-Id: <1458921667-28870-3-git-send-email-kamal@whence.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1458921667-28870-1-git-send-email-kamal@whence.com> References: <1458921667-28870-1-git-send-email-kamal@whence.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Herbert Xu BugLink: http://bugs.launchpad.net/bugs/1556562 commit 6e8d8ecf438792ecf7a3207488fb4eebc4edb040 upstream. This patch adds an exception to the key check so that cipher_null users may continue to use algif_skcipher without setting a key. Signed-off-by: Herbert Xu [bwh: Backported to 3.2: use crypto_ablkcipher_has_setkey()] Signed-off-by: Ben Hutchings Signed-off-by: Luis Henriques Signed-off-by: Kamal Mostafa --- crypto/algif_skcipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 6c0410e..b5d5a35 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c @@ -961,7 +961,7 @@ static int skcipher_accept_parent(void *private, struct sock *sk) { struct skcipher_tfm *tfm = private; - if (!tfm->has_key) + if (!tfm->has_key && crypto_ablkcipher_has_setkey(tfm->skcipher)) return -ENOKEY; return skcipher_accept_parent_nokey(private, sk);