aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/crypto/hashers/sha1_hasher.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2007-02-12 15:56:47 +0000
committerMartin Willi <martin@strongswan.org>2007-02-12 15:56:47 +0000
commitf27f6296e6ae5beece739342fd54528cf91e5394 (patch)
treec868a123b98b8a244b249473ab91b0bd4a764b31 /src/libstrongswan/crypto/hashers/sha1_hasher.c
parent6fda18d99d2b6eac921e731a52229d9c1cf8a295 (diff)
downloadstrongswan-f27f6296e6ae5beece739342fd54528cf91e5394.tar.bz2
strongswan-f27f6296e6ae5beece739342fd54528cf91e5394.tar.xz
merged EAP framework from branch into trunk
includes a lot of other modifications
Diffstat (limited to 'src/libstrongswan/crypto/hashers/sha1_hasher.c')
-rw-r--r--src/libstrongswan/crypto/hashers/sha1_hasher.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libstrongswan/crypto/hashers/sha1_hasher.c b/src/libstrongswan/crypto/hashers/sha1_hasher.c
index cca336694..6a86937ae 100644
--- a/src/libstrongswan/crypto/hashers/sha1_hasher.c
+++ b/src/libstrongswan/crypto/hashers/sha1_hasher.c
@@ -223,7 +223,7 @@ static size_t get_hash_size(private_sha1_hasher_t *this)
{
return HASH_SIZE_SHA1;
}
-
+
/**
* Implementation of hasher_t.reset.
*/
@@ -237,6 +237,20 @@ static void reset(private_sha1_hasher_t *this)
this->count[0] = 0;
this->count[1] = 0;
}
+
+/**
+ * Implementation of hasher_t.get_state
+ */
+static chunk_t get_state(private_sha1_hasher_t *this)
+{
+ chunk_t chunk;
+
+ chunk.ptr = (u_char*)&this->state[0];
+ chunk.len = sizeof(this->state);
+
+ return chunk;
+}
+
/**
* Implementation of hasher_t.destroy.
*/
@@ -256,6 +270,7 @@ sha1_hasher_t *sha1_hasher_create(void)
this->public.hasher_interface.allocate_hash = (void (*) (hasher_t*, chunk_t, chunk_t*))allocate_hash;
this->public.hasher_interface.get_hash_size = (size_t (*) (hasher_t*))get_hash_size;
this->public.hasher_interface.reset = (void (*) (hasher_t*))reset;
+ this->public.hasher_interface.get_state = (chunk_t (*) (hasher_t*))get_state;
this->public.hasher_interface.destroy = (void (*) (hasher_t*))destroy;
/* initialize */