From patchwork Thu Mar 24 17:06:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 601733 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 3qWCXj1tvlz9s3T; Fri, 25 Mar 2016 04:07:17 +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 1aj8j4-00058c-8j; Thu, 24 Mar 2016 17:07:14 +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 1aj8ix-00056i-SE for kernel-team@lists.ubuntu.com; Thu, 24 Mar 2016 17:07:07 +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 1aj8ix-0006gR-E6 for kernel-team@lists.ubuntu.com; Thu, 24 Mar 2016 17:07:07 +0000 Received: from kamal by fourier with local (Exim 4.86) (envelope-from ) id 1aj8iu-0007MW-Om for kernel-team@lists.ubuntu.com; Thu, 24 Mar 2016 10:07:04 -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: Thu, 24 Mar 2016 10:06:59 -0700 Message-Id: <1458839221-28249-3-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1458839221-28249-1-git-send-email-kamal@canonical.com> References: <1458839221-28249-1-git-send-email-kamal@canonical.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);