aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/crypto/hashers/md5_hasher.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/crypto/hashers/md5_hasher.c')
-rw-r--r--src/libstrongswan/crypto/hashers/md5_hasher.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstrongswan/crypto/hashers/md5_hasher.c b/src/libstrongswan/crypto/hashers/md5_hasher.c
index fa61cac5b..5330676d4 100644
--- a/src/libstrongswan/crypto/hashers/md5_hasher.c
+++ b/src/libstrongswan/crypto/hashers/md5_hasher.c
@@ -364,6 +364,19 @@ static void reset(private_md5_hasher_t *this)
}
/**
+ * Implementation of hasher_t.get_state
+ */
+static chunk_t get_state(private_md5_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.
*/
static void destroy(private_md5_hasher_t *this)
@@ -382,6 +395,7 @@ md5_hasher_t *md5_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 */