From b567b8b60d2a8021e06cc33d2fee8b1cf180eac5 Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 20 Apr 2021 17:23:37 +0000 Subject: Simplify code after adding EC_POINT_{s,g}et_affine_coordinates() ok jsing --- src/lib/libcrypto/ecdsa/ecs_ossl.c | 41 ++++++++------------------------------ 1 file changed, 8 insertions(+), 33 deletions(-) (limited to 'src/lib/libcrypto/ecdsa/ecs_ossl.c') diff --git a/src/lib/libcrypto/ecdsa/ecs_ossl.c b/src/lib/libcrypto/ecdsa/ecs_ossl.c index aa97a3ad73..e7e7a52665 100644 --- a/src/lib/libcrypto/ecdsa/ecs_ossl.c +++ b/src/lib/libcrypto/ecdsa/ecs_ossl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecs_ossl.c,v 1.21 2021/04/20 17:16:38 tb Exp $ */ +/* $OpenBSD: ecs_ossl.c,v 1.22 2021/04/20 17:23:37 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -205,23 +205,11 @@ ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) ECDSAerror(ERR_R_EC_LIB); goto err; } - if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == - NID_X9_62_prime_field) { - if (!EC_POINT_get_affine_coordinates(group, point, - X, NULL, ctx)) { - ECDSAerror(ERR_R_EC_LIB); - goto err; - } - } -#ifndef OPENSSL_NO_EC2M - else { /* NID_X9_62_characteristic_two_field */ - if (!EC_POINT_get_affine_coordinates(group, point, - X, NULL, ctx)) { - ECDSAerror(ERR_R_EC_LIB); - goto err; - } + if (!EC_POINT_get_affine_coordinates(group, point, X, NULL, + ctx)) { + ECDSAerror(ERR_R_EC_LIB); + goto err; } -#endif if (!BN_nnmod(r, X, order, ctx)) { ECDSAerror(ERR_R_BN_LIB); goto err; @@ -521,23 +509,10 @@ ecdsa_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, ECDSAerror(ERR_R_EC_LIB); goto err; } - if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == - NID_X9_62_prime_field) { - if (!EC_POINT_get_affine_coordinates(group, point, X, NULL, - ctx)) { - ECDSAerror(ERR_R_EC_LIB); - goto err; - } - } -#ifndef OPENSSL_NO_EC2M - else { /* NID_X9_62_characteristic_two_field */ - if (!EC_POINT_get_affine_coordinates(group, point, X, NULL, - ctx)) { - ECDSAerror(ERR_R_EC_LIB); - goto err; - } + if (!EC_POINT_get_affine_coordinates(group, point, X, NULL, ctx)) { + ECDSAerror(ERR_R_EC_LIB); + goto err; } -#endif if (!BN_nnmod(u1, X, order, ctx)) { ECDSAerror(ERR_R_BN_LIB); goto err; -- cgit v1.2.3-55-g6feb