summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-11-06 03:30:48 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2017-11-10 12:20:22 +0100
commitced6a58638432c9f731184f908208d539725ba82 (patch)
treee723e433ade388f6d6cb4e79b450f35d64aa5a5b /crypto
parentcrypto: qat - Clean up error handling in qat_dh_set_secret() (diff)
downloadlinux-ced6a58638432c9f731184f908208d539725ba82.tar.xz
linux-ced6a58638432c9f731184f908208d539725ba82.zip
crypto: dh - Remove pointless checks for NULL 'p' and 'g'
Neither 'p' nor 'g' can be NULL, as they were unpacked using crypto_dh_decode_key(). And it makes no sense for them to be optional. So remove the NULL checks that were copy-and-pasted into both modules. Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/dh.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/crypto/dh.c b/crypto/dh.c
index aadaf36fb56f..5659fe7f446d 100644
--- a/crypto/dh.c
+++ b/crypto/dh.c
@@ -53,9 +53,6 @@ static int dh_check_params_length(unsigned int p_len)
static int dh_set_params(struct dh_ctx *ctx, struct dh *params)
{
- if (unlikely(!params->p || !params->g))
- return -EINVAL;
-
if (dh_check_params_length(params->p_size << 3))
return -EINVAL;