summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-10-18 17:29:24 +0000
committertb <>2024-10-18 17:29:24 +0000
commit2df019274e47fee92f671fabf664648e1d0f3e42 (patch)
tree2654127a924ae66627fae30c41e9c2fdc7b75517 /src
parentd0a0731baa6c11e828c6eaf5bad6b696b7970bcc (diff)
downloadopenbsd-2df019274e47fee92f671fabf664648e1d0f3e42.tar.gz
openbsd-2df019274e47fee92f671fabf664648e1d0f3e42.tar.bz2
openbsd-2df019274e47fee92f671fabf664648e1d0f3e42.zip
ec_asn1_test: adjust for rejection of non-builtin curve parameters
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/ec/ec_asn1_test.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/regress/lib/libcrypto/ec/ec_asn1_test.c b/src/regress/lib/libcrypto/ec/ec_asn1_test.c
index e5e899264d..646350b834 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.10 2024/10/18 10:40:31 tb Exp $ */ 1/* $OpenBSD: ec_asn1_test.c,v 1.11 2024/10/18 17:29:24 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>
@@ -834,9 +834,9 @@ ec_group_non_builtin_curve(const struct curve *curve, const EC_METHOD *method,
834 } 834 }
835 835
836 ERR_clear_error(); 836 ERR_clear_error();
837
837 pder = curve->param; 838 pder = curve->param;
838 der_len = curve->param_len; 839 der_len = curve->param_len;
839#if 0
840 if ((new_group = d2i_ECPKParameters(NULL, &pder, der_len)) != NULL) { 840 if ((new_group = d2i_ECPKParameters(NULL, &pder, der_len)) != NULL) {
841 fprintf(stderr, "FAIL: managed to decode non-builtin parameters %s\n", 841 fprintf(stderr, "FAIL: managed to decode non-builtin parameters %s\n",
842 curve->descr); 842 curve->descr);
@@ -849,18 +849,6 @@ ec_group_non_builtin_curve(const struct curve *curve, const EC_METHOD *method,
849 curve->descr, EC_R_UNKNOWN_GROUP, ERR_GET_REASON(error)); 849 curve->descr, EC_R_UNKNOWN_GROUP, ERR_GET_REASON(error));
850 goto err; 850 goto err;
851 } 851 }
852#else
853 if ((new_group = d2i_ECPKParameters(NULL, &pder, der_len)) == NULL) {
854 fprintf(stderr, "FAIL: d2i_ECPKParameters(%s)\n", curve->descr);
855 goto err;
856 }
857 if (method == EC_GFp_mont_method() &&
858 EC_GROUP_cmp(group, new_group, ctx) != 0) {
859 fprintf(stderr, "FAIL: %s Weierstrass groups do not match!\n",
860 curve->descr);
861 goto err;
862 }
863#endif
864 852
865 failed = 0; 853 failed = 0;
866 854