summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-07-01 15:03:05 +0000
committertb <>2023-07-01 15:03:05 +0000
commita1bff4f255d24c1c0d89754a0bd9bd5f111100b8 (patch)
treec39e08b7b5c02b09f193280abb6b952de5eb81e9
parent219f0b07279a03e1a7dae34072df1b15ffc8ffb1 (diff)
downloadopenbsd-a1bff4f255d24c1c0d89754a0bd9bd5f111100b8.tar.gz
openbsd-a1bff4f255d24c1c0d89754a0bd9bd5f111100b8.tar.bz2
openbsd-a1bff4f255d24c1c0d89754a0bd9bd5f111100b8.zip
tmp is a silly name for a point on an elliptic curve
-rw-r--r--src/lib/libcrypto/ecdh/ech_key.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c
index 7d4fba76fe..a5b27f9b55 100644
--- a/src/lib/libcrypto/ecdh/ech_key.c
+++ b/src/lib/libcrypto/ecdh/ech_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ech_key.c,v 1.26 2023/07/01 14:57:51 tb Exp $ */ 1/* $OpenBSD: ech_key.c,v 1.27 2023/07/01 15:03:05 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -93,7 +93,7 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
93 void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)) 93 void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen))
94{ 94{
95 BN_CTX *ctx; 95 BN_CTX *ctx;
96 EC_POINT *tmp = NULL; 96 EC_POINT *point = NULL;
97 BIGNUM *x; 97 BIGNUM *x;
98 const BIGNUM *priv_key; 98 const BIGNUM *priv_key;
99 const EC_GROUP* group; 99 const EC_GROUP* group;
@@ -126,17 +126,17 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
126 if (!EC_POINT_is_on_curve(group, pub_key, ctx)) 126 if (!EC_POINT_is_on_curve(group, pub_key, ctx))
127 goto err; 127 goto err;
128 128
129 if ((tmp = EC_POINT_new(group)) == NULL) { 129 if ((point = EC_POINT_new(group)) == NULL) {
130 ECDHerror(ERR_R_MALLOC_FAILURE); 130 ECDHerror(ERR_R_MALLOC_FAILURE);
131 goto err; 131 goto err;
132 } 132 }
133 133
134 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { 134 if (!EC_POINT_mul(group, point, NULL, pub_key, priv_key, ctx)) {
135 ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE); 135 ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE);
136 goto err; 136 goto err;
137 } 137 }
138 138
139 if (!EC_POINT_get_affine_coordinates(group, tmp, x, NULL, ctx)) { 139 if (!EC_POINT_get_affine_coordinates(group, point, x, NULL, ctx)) {
140 ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE); 140 ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE);
141 goto err; 141 goto err;
142 } 142 }
@@ -175,7 +175,7 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
175 175
176 ret = outlen; 176 ret = outlen;
177 err: 177 err:
178 EC_POINT_free(tmp); 178 EC_POINT_free(point);
179 BN_CTX_end(ctx); 179 BN_CTX_end(ctx);
180 BN_CTX_free(ctx); 180 BN_CTX_free(ctx);
181 free(buf); 181 free(buf);