summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-01-02 14:18:20 +0100
committerYves-Alexis Perez <corsac@debian.org>2013-01-02 14:18:20 +0100
commitc1343b3278cdf99533b7902744d15969f9d6fdc1 (patch)
treed5ed3dc5677a59260ec41cd39bb284d3e94c91b3 /src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c
parentb34738ed08c2227300d554b139e2495ca5da97d6 (diff)
downloadvyos-strongswan-c1343b3278cdf99533b7902744d15969f9d6fdc1.tar.gz
vyos-strongswan-c1343b3278cdf99533b7902744d15969f9d6fdc1.zip
Imported Upstream version 5.0.1
Diffstat (limited to 'src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c')
-rw-r--r--src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c b/src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c
index 66a077353..4489b902a 100644
--- a/src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c
+++ b/src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c
@@ -83,13 +83,14 @@ static void append_data(private_padlock_sha1_hasher_t *this, chunk_t data)
this->data.len += data.len;
}
-METHOD(hasher_t, reset, void,
+METHOD(hasher_t, reset, bool,
private_padlock_sha1_hasher_t *this)
{
chunk_free(&this->data);
+ return TRUE;
}
-METHOD(hasher_t, get_hash, void,
+METHOD(hasher_t, get_hash, bool,
private_padlock_sha1_hasher_t *this, chunk_t chunk, u_int8_t *hash)
{
if (hash)
@@ -109,20 +110,18 @@ METHOD(hasher_t, get_hash, void,
{
append_data(this, chunk);
}
+ 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,