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>
Mon, 5 Aug 2013 14:45:00 +0000 (15:45 +0100)
Don't need to use temporary buffer if remaining length equals digest length.

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;