Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283283
b: refs/heads/master
c: 505172e
h: refs/heads/master
i:
  283281: a6e795c
  283279: e5cca2d
v: v3
  • Loading branch information
Jarod Wilson authored and Herbert Xu committed Nov 9, 2011
1 parent 89a82ab commit e4f9465
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bae6d3038b7faff187f4207448a40b9912cf787d
refs/heads/master: 505172e11f5a0d9916e20e40d3b0a6f87d3a59b6
8 changes: 8 additions & 0 deletions trunk/crypto/ansi_cprng.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,18 @@ static int fips_cprng_get_random(struct crypto_rng *tfm, u8 *rdata,
static int fips_cprng_reset(struct crypto_rng *tfm, u8 *seed, unsigned int slen)
{
u8 rdata[DEFAULT_BLK_SZ];
u8 *key = seed + DEFAULT_BLK_SZ;
int rc;

struct prng_context *prng = crypto_rng_ctx(tfm);

if (slen < DEFAULT_PRNG_KSZ + DEFAULT_BLK_SZ)
return -EINVAL;

/* fips strictly requires seed != key */
if (!memcmp(seed, key, DEFAULT_PRNG_KSZ))
return -EINVAL;

rc = cprng_reset(tfm, seed, slen);

if (!rc)
Expand Down

0 comments on commit e4f9465

Please sign in to comment.