Reviewed-by: Paul Yang <yang.yang@baishancloud.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7106)
(cherry picked from commit
64ed55ab033f1bfa795d46f0ecc61c313204b418)
unsigned char *okm, size_t okm_len)
{
HMAC_CTX *hmac;
+ unsigned char *ret = NULL;
unsigned int i;
done_len += copy_len;
}
-
- HMAC_CTX_free(hmac);
- return okm;
+ ret = okm;
err:
+ OPENSSL_cleanse(prev, sizeof(prev));
HMAC_CTX_free(hmac);
- return NULL;
+ return ret;
}