aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/sha1
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2012-07-09 17:26:14 +0200
committerMartin Willi <martin@revosec.ch>2012-07-16 14:55:06 +0200
commite3b2e900e635f13b783131e088ec17265c1186fe (patch)
tree5a2b29b69edb99d9687c69cfb2642b0be70cc660 /src/libstrongswan/plugins/sha1
parent87dd205b61ae8c0125b459959fcc7349fa27bb74 (diff)
downloadstrongswan-e3b2e900e635f13b783131e088ec17265c1186fe.tar.bz2
strongswan-e3b2e900e635f13b783131e088ec17265c1186fe.tar.xz
Add a return value to hasher_t.reset()
Diffstat (limited to 'src/libstrongswan/plugins/sha1')
-rw-r--r--src/libstrongswan/plugins/sha1/sha1_hasher.c4
-rw-r--r--src/libstrongswan/plugins/sha1/sha1_prf.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/libstrongswan/plugins/sha1/sha1_hasher.c b/src/libstrongswan/plugins/sha1/sha1_hasher.c
index ceb8fc0b5..b0efbae7d 100644
--- a/src/libstrongswan/plugins/sha1/sha1_hasher.c
+++ b/src/libstrongswan/plugins/sha1/sha1_hasher.c
@@ -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,
diff --git a/src/libstrongswan/plugins/sha1/sha1_prf.c b/src/libstrongswan/plugins/sha1/sha1_prf.c
index 5907a0fd2..cdc494b34 100644
--- a/src/libstrongswan/plugins/sha1/sha1_prf.c
+++ b/src/libstrongswan/plugins/sha1/sha1_prf.c
@@ -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++)
{