summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_cvt.c
diff options
context:
space:
mode:
authortb <>2021-04-20 17:04:13 +0000
committertb <>2021-04-20 17:04:13 +0000
commitdf667324dee726a4c161f0c3c2194b233569942c (patch)
tree173c34f3f2e636d34625fd1b38effccf5db6b71f /src/lib/libcrypto/ec/ec_cvt.c
parent16295663705b9c018a523267b6d4d6c3a2e71cbb (diff)
downloadopenbsd-df667324dee726a4c161f0c3c2194b233569942c.tar.gz
openbsd-df667324dee726a4c161f0c3c2194b233569942c.tar.bz2
openbsd-df667324dee726a4c161f0c3c2194b233569942c.zip
Prepare to provide EC_GROUP_{get,set}_curve(3)
There are numerous functions in ec/ that exist with _GF2m and _GFp variants for no good reason. The code of both variants is the same. The EC_METHODs contain a pointer to the appropriate version. This commit hides the _GF2m and _GFp variants from internal use and provides versions that work for both curve types. These will be made public in an upcoming library bump. Similar to part of OpenSSL commit 8e3cced75fb5fee5da59ebef9605d403a999391b ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec_cvt.c')
-rw-r--r--src/lib/libcrypto/ec/ec_cvt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ec/ec_cvt.c b/src/lib/libcrypto/ec/ec_cvt.c
index a0982064b8..05c7dd1bf1 100644
--- a/src/lib/libcrypto/ec/ec_cvt.c
+++ b/src/lib/libcrypto/ec/ec_cvt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_cvt.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: ec_cvt.c,v 1.7 2021/04/20 17:04:13 tb Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -112,7 +112,7 @@ EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b,
112 if (ret == NULL) 112 if (ret == NULL)
113 return NULL; 113 return NULL;
114 114
115 if (!EC_GROUP_set_curve_GFp(ret, p, a, b, ctx)) { 115 if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
116 unsigned long err; 116 unsigned long err;
117 117
118 err = ERR_peek_last_error(); 118 err = ERR_peek_last_error();
@@ -136,7 +136,7 @@ EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b,
136 if (ret == NULL) 136 if (ret == NULL)
137 return NULL; 137 return NULL;
138 138
139 if (!EC_GROUP_set_curve_GFp(ret, p, a, b, ctx)) { 139 if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
140 EC_GROUP_clear_free(ret); 140 EC_GROUP_clear_free(ret);
141 return NULL; 141 return NULL;
142 } 142 }
@@ -158,7 +158,7 @@ EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b,
158 if (ret == NULL) 158 if (ret == NULL)
159 return NULL; 159 return NULL;
160 160
161 if (!EC_GROUP_set_curve_GF2m(ret, p, a, b, ctx)) { 161 if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
162 EC_GROUP_clear_free(ret); 162 EC_GROUP_clear_free(ret);
163 return NULL; 163 return NULL;
164 } 164 }