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 84bf108..848b917 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;