Add a return value to hasher_t.reset()
This commit is contained in:
@@ -175,7 +175,7 @@ static void SHA1Final(private_sha1_hasher_t *this, u_int8_t *digest)
|
||||
}
|
||||
}
|
||||
|
||||
METHOD(hasher_t, reset, void,
|
||||
METHOD(hasher_t, reset, bool,
|
||||
private_sha1_hasher_t *this)
|
||||
{
|
||||
this->state[0] = 0x67452301;
|
||||
@@ -185,6 +185,8 @@ METHOD(hasher_t, reset, void,
|
||||
this->state[4] = 0xC3D2E1F0;
|
||||
this->count[0] = 0;
|
||||
this->count[1] = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(hasher_t, get_hash, bool,
|
||||
|
||||
@@ -100,7 +100,11 @@ METHOD(prf_t, set_key, bool,
|
||||
int i, rounds;
|
||||
u_int32_t *iv = (u_int32_t*)key.ptr;
|
||||
|
||||
this->hasher->public.hasher_interface.reset(&this->hasher->public.hasher_interface);
|
||||
if (!this->hasher->public.hasher_interface.reset(
|
||||
&this->hasher->public.hasher_interface))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
rounds = min(key.len/sizeof(u_int32_t), sizeof(this->hasher->state));
|
||||
for (i = 0; i < rounds; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user