From 435d593c3e33253a8eff679a6f1f392235d820dd Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 18 Oct 2024 19:58:43 +0000 Subject: [PATCH] ec_asn1_test: simplify previous --- regress/lib/libcrypto/ec/ec_asn1_test.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/regress/lib/libcrypto/ec/ec_asn1_test.c b/regress/lib/libcrypto/ec/ec_asn1_test.c index 86f694b8485..aaff4aa11f6 100644 --- a/regress/lib/libcrypto/ec/ec_asn1_test.c +++ b/regress/lib/libcrypto/ec/ec_asn1_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_asn1_test.c,v 1.12 2024/10/18 19:55:34 tb Exp $ */ +/* $OpenBSD: ec_asn1_test.c,v 1.13 2024/10/18 19:58:43 tb Exp $ */ /* * Copyright (c) 2017, 2021 Joel Sing * Copyright (c) 2024 Theo Buehler @@ -287,8 +287,7 @@ static int ec_group_roundtrip_builtin_curve(const EC_builtin_curve *curve) { EC_GROUP *group = NULL; - int failed = 0; - int ret = 0; + int failed = 1; if ((group = EC_GROUP_new_by_curve_name(curve->nid)) == NULL) errx(1, "failed to instantiate curve %d", curve->nid); @@ -309,6 +308,8 @@ ec_group_roundtrip_builtin_curve(const EC_builtin_curve *curve) goto err; } + failed = 0; + failed |= ec_group_roundtrip_curve(group, "named", curve->nid); EC_GROUP_set_asn1_flag(group, 0); @@ -320,11 +321,7 @@ ec_group_roundtrip_builtin_curve(const EC_builtin_curve *curve) EC_GROUP_set_point_conversion_form(group, POINT_CONVERSION_HYBRID); failed |= ec_group_roundtrip_curve(group, "hybrid", curve->nid); - ret = 1; - err: - failed |= ret == 0; - EC_GROUP_free(group); return failed; -- 2.20.1