From 182955b378782dc8f2f72d55d17d47fe2ba4b7dd Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 25 Mar 2023 09:23:44 +0000 Subject: [PATCH] Guard GF2m-specifics with OPENSSL_NO_EC2M --- regress/lib/libcrypto/ec/ec_point_conversion.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/regress/lib/libcrypto/ec/ec_point_conversion.c b/regress/lib/libcrypto/ec/ec_point_conversion.c index 04177a0e87e..a32bdbda434 100644 --- a/regress/lib/libcrypto/ec/ec_point_conversion.c +++ b/regress/lib/libcrypto/ec/ec_point_conversion.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_point_conversion.c,v 1.7 2022/12/01 13:49:12 tb Exp $ */ +/* $OpenBSD: ec_point_conversion.c,v 1.8 2023/03/25 09:23:44 tb Exp $ */ /* * Copyright (c) 2021 Theo Buehler * Copyright (c) 2021 Joel Sing @@ -109,6 +109,7 @@ roundtrip(EC_GROUP *group, EC_POINT *point, int form, BIGNUM *x, BIGNUM *y) return failed; } +#ifndef OPENSSL_NO_EC2M static int test_hybrid_corner_case(void) { @@ -143,6 +144,7 @@ test_hybrid_corner_case(void) return failed; } +#endif /* XXX This only tests multiples of the generator for now... */ static int @@ -242,6 +244,7 @@ static const struct point_conversion { uint8_t octets_len; int valid; } point_conversions[] = { +#ifndef OPENSSL_NO_EC2M { .description = "point at infinity on sect571k1", .nid = NID_sect571k1, @@ -549,7 +552,7 @@ static const struct point_conversion { .octets_len = 145, .valid = 0, }, - +#endif { .description = "point at infinity on secp256r1", .nid = NID_X9_62_prime256v1, @@ -880,7 +883,9 @@ main(int argc, char **argv) int failed = 0; failed |= test_random_points(); +#ifndef OPENSSL_NO_EC2M failed |= test_hybrid_corner_case(); +#endif failed |= test_point_conversions(); return failed; -- 2.20.1