crypto: drbg - avoid duplicate maintenance of key
authorStephan Mueller <smueller@chronox.de>
Tue, 14 Jun 2016 05:36:06 +0000 (07:36 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 15 Jun 2016 09:07:54 +0000 (17:07 +0800)
The TFM object maintains the key for the CTR DRBG.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/drbg.c

index 8ceb71699dea83a69ea0e07e6303f5b5eb6b08f8..ded86385ab6e358d518a9d813c60e58e4db23561 100644 (file)
@@ -517,8 +517,7 @@ static int drbg_ctr_update(struct drbg_state *drbg, struct list_head *seed,
                return ret;
 
        /* 10.2.1.2 step 5 */
-       memcpy(drbg->C, temp, drbg_keylen(drbg));
-       ret = crypto_skcipher_setkey(drbg->ctr_handle, drbg->C,
+       ret = crypto_skcipher_setkey(drbg->ctr_handle, temp,
                                     drbg_keylen(drbg));
        if (ret)
                goto out;