diff --git a/src/libstrongswan/plugins/openssl/openssl_hmac.c b/src/libstrongswan/plugins/openssl/openssl_hmac.c index e3f44defa1..e0b9f21282 100644 --- a/src/libstrongswan/plugins/openssl/openssl_hmac.c +++ b/src/libstrongswan/plugins/openssl/openssl_hmac.c @@ -185,6 +185,12 @@ static mac_t *hmac_create(hash_algorithm_t algo) this->hmac = &this->hmac_ctx; #endif + /* make sure the underlying hash algorithm is supported */ + if (!set_key(this, chunk_from_str(""))) + { + destroy(this); + return NULL; + } return &this->public; }