diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2013-08-01 15:48:44 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2013-10-01 14:01:18 +0100 |
commit | ecf9ceb90dbc28a34cdad2f0b0c2b73c3ae628f6 (patch) | |
tree | 9e93b2f71d6e85e62999c59e77f6a641b8e2bd21 /crypto/ecdh | |
parent | 5c4ff8ad37302e982edbb405f810492350885060 (diff) |
Minor optimisation to KDF algorithm.
Don't need to use temporary buffer if remaining length equals digest length.
(cherry picked from commit 3f6b6f0b8cbd7173b6c007b07caa6ec34cda08c5)
Diffstat (limited to 'crypto/ecdh')
-rw-r--r-- | crypto/ecdh/ech_kdf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/ecdh/ech_kdf.c b/crypto/ecdh/ech_kdf.c index 84bf108b90..848b91745f 100644 --- a/crypto/ecdh/ech_kdf.c +++ b/crypto/ecdh/ech_kdf.c @@ -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; |