summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_curve.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec_curve.c')
-rw-r--r--src/lib/libcrypto/ec/ec_curve.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ec/ec_curve.c b/src/lib/libcrypto/ec/ec_curve.c
index a37f324a24..cc5ad4d4e6 100644
--- a/src/lib/libcrypto/ec/ec_curve.c
+++ b/src/lib/libcrypto/ec/ec_curve.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_curve.c,v 1.51 2024/12/04 09:50:52 tb Exp $ */ 1/* $OpenBSD: ec_curve.c,v 1.52 2024/12/06 04:35:03 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -2685,16 +2685,21 @@ ec_group_nid_from_curve(const struct ec_curve *curve)
2685} 2685}
2686 2686
2687int 2687int
2688ec_group_is_builtin_curve(const EC_GROUP *group) 2688ec_group_is_builtin_curve(const EC_GROUP *group, int *out_nid)
2689{ 2689{
2690 struct ec_curve *curve; 2690 struct ec_curve *curve;
2691 int ret = 0; 2691 int ret = 0;
2692 int nid;
2693
2694 *out_nid = NID_undef;
2692 2695
2693 if ((curve = ec_curve_from_group(group)) == NULL) 2696 if ((curve = ec_curve_from_group(group)) == NULL)
2694 goto err; 2697 goto err;
2695 if (ec_group_nid_from_curve(curve) == NID_undef) 2698 if ((nid = ec_group_nid_from_curve(curve)) == NID_undef)
2696 goto err; 2699 goto err;
2697 2700
2701 *out_nid = nid;
2702
2698 ret = 1; 2703 ret = 1;
2699 2704
2700 err: 2705 err: