Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Smith <brian@briansmith.org>2015-10-09 00:52:56 +0300
committerAdam Langley <alangley@gmail.com>2015-10-27 20:00:25 +0300
commit0dc2a8aee26d8223005fe9b5bf6c86d63f4a15f9 (patch)
treed0ea3628fae26ef2b18f6abf4f42fb1d0dfa0cb2 /include/openssl/ecdh.h
parent274341dd6e61b11c2b3f1dd208a28c83a2315914 (diff)
Clean up |ECDH_compute_key|.
1. Check for the presence of the private key before allocating or computing anything. 2. Check the return value of |BN_CTX_get|. 3. Don't bother computing the Y coordinate since it is not used. 4. Remove conditional logic in cleanup section. Change-Id: I4d8611603363c7e5d16a8e9f1d6c3a56809f27ae Reviewed-on: https://boringssl-review.googlesource.com/6171 Reviewed-by: Adam Langley <alangley@gmail.com>
Diffstat (limited to 'include/openssl/ecdh.h')
-rw-r--r--include/openssl/ecdh.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/openssl/ecdh.h b/include/openssl/ecdh.h
index 878cbeb5..5fe3ae99 100644
--- a/include/openssl/ecdh.h
+++ b/include/openssl/ecdh.h
@@ -80,14 +80,14 @@ extern "C" {
/* ECDH_compute_key calculates the shared key between |pub_key| and |priv_key|.
- * If |KDF| is not NULL, then it is called with the bytes of the shared key and
- * the parameter |out|. When |KDF| returns, the value of |*outlen| becomes the
+ * If |kdf| is not NULL, then it is called with the bytes of the shared key and
+ * the parameter |out|. When |kdf| returns, the value of |*outlen| becomes the
* return value. Otherwise, as many bytes of the shared key as will fit are
* copied directly to, at most, |outlen| bytes at |out|. It returns the number
* of bytes written to |out|, or -1 on error. */
OPENSSL_EXPORT int ECDH_compute_key(void *out, size_t outlen,
const EC_POINT *pub_key, EC_KEY *priv_key,
- void *(*KDF)(const void *in, size_t inlen,
+ void *(*kdf)(const void *in, size_t inlen,
void *out, size_t *outlen));