diff options
| author | tb <> | 2023-07-28 09:28:37 +0000 |
|---|---|---|
| committer | tb <> | 2023-07-28 09:28:37 +0000 |
| commit | c043ade63ba3d45eacfb953347c00f0988397d9a (patch) | |
| tree | 7caeb4b66ea3545dbbf75224b3b77f6e29ea4f22 /src/lib/libcrypto/ec/ec_kmeth.c | |
| parent | 2d27f5ba745b8f5de6e3e827829699607f11a54f (diff) | |
| download | openbsd-c043ade63ba3d45eacfb953347c00f0988397d9a.tar.gz openbsd-c043ade63ba3d45eacfb953347c00f0988397d9a.tar.bz2 openbsd-c043ade63ba3d45eacfb953347c00f0988397d9a.zip | |
Move KDF handling to ECDH_compute_key()
In OpenSSL e2285d87, the KDF handling was moved from the compute_key()
method into the public API. A consequence of this change is that the
ECDH_compute_key() API no longer returns -1 for some errors. Existing
checks for <= 0 are safe as are those checking for the exact length as
return value, which is all what the ecosystem seems to be doing.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec_kmeth.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_kmeth.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ec/ec_kmeth.c b/src/lib/libcrypto/ec/ec_kmeth.c index 3e997f8a5e..38aca0028e 100644 --- a/src/lib/libcrypto/ec/ec_kmeth.c +++ b/src/lib/libcrypto/ec/ec_kmeth.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_kmeth.c,v 1.11 2023/07/07 13:54:45 beck Exp $ */ | 1 | /* $OpenBSD: ec_kmeth.c,v 1.12 2023/07/28 09:28:37 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 4 | * project. | 4 | * project. |
| @@ -238,8 +238,8 @@ LCRYPTO_ALIAS(EC_KEY_METHOD_set_keygen); | |||
| 238 | 238 | ||
| 239 | void | 239 | void |
| 240 | EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth, | 240 | EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth, |
| 241 | int (*ckey)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, | 241 | int (*ckey)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key, |
| 242 | void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))) | 242 | const EC_KEY *ecdh)) |
| 243 | { | 243 | { |
| 244 | meth->compute_key = ckey; | 244 | meth->compute_key = ckey; |
| 245 | } | 245 | } |
| @@ -310,8 +310,8 @@ LCRYPTO_ALIAS(EC_KEY_METHOD_get_keygen); | |||
| 310 | 310 | ||
| 311 | void | 311 | void |
| 312 | EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, | 312 | EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, |
| 313 | int (**pck)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, | 313 | int (**pck)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key, |
| 314 | void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))) | 314 | const EC_KEY *ecdh)) |
| 315 | { | 315 | { |
| 316 | if (pck != NULL) | 316 | if (pck != NULL) |
| 317 | *pck = meth->compute_key; | 317 | *pck = meth->compute_key; |
