mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
e6c0244ad3
commit
bc034ef557
1 changed files with 0 additions and 9 deletions
|
@ -1263,15 +1263,6 @@ static int drbg_make_shadow(struct drbg_state *drbg, struct drbg_state **shadow)
|
||||||
int ret = -ENOMEM;
|
int ret = -ENOMEM;
|
||||||
struct drbg_state *tmp = NULL;
|
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);
|
tmp = kzalloc(sizeof(struct drbg_state), GFP_KERNEL);
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Add table
Reference in a new issue