diff options
author | tb <> | 2023-03-25 09:23:44 +0000 |
---|---|---|
committer | tb <> | 2023-03-25 09:23:44 +0000 |
commit | 9de6378e539579d6752bf5371a73e7438ee67510 (patch) | |
tree | ffbfa6101aefbfcc87d2e4630430fd69f60c084d | |
parent | ab8c5d8bdf12f2d8df1e88ab3c133c69cd718328 (diff) | |
download | openbsd-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.c | 9 |
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 | ||
112 | static int | 113 | static int |
113 | test_hybrid_corner_case(void) | 114 | test_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... */ |
148 | static int | 150 | static 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; |