]> granicus.if.org Git - openssl/commitdiff
Minor optimisation to KDF algorithm.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 1 Aug 2013 14:48:44 +0000 (15:48 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 1 Oct 2013 13:01:18 +0000 (14:01 +0100)
Don't need to use temporary buffer if remaining length equals digest length.
(cherry picked from commit 3f6b6f0b8cbd7173b6c007b07caa6ec34cda08c5)

crypto/ecdh/ech_kdf.c

index 84bf108b9034fdaa37d93a57602166ec3c685e2f..848b91745f575e6dda917ede0a4b6fcc020adffe 100644 (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;