diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/ec/ec_convert.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/lib/libcrypto/ec/ec_convert.c b/src/lib/libcrypto/ec/ec_convert.c index a151850f46..3fdbaf3ce7 100644 --- a/src/lib/libcrypto/ec/ec_convert.c +++ b/src/lib/libcrypto/ec/ec_convert.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_convert.c,v 1.6 2024/10/31 05:03:57 tb Exp $ */ | 1 | /* $OpenBSD: ec_convert.c,v 1.7 2024/10/31 15:37:53 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -218,8 +218,8 @@ ec_oct_get_field_element_cbs(CBS *cbs, const EC_GROUP *group, BIGNUM *bn) | |||
218 | return 1; | 218 | return 1; |
219 | } | 219 | } |
220 | 220 | ||
221 | size_t | 221 | static size_t |
222 | ec_GFp_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, | 222 | ec_oct_point2oct(const EC_GROUP *group, const EC_POINT *point, |
223 | point_conversion_form_t conversion_form, unsigned char *buf, size_t len, | 223 | point_conversion_form_t conversion_form, unsigned char *buf, size_t len, |
224 | BN_CTX *ctx) | 224 | BN_CTX *ctx) |
225 | { | 225 | { |
@@ -308,8 +308,8 @@ ec_GFp_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, | |||
308 | return ret; | 308 | return ret; |
309 | } | 309 | } |
310 | 310 | ||
311 | int | 311 | static int |
312 | ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, | 312 | ec_oct_oct2point(const EC_GROUP *group, EC_POINT *point, |
313 | const unsigned char *buf, size_t len, BN_CTX *ctx) | 313 | const unsigned char *buf, size_t len, BN_CTX *ctx) |
314 | { | 314 | { |
315 | CBS cbs; | 315 | CBS cbs; |
@@ -447,15 +447,11 @@ EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, | |||
447 | if (ctx == NULL) | 447 | if (ctx == NULL) |
448 | goto err; | 448 | goto err; |
449 | 449 | ||
450 | if (group->meth->point2oct == NULL) { | ||
451 | ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
452 | goto err; | ||
453 | } | ||
454 | if (group->meth != point->meth) { | 450 | if (group->meth != point->meth) { |
455 | ECerror(EC_R_INCOMPATIBLE_OBJECTS); | 451 | ECerror(EC_R_INCOMPATIBLE_OBJECTS); |
456 | goto err; | 452 | goto err; |
457 | } | 453 | } |
458 | ret = group->meth->point2oct(group, point, form, buf, len, ctx); | 454 | ret = ec_oct_point2oct(group, point, form, buf, len, ctx); |
459 | 455 | ||
460 | err: | 456 | err: |
461 | if (ctx != ctx_in) | 457 | if (ctx != ctx_in) |
@@ -477,15 +473,11 @@ EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, | |||
477 | if (ctx == NULL) | 473 | if (ctx == NULL) |
478 | goto err; | 474 | goto err; |
479 | 475 | ||
480 | if (group->meth->oct2point == NULL) { | ||
481 | ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
482 | goto err; | ||
483 | } | ||
484 | if (group->meth != point->meth) { | 476 | if (group->meth != point->meth) { |
485 | ECerror(EC_R_INCOMPATIBLE_OBJECTS); | 477 | ECerror(EC_R_INCOMPATIBLE_OBJECTS); |
486 | goto err; | 478 | goto err; |
487 | } | 479 | } |
488 | ret = group->meth->oct2point(group, point, buf, len, ctx); | 480 | ret = ec_oct_oct2point(group, point, buf, len, ctx); |
489 | 481 | ||
490 | err: | 482 | err: |
491 | if (ctx != ctx_in) | 483 | if (ctx != ctx_in) |