summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-03-25 09:23:44 +0000
committertb <>2023-03-25 09:23:44 +0000
commit9de6378e539579d6752bf5371a73e7438ee67510 (patch)
treeffbfa6101aefbfcc87d2e4630430fd69f60c084d
parentab8c5d8bdf12f2d8df1e88ab3c133c69cd718328 (diff)
downloadopenbsd-9de6378e539579d6752bf5371a73e7438ee67510.tar.gz
openbsd-9de6378e539579d6752bf5371a73e7438ee67510.tar.bz2
openbsd-9de6378e539579d6752bf5371a73e7438ee67510.zip
Guard GF2m-specifics with OPENSSL_NO_EC2M
-rw-r--r--src/regress/lib/libcrypto/ec/ec_point_conversion.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/regress/lib/libcrypto/ec/ec_point_conversion.c b/src/regress/lib/libcrypto/ec/ec_point_conversion.c
index 04177a0e87..a32bdbda43 100644
--- a/src/regress/lib/libcrypto/ec/ec_point_conversion.c
+++ b/src/regress/lib/libcrypto/ec/ec_point_conversion.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_point_conversion.c,v 1.7 2022/12/01 13:49:12 tb Exp $ */ 1/* $OpenBSD: ec_point_conversion.c,v 1.8 2023/03/25 09:23:44 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2021 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2021 Theo Buehler <tb@openbsd.org>
4 * Copyright (c) 2021 Joel Sing <jsing@openbsd.org> 4 * 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)
109 return failed; 109 return failed;
110} 110}
111 111
112#ifndef OPENSSL_NO_EC2M
112static int 113static int
113test_hybrid_corner_case(void) 114test_hybrid_corner_case(void)
114{ 115{
@@ -143,6 +144,7 @@ test_hybrid_corner_case(void)
143 144
144 return failed; 145 return failed;
145} 146}
147#endif
146 148
147/* XXX This only tests multiples of the generator for now... */ 149/* XXX This only tests multiples of the generator for now... */
148static int 150static int
@@ -242,6 +244,7 @@ static const struct point_conversion {
242 uint8_t octets_len; 244 uint8_t octets_len;
243 int valid; 245 int valid;
244} point_conversions[] = { 246} point_conversions[] = {
247#ifndef OPENSSL_NO_EC2M
245 { 248 {
246 .description = "point at infinity on sect571k1", 249 .description = "point at infinity on sect571k1",
247 .nid = NID_sect571k1, 250 .nid = NID_sect571k1,
@@ -549,7 +552,7 @@ static const struct point_conversion {
549 .octets_len = 145, 552 .octets_len = 145,
550 .valid = 0, 553 .valid = 0,
551 }, 554 },
552 555#endif
553 { 556 {
554 .description = "point at infinity on secp256r1", 557 .description = "point at infinity on secp256r1",
555 .nid = NID_X9_62_prime256v1, 558 .nid = NID_X9_62_prime256v1,
@@ -880,7 +883,9 @@ main(int argc, char **argv)
880 int failed = 0; 883 int failed = 0;
881 884
882 failed |= test_random_points(); 885 failed |= test_random_points();
886#ifndef OPENSSL_NO_EC2M
883 failed |= test_hybrid_corner_case(); 887 failed |= test_hybrid_corner_case();
888#endif
884 failed |= test_point_conversions(); 889 failed |= test_point_conversions();
885 890
886 return failed; 891 return failed;