summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2014-08-17 17:40:20 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2014-08-25 20:34:11 +0800
commit75f5c6e7c2c78cb42f72c5cab90a753d56e1ecc5 (patch)
treea50bab60910ac9b0fe9e4cfe5d1229a4fcd7cf18
parent8f212346ff392fe89148ac1ca9ccf3e1360e6749 (diff)
downloadlinux-crypto-75f5c6e7c2c78cb42f72c5cab90a753d56e1ecc5.tar.gz
linux-crypto-75f5c6e7c2c78cb42f72c5cab90a753d56e1ecc5.zip
crypto: drbg - remove unnecessary sanity checks
The drbg_make_shadow function contains sanity checks which are not needed as the function is invoked at times where it is ensured that the checked-for variables are available. Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/drbg.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/crypto/drbg.c b/crypto/drbg.c
index ebe0afc4..70157573 100644
--- a/crypto/drbg.c
+++ b/crypto/drbg.c
@@ -1263,15 +1263,6 @@ static int drbg_make_shadow(struct drbg_state *drbg, struct drbg_state **shadow)
int ret = -ENOMEM;
struct drbg_state *tmp = NULL;
- if (!drbg || !drbg->core || !drbg->V || !drbg->C) {
- pr_devel("DRBG: attempt to generate shadow copy for "
- "uninitialized DRBG state rejected\n");
- return -EINVAL;
- }
- /* HMAC does not have a scratchpad */
- if (!(drbg->core->flags & DRBG_HMAC) && NULL == drbg->scratchpad)
- return -EINVAL;
-
tmp = kzalloc(sizeof(struct drbg_state), GFP_KERNEL);
if (!tmp)
return -ENOMEM;