Add a return value to prf_t.get_bytes()

This commit is contained in:
Martin Willi
2012-07-16 14:53:33 +02:00
parent e7d98b8c99
commit bc47488323
13 changed files with 133 additions and 48 deletions
+8 -5
View File
@@ -56,12 +56,15 @@ static bool p_hash(prf_t *prf, char *label, chunk_t seed, size_t block_size,
while (TRUE)
{
/* A(i) = HMAC_hash(secret, A(i-1)) */
prf->get_bytes(prf, a, abuf);
a = chunk_from_thing(abuf);
/* HMAC_hash(secret, A(i) + seed) */
prf->get_bytes(prf, a, NULL);
prf->get_bytes(prf, seed, buf);
/* A(i) = HMAC_hash(secret, A(i-1))
* HMAC_hash(secret, A(i) + seed) */
if (!prf->get_bytes(prf, a, abuf) ||
!prf->get_bytes(prf, a, NULL) ||
!prf->get_bytes(prf, seed, buf))
{
return FALSE;
}
if (bytes <= block_size)
{