diff options
author | Eric Biggers <ebiggers@google.com> | 2017-11-05 18:30:48 -0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-11-10 19:20:22 +0800 |
commit | 5a5e1fc42bbab8acd834ef8143aa2b339e34ed1b (patch) | |
tree | 1e950b724805a816068c09d9cd464ba77e453f4b /crypto | |
parent | 246c7e6f3567aba7edb45a90cc662382c4d0acca (diff) | |
download | linux-crypto-5a5e1fc42bbab8acd834ef8143aa2b339e34ed1b.tar.gz linux-crypto-5a5e1fc42bbab8acd834ef8143aa2b339e34ed1b.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 '')
-rw-r--r-- | crypto/dh.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/crypto/dh.c b/crypto/dh.c index aadaf36f..5659fe7f 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; |