summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-03-25 09:23:45 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-03-25 09:23:45 +0000
commitb535ad7c4d0e73913582ce6b8ef4d70adc0fd203 (patch)
tree8fa2bf1e2cef00356d480e9ba7e7b50972372af1
parent5382e59f23221e766c627040bfb8f8b95d392098 (diff)
Guard GF2m-specifics with OPENSSL_NO_EC2M
-rw-r--r--regress/lib/libcrypto/ec/ec_point_conversion.c9
1 files 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 <tb@openbsd.org>
* Copyright (c) 2021 Joel Sing <jsing@openbsd.org>
@@ -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;