diff options
Diffstat (limited to 'src/lib/libcrypto/ecdh')
| -rw-r--r-- | src/lib/libcrypto/ecdh/ech_key.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c index a5c6371f91..108a5ff8f6 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.14 2022/11/26 16:08:52 tb Exp $ */ | 1 | /* $OpenBSD: ech_key.c,v 1.15 2023/06/25 18:41:36 tb Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
| 4 | * | 4 | * |
| @@ -81,10 +81,6 @@ | |||
| 81 | #include "ech_local.h" | 81 | #include "ech_local.h" |
| 82 | #include "ec_local.h" | 82 | #include "ec_local.h" |
| 83 | 83 | ||
| 84 | static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key, | ||
| 85 | EC_KEY *ecdh, | ||
| 86 | void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)); | ||
| 87 | |||
| 88 | /* | 84 | /* |
| 89 | * This implementation is based on the following primitives in the IEEE 1363 | 85 | * This implementation is based on the following primitives in the IEEE 1363 |
| 90 | * standard: | 86 | * standard: |
| @@ -92,8 +88,8 @@ static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key, | |||
| 92 | * - ECSVDP-DH | 88 | * - ECSVDP-DH |
| 93 | * Finally an optional KDF is applied. | 89 | * Finally an optional KDF is applied. |
| 94 | */ | 90 | */ |
| 95 | static int | 91 | int |
| 96 | ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, | 92 | ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, |
| 97 | EC_KEY *ecdh, | 93 | EC_KEY *ecdh, |
| 98 | void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)) | 94 | void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)) |
| 99 | { | 95 | { |
| @@ -195,7 +191,7 @@ err: | |||
| 195 | 191 | ||
| 196 | static ECDH_METHOD openssl_ecdh_meth = { | 192 | static ECDH_METHOD openssl_ecdh_meth = { |
| 197 | .name = "OpenSSL ECDH method", | 193 | .name = "OpenSSL ECDH method", |
| 198 | .compute_key = ecdh_compute_key | 194 | .compute_key = ossl_ecdh_compute_key, |
| 199 | }; | 195 | }; |
| 200 | 196 | ||
| 201 | const ECDH_METHOD * | 197 | const ECDH_METHOD * |
| @@ -204,19 +200,6 @@ ECDH_OpenSSL(void) | |||
| 204 | return &openssl_ecdh_meth; | 200 | return &openssl_ecdh_meth; |
| 205 | } | 201 | } |
| 206 | 202 | ||
| 207 | /* replace w/ ecdh_compute_key() when ECDH_METHOD gets removed */ | ||
| 208 | int | ||
| 209 | ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, | ||
| 210 | EC_KEY *eckey, | ||
| 211 | void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)) | ||
| 212 | { | ||
| 213 | ECDH_DATA *ecdh; | ||
| 214 | |||
| 215 | if ((ecdh = ecdh_check(eckey)) == NULL) | ||
| 216 | return 0; | ||
| 217 | return ecdh->meth->compute_key(out, outlen, pub_key, eckey, KDF); | ||
| 218 | } | ||
| 219 | |||
| 220 | int | 203 | int |
| 221 | ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, | 204 | ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, |
| 222 | EC_KEY *eckey, | 205 | EC_KEY *eckey, |
