diff options
| author | tb <> | 2023-07-05 17:10:10 +0000 |
|---|---|---|
| committer | tb <> | 2023-07-05 17:10:10 +0000 |
| commit | 89d66d14133ec6290072fa2c672a92821b4dc097 (patch) | |
| tree | be7dc4e8b1becfb90622fefb3c36d1fdf7944ecd /src/lib/libcrypto/ecdh | |
| parent | 83dc6d5723e9e90220d97b03404c734cc9b8b6ac (diff) | |
| download | openbsd-89d66d14133ec6290072fa2c672a92821b4dc097.tar.gz openbsd-89d66d14133ec6290072fa2c672a92821b4dc097.tar.bz2 openbsd-89d66d14133ec6290072fa2c672a92821b4dc097.zip | |
Mop up last uses of ECDHerror() and ECDSAerror()
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ecdh')
| -rw-r--r-- | src/lib/libcrypto/ecdh/ecdh.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ecdh/ecdh.c b/src/lib/libcrypto/ecdh/ecdh.c index d0486777e3..1179564030 100644 --- a/src/lib/libcrypto/ecdh/ecdh.c +++ b/src/lib/libcrypto/ecdh/ecdh.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ecdh.c,v 1.2 2023/07/05 14:39:05 tb Exp $ */ | 1 | /* $OpenBSD: ecdh.c,v 1.3 2023/07/05 17:10:10 tb Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
| 4 | * | 4 | * |
| @@ -187,7 +187,7 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh | |||
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | if ((priv_key = EC_KEY_get0_private_key(ecdh)) == NULL) { | 189 | if ((priv_key = EC_KEY_get0_private_key(ecdh)) == NULL) { |
| 190 | ECDHerror(ECDH_R_NO_PRIVATE_VALUE); | 190 | ECerror(EC_R_MISSING_PRIVATE_KEY); |
| 191 | goto err; | 191 | goto err; |
| 192 | } | 192 | } |
| 193 | 193 | ||
| @@ -204,12 +204,12 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh | |||
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | if (!EC_POINT_mul(group, point, NULL, pub_key, priv_key, ctx)) { | 206 | if (!EC_POINT_mul(group, point, NULL, pub_key, priv_key, ctx)) { |
| 207 | ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE); | 207 | ECerror(EC_R_POINT_ARITHMETIC_FAILURE); |
| 208 | goto err; | 208 | goto err; |
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | if (!EC_POINT_get_affine_coordinates(group, point, x, NULL, ctx)) { | 211 | if (!EC_POINT_get_affine_coordinates(group, point, x, NULL, ctx)) { |
| 212 | ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE); | 212 | ECerror(EC_R_POINT_ARITHMETIC_FAILURE); |
| 213 | goto err; | 213 | goto err; |
| 214 | } | 214 | } |
| 215 | 215 | ||
| @@ -219,7 +219,7 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh | |||
| 219 | } | 219 | } |
| 220 | if (KDF == NULL && outlen < buflen) { | 220 | if (KDF == NULL && outlen < buflen) { |
| 221 | /* The resulting key would be truncated. */ | 221 | /* The resulting key would be truncated. */ |
| 222 | ECDHerror(ECDH_R_KEY_TRUNCATION); | 222 | ECerror(EC_R_KEY_TRUNCATION); |
| 223 | goto err; | 223 | goto err; |
| 224 | } | 224 | } |
| 225 | if ((buf = malloc(buflen)) == NULL) { | 225 | if ((buf = malloc(buflen)) == NULL) { |
| @@ -233,7 +233,7 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh | |||
| 233 | 233 | ||
| 234 | if (KDF != NULL) { | 234 | if (KDF != NULL) { |
| 235 | if (KDF(buf, buflen, out, &outlen) == NULL) { | 235 | if (KDF(buf, buflen, out, &outlen) == NULL) { |
| 236 | ECDHerror(ECDH_R_KDF_FAILED); | 236 | ECerror(EC_R_KDF_FAILED); |
| 237 | goto err; | 237 | goto err; |
| 238 | } | 238 | } |
| 239 | } else { | 239 | } else { |
