Increase the size of the buffer passed to EVP_DigestFinal_ex, and make size and output parameter.