aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2012-07-10 09:03:38 +0200
committerMartin Willi <martin@revosec.ch>2012-07-16 14:55:07 +0200
commit9138f49e6aa29c678f87544fd44adf7f3734d156 (patch)
tree724b2b5257e49ff4e9b636860fa9ed8ca118b4fa /src/libstrongswan/plugins
parentae4411547a3b799e588cd2900f7c5088fbe16e3a (diff)
downloadstrongswan-9138f49e.tar.bz2
strongswan-9138f49e.tar.xz
Make sure HMAC_Init is called before HMAC_Update, fixes crash
Diffstat (limited to 'src/libstrongswan/plugins')
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_hmac.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_hmac.c b/src/libstrongswan/plugins/openssl/openssl_hmac.c
index feeecf539..b027e0fc3 100644
--- a/src/libstrongswan/plugins/openssl/openssl_hmac.c
+++ b/src/libstrongswan/plugins/openssl/openssl_hmac.c
@@ -159,6 +159,11 @@ static mac_t *hmac_create(hash_algorithm_t algo)
}
HMAC_CTX_init(&this->hmac);
+ if (!HMAC_Init_ex(&this->hmac, NULL, 0, this->hasher, NULL))
+ {
+ destroy(this);
+ return NULL;
+ }
return &this->public;
}