aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/openssl/openssl_hasher.c
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/openssl/openssl_hasher.c
parent87dd205b61ae8c0125b459959fcc7349fa27bb74 (diff)
downloadstrongswan-e3b2e900e635f13b783131e088ec17265c1186fe.tar.bz2
strongswan-e3b2e900e635f13b783131e088ec17265c1186fe.tar.xz
Add a return value to hasher_t.reset()
Diffstat (limited to 'src/libstrongswan/plugins/openssl/openssl_hasher.c')
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_hasher.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_hasher.c b/src/libstrongswan/plugins/openssl/openssl_hasher.c
index 67b49c186..bf5ff1f27 100644
--- a/src/libstrongswan/plugins/openssl/openssl_hasher.c
+++ b/src/libstrongswan/plugins/openssl/openssl_hasher.c
@@ -96,10 +96,10 @@ METHOD(hasher_t, get_hash_size, size_t,
return this->hasher->md_size;
}
-METHOD(hasher_t, reset, void,
+METHOD(hasher_t, reset, bool,
private_openssl_hasher_t *this)
{
- EVP_DigestInit_ex(this->ctx, this->hasher, NULL);
+ return EVP_DigestInit_ex(this->ctx, this->hasher, NULL) == 1;
}
METHOD(hasher_t, get_hash, bool,
@@ -115,7 +115,7 @@ METHOD(hasher_t, get_hash, bool,
{
return FALSE;
}
- reset(this);
+ return reset(this);
}
return TRUE;
}
@@ -175,7 +175,11 @@ openssl_hasher_t *openssl_hasher_create(hash_algorithm_t algo)
this->ctx = EVP_MD_CTX_create();
/* initialization */
- reset(this);
+ if (!reset(this))
+ {
+ destroy(this);
+ return NULL;
+ }
return &this->public;
}