Minor optimisation to KDF algorithm.

Don't need to use temporary buffer if remaining length equals digest length.
(cherry picked from commit 3f6b6f0b8c)
This commit is contained in:
Dr. Stephen Henson 2013-08-01 15:48:44 +01:00
parent 5c4ff8ad37
commit ecf9ceb90d

View file

@ -90,7 +90,7 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
goto err;
if (!EVP_DigestUpdate(&mctx, sinfo, sinfolen))
goto err;
if (outlen > mdlen)
if (outlen >= mdlen)
{
if (!EVP_DigestFinal(&mctx, out, NULL))
goto err;