Skip to content

Commit

Permalink
crypto: drbg - avoid duplicate maintenance of key
Browse files Browse the repository at this point in the history
The TFM object maintains the key for the CTR DRBG.

Signed-off-by: Stephan Mueller <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
smuellerDD authored and herbertx committed Jun 15, 2016
1 parent a07203f commit 103eb3f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/drbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 103eb3f

Please sign in to comment.