summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-10-18 19:58:43 +0000
committertb <>2024-10-18 19:58:43 +0000
commite8d9d1cdb37b905cf9c7775e50cac994a4b16be0 (patch)
treee23e1b5ba7cdb7ab62884c69169cc336d8007d80 /src
parent78eb5b882cac45cd24460fa3569aa965475abe1c (diff)
downloadopenbsd-e8d9d1cdb37b905cf9c7775e50cac994a4b16be0.tar.gz
openbsd-e8d9d1cdb37b905cf9c7775e50cac994a4b16be0.tar.bz2
openbsd-e8d9d1cdb37b905cf9c7775e50cac994a4b16be0.zip
ec_asn1_test: simplify previous
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/ec/ec_asn1_test.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/regress/lib/libcrypto/ec/ec_asn1_test.c b/src/regress/lib/libcrypto/ec/ec_asn1_test.c
index 86f694b848..aaff4aa11f 100644
--- a/src/regress/lib/libcrypto/ec/ec_asn1_test.c
+++ b/src/regress/lib/libcrypto/ec/ec_asn1_test.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_asn1_test.c,v 1.12 2024/10/18 19:55:34 tb Exp $ */ 1/* $OpenBSD: ec_asn1_test.c,v 1.13 2024/10/18 19:58:43 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2024 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2024 Theo Buehler <tb@openbsd.org>
@@ -287,8 +287,7 @@ static int
287ec_group_roundtrip_builtin_curve(const EC_builtin_curve *curve) 287ec_group_roundtrip_builtin_curve(const EC_builtin_curve *curve)
288{ 288{
289 EC_GROUP *group = NULL; 289 EC_GROUP *group = NULL;
290 int failed = 0; 290 int failed = 1;
291 int ret = 0;
292 291
293 if ((group = EC_GROUP_new_by_curve_name(curve->nid)) == NULL) 292 if ((group = EC_GROUP_new_by_curve_name(curve->nid)) == NULL)
294 errx(1, "failed to instantiate curve %d", curve->nid); 293 errx(1, "failed to instantiate curve %d", curve->nid);
@@ -309,6 +308,8 @@ ec_group_roundtrip_builtin_curve(const EC_builtin_curve *curve)
309 goto err; 308 goto err;
310 } 309 }
311 310
311 failed = 0;
312
312 failed |= ec_group_roundtrip_curve(group, "named", curve->nid); 313 failed |= ec_group_roundtrip_curve(group, "named", curve->nid);
313 314
314 EC_GROUP_set_asn1_flag(group, 0); 315 EC_GROUP_set_asn1_flag(group, 0);
@@ -320,11 +321,7 @@ ec_group_roundtrip_builtin_curve(const EC_builtin_curve *curve)
320 EC_GROUP_set_point_conversion_form(group, POINT_CONVERSION_HYBRID); 321 EC_GROUP_set_point_conversion_form(group, POINT_CONVERSION_HYBRID);
321 failed |= ec_group_roundtrip_curve(group, "hybrid", curve->nid); 322 failed |= ec_group_roundtrip_curve(group, "hybrid", curve->nid);
322 323
323 ret = 1;
324
325 err: 324 err:
326 failed |= ret == 0;
327
328 EC_GROUP_free(group); 325 EC_GROUP_free(group);
329 326
330 return failed; 327 return failed;