Make sure HMAC_Init is called before HMAC_Update, fixes crash
This commit is contained in:
1 parent
ae4411547a
commit
9138f49e6a
1 file changed
+5
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user