Add a return value to hasher_t.allocate_hash()

This commit is contained in:
Martin Willi
2012-07-16 14:55:06 +02:00
parent e185612dd8
commit 87dd205b61
40 changed files with 269 additions and 149 deletions
@@ -112,18 +112,15 @@ METHOD(hasher_t, get_hash, bool,
return TRUE;
}
METHOD(hasher_t, allocate_hash, void,
METHOD(hasher_t, allocate_hash, bool,
private_padlock_sha1_hasher_t *this, chunk_t chunk, chunk_t *hash)
{
if (hash)
{
*hash = chunk_alloc(HASH_SIZE_SHA1);
get_hash(this, chunk, hash->ptr);
}
else
{
get_hash(this, chunk, NULL);
return get_hash(this, chunk, hash->ptr);
}
return get_hash(this, chunk, NULL);
}
METHOD(hasher_t, get_hash_size, size_t,