summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-10-27 17:29:41 +0300
committerWilly Tarreau <w@1wt.eu>2017-02-06 09:04:07 +0100
commitb5b7b2f8996df549b7de37c26e685a92fb54a7f4 (patch)
treea3ec2d9d85d1dba598df2f9b007453b7fe70872d /crypto
parent16d4044862642265bfaf5dc909e4c19ce595595b (diff)
downloadlinux-b5b7b2f8996df549b7de37c26e685a92fb54a7f4.tar.gz
linux-b5b7b2f8996df549b7de37c26e685a92fb54a7f4.tar.bz2
linux-b5b7b2f8996df549b7de37c26e685a92fb54a7f4.zip
crypto: algif_skcipher - Add key check exception for cipher_null
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. Cc: stable@vger.kernel.org Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/algif_skcipher.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index db5f0f0090e0..4677a45ec8cc 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -759,7 +759,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_common(private, sk);