summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-11-19 07:00:57 +0000
committertb <>2022-11-19 07:00:57 +0000
commitb197546e7fd8128aedea248a6196a0d25734b937 (patch)
treeea2ed349b4963d6f17652f4f5e962ee6d7cb2183 /src
parentc85d7e98a77173fe38f0421c7cf06dc09bc9a746 (diff)
downloadopenbsd-b197546e7fd8128aedea248a6196a0d25734b937.tar.gz
openbsd-b197546e7fd8128aedea248a6196a0d25734b937.tar.bz2
openbsd-b197546e7fd8128aedea248a6196a0d25734b937.zip
whitespace
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/ec2_oct.c6
-rw-r--r--src/lib/libcrypto/ec/ec2_smpl.c54
-rw-r--r--src/lib/libcrypto/ec/ec_ameth.c44
-rw-r--r--src/lib/libcrypto/ec/ec_asn1.c28
-rw-r--r--src/lib/libcrypto/ec/ec_check.c4
-rw-r--r--src/lib/libcrypto/ec/ec_curve.c4
-rw-r--r--src/lib/libcrypto/ec/ec_err.c4
-rw-r--r--src/lib/libcrypto/ec/ec_key.c34
-rw-r--r--src/lib/libcrypto/ec/ec_mult.c14
-rw-r--r--src/lib/libcrypto/ec/ec_pmeth.c22
-rw-r--r--src/lib/libcrypto/ec/eck_prn.c18
-rw-r--r--src/lib/libcrypto/ec/ecp_nistputil.c6
-rw-r--r--src/lib/libcrypto/ec/ecp_nistz256.c4
-rw-r--r--src/lib/libcrypto/ec/ecp_oct.c8
-rw-r--r--src/lib/libcrypto/ec/ecp_smpl.c14
-rw-r--r--src/lib/libcrypto/ec/ecx_methods.c4
16 files changed, 134 insertions, 134 deletions
diff --git a/src/lib/libcrypto/ec/ec2_oct.c b/src/lib/libcrypto/ec/ec2_oct.c
index 832083c628..b25084ef58 100644
--- a/src/lib/libcrypto/ec/ec2_oct.c
+++ b/src/lib/libcrypto/ec/ec2_oct.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec2_oct.c,v 1.16 2021/05/03 14:42:45 tb Exp $ */ 1/* $OpenBSD: ec2_oct.c,v 1.17 2022/11/19 07:00:57 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -90,7 +90,7 @@
90 * the same method, but claim no priority date earlier than July 29, 1994 90 * the same method, but claim no priority date earlier than July 29, 1994
91 * (and additionally fail to cite the EUROCRYPT '92 publication as prior art). 91 * (and additionally fail to cite the EUROCRYPT '92 publication as prior art).
92 */ 92 */
93int 93int
94ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point, 94ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point,
95 const BIGNUM *x_, int y_bit, BN_CTX *ctx) 95 const BIGNUM *x_, int y_bit, BN_CTX *ctx)
96{ 96{
@@ -172,7 +172,7 @@ ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point
172 * If buf is NULL, the encoded length will be returned. 172 * If buf is NULL, the encoded length will be returned.
173 * If the length len of buf is smaller than required an error will be returned. 173 * If the length len of buf is smaller than required an error will be returned.
174 */ 174 */
175size_t 175size_t
176ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, 176ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point,
177 point_conversion_form_t form, 177 point_conversion_form_t form,
178 unsigned char *buf, size_t len, BN_CTX * ctx) 178 unsigned char *buf, size_t len, BN_CTX * ctx)
diff --git a/src/lib/libcrypto/ec/ec2_smpl.c b/src/lib/libcrypto/ec/ec2_smpl.c
index 9f3b380bfe..17664d0426 100644
--- a/src/lib/libcrypto/ec/ec2_smpl.c
+++ b/src/lib/libcrypto/ec/ec2_smpl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec2_smpl.c,v 1.23 2021/09/08 17:29:21 tb Exp $ */ 1/* $OpenBSD: ec2_smpl.c,v 1.24 2022/11/19 07:00:57 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -126,7 +126,7 @@ EC_GF2m_simple_method(void)
126/* Initialize a GF(2^m)-based EC_GROUP structure. 126/* Initialize a GF(2^m)-based EC_GROUP structure.
127 * Note that all other members are handled by EC_GROUP_new. 127 * Note that all other members are handled by EC_GROUP_new.
128 */ 128 */
129int 129int
130ec_GF2m_simple_group_init(EC_GROUP * group) 130ec_GF2m_simple_group_init(EC_GROUP * group)
131{ 131{
132 BN_init(&group->field); 132 BN_init(&group->field);
@@ -139,7 +139,7 @@ ec_GF2m_simple_group_init(EC_GROUP * group)
139/* Free a GF(2^m)-based EC_GROUP structure. 139/* Free a GF(2^m)-based EC_GROUP structure.
140 * Note that all other members are handled by EC_GROUP_free. 140 * Note that all other members are handled by EC_GROUP_free.
141 */ 141 */
142void 142void
143ec_GF2m_simple_group_finish(EC_GROUP * group) 143ec_GF2m_simple_group_finish(EC_GROUP * group)
144{ 144{
145 BN_free(&group->field); 145 BN_free(&group->field);
@@ -151,7 +151,7 @@ ec_GF2m_simple_group_finish(EC_GROUP * group)
151/* Clear and free a GF(2^m)-based EC_GROUP structure. 151/* Clear and free a GF(2^m)-based EC_GROUP structure.
152 * Note that all other members are handled by EC_GROUP_clear_free. 152 * Note that all other members are handled by EC_GROUP_clear_free.
153 */ 153 */
154void 154void
155ec_GF2m_simple_group_clear_finish(EC_GROUP * group) 155ec_GF2m_simple_group_clear_finish(EC_GROUP * group)
156{ 156{
157 BN_clear_free(&group->field); 157 BN_clear_free(&group->field);
@@ -169,7 +169,7 @@ ec_GF2m_simple_group_clear_finish(EC_GROUP * group)
169/* Copy a GF(2^m)-based EC_GROUP structure. 169/* Copy a GF(2^m)-based EC_GROUP structure.
170 * Note that all other members are handled by EC_GROUP_copy. 170 * Note that all other members are handled by EC_GROUP_copy.
171 */ 171 */
172int 172int
173ec_GF2m_simple_group_copy(EC_GROUP * dest, const EC_GROUP * src) 173ec_GF2m_simple_group_copy(EC_GROUP * dest, const EC_GROUP * src)
174{ 174{
175 int i; 175 int i;
@@ -199,7 +199,7 @@ ec_GF2m_simple_group_copy(EC_GROUP * dest, const EC_GROUP * src)
199 199
200 200
201/* Set the curve parameters of an EC_GROUP structure. */ 201/* Set the curve parameters of an EC_GROUP structure. */
202int 202int
203ec_GF2m_simple_group_set_curve(EC_GROUP * group, 203ec_GF2m_simple_group_set_curve(EC_GROUP * group,
204 const BIGNUM * p, const BIGNUM * a, const BIGNUM * b, BN_CTX * ctx) 204 const BIGNUM * p, const BIGNUM * a, const BIGNUM * b, BN_CTX * ctx)
205{ 205{
@@ -238,7 +238,7 @@ ec_GF2m_simple_group_set_curve(EC_GROUP * group,
238/* Get the curve parameters of an EC_GROUP structure. 238/* Get the curve parameters of an EC_GROUP structure.
239 * If p, a, or b are NULL then there values will not be set but the method will return with success. 239 * If p, a, or b are NULL then there values will not be set but the method will return with success.
240 */ 240 */
241int 241int
242ec_GF2m_simple_group_get_curve(const EC_GROUP *group, 242ec_GF2m_simple_group_get_curve(const EC_GROUP *group,
243 BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx) 243 BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
244{ 244{
@@ -264,7 +264,7 @@ ec_GF2m_simple_group_get_curve(const EC_GROUP *group,
264 264
265 265
266/* Gets the degree of the field. For a curve over GF(2^m) this is the value m. */ 266/* Gets the degree of the field. For a curve over GF(2^m) this is the value m. */
267int 267int
268ec_GF2m_simple_group_get_degree(const EC_GROUP * group) 268ec_GF2m_simple_group_get_degree(const EC_GROUP * group)
269{ 269{
270 return BN_num_bits(&group->field) - 1; 270 return BN_num_bits(&group->field) - 1;
@@ -274,7 +274,7 @@ ec_GF2m_simple_group_get_degree(const EC_GROUP * group)
274/* Checks the discriminant of the curve. 274/* Checks the discriminant of the curve.
275 * y^2 + x*y = x^3 + a*x^2 + b is an elliptic curve <=> b != 0 (mod p) 275 * y^2 + x*y = x^3 + a*x^2 + b is an elliptic curve <=> b != 0 (mod p)
276 */ 276 */
277int 277int
278ec_GF2m_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) 278ec_GF2m_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx)
279{ 279{
280 int ret = 0; 280 int ret = 0;
@@ -313,7 +313,7 @@ ec_GF2m_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx)
313 313
314 314
315/* Initializes an EC_POINT. */ 315/* Initializes an EC_POINT. */
316int 316int
317ec_GF2m_simple_point_init(EC_POINT * point) 317ec_GF2m_simple_point_init(EC_POINT * point)
318{ 318{
319 BN_init(&point->X); 319 BN_init(&point->X);
@@ -324,7 +324,7 @@ ec_GF2m_simple_point_init(EC_POINT * point)
324 324
325 325
326/* Frees an EC_POINT. */ 326/* Frees an EC_POINT. */
327void 327void
328ec_GF2m_simple_point_finish(EC_POINT * point) 328ec_GF2m_simple_point_finish(EC_POINT * point)
329{ 329{
330 BN_free(&point->X); 330 BN_free(&point->X);
@@ -334,7 +334,7 @@ ec_GF2m_simple_point_finish(EC_POINT * point)
334 334
335 335
336/* Clears and frees an EC_POINT. */ 336/* Clears and frees an EC_POINT. */
337void 337void
338ec_GF2m_simple_point_clear_finish(EC_POINT * point) 338ec_GF2m_simple_point_clear_finish(EC_POINT * point)
339{ 339{
340 BN_clear_free(&point->X); 340 BN_clear_free(&point->X);
@@ -345,7 +345,7 @@ ec_GF2m_simple_point_clear_finish(EC_POINT * point)
345 345
346 346
347/* Copy the contents of one EC_POINT into another. Assumes dest is initialized. */ 347/* Copy the contents of one EC_POINT into another. Assumes dest is initialized. */
348int 348int
349ec_GF2m_simple_point_copy(EC_POINT * dest, const EC_POINT * src) 349ec_GF2m_simple_point_copy(EC_POINT * dest, const EC_POINT * src)
350{ 350{
351 if (!BN_copy(&dest->X, &src->X)) 351 if (!BN_copy(&dest->X, &src->X))
@@ -363,7 +363,7 @@ ec_GF2m_simple_point_copy(EC_POINT * dest, const EC_POINT * src)
363/* Set an EC_POINT to the point at infinity. 363/* Set an EC_POINT to the point at infinity.
364 * A point at infinity is represented by having Z=0. 364 * A point at infinity is represented by having Z=0.
365 */ 365 */
366int 366int
367ec_GF2m_simple_point_set_to_infinity(const EC_GROUP * group, EC_POINT * point) 367ec_GF2m_simple_point_set_to_infinity(const EC_GROUP * group, EC_POINT * point)
368{ 368{
369 point->Z_is_one = 0; 369 point->Z_is_one = 0;
@@ -375,7 +375,7 @@ ec_GF2m_simple_point_set_to_infinity(const EC_GROUP * group, EC_POINT * point)
375/* Set the coordinates of an EC_POINT using affine coordinates. 375/* Set the coordinates of an EC_POINT using affine coordinates.
376 * Note that the simple implementation only uses affine coordinates. 376 * Note that the simple implementation only uses affine coordinates.
377 */ 377 */
378int 378int
379ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * point, 379ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * point,
380 const BIGNUM * x, const BIGNUM * y, BN_CTX * ctx) 380 const BIGNUM * x, const BIGNUM * y, BN_CTX * ctx)
381{ 381{
@@ -404,7 +404,7 @@ ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * p
404/* Gets the affine coordinates of an EC_POINT. 404/* Gets the affine coordinates of an EC_POINT.
405 * Note that the simple implementation only uses affine coordinates. 405 * Note that the simple implementation only uses affine coordinates.
406 */ 406 */
407int 407int
408ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group, 408ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group,
409 const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx) 409 const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
410{ 410{
@@ -437,7 +437,7 @@ ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group,
437/* Computes a + b and stores the result in r. r could be a or b, a could be b. 437/* Computes a + b and stores the result in r. r could be a or b, a could be b.
438 * Uses algorithm A.10.2 of IEEE P1363. 438 * Uses algorithm A.10.2 of IEEE P1363.
439 */ 439 */
440int 440int
441ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, 441ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
442 const EC_POINT *b, BN_CTX *ctx) 442 const EC_POINT *b, BN_CTX *ctx)
443{ 443{
@@ -557,14 +557,14 @@ ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
557/* Computes 2 * a and stores the result in r. r could be a. 557/* Computes 2 * a and stores the result in r. r could be a.
558 * Uses algorithm A.10.2 of IEEE P1363. 558 * Uses algorithm A.10.2 of IEEE P1363.
559 */ 559 */
560int 560int
561ec_GF2m_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, 561ec_GF2m_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
562 BN_CTX *ctx) 562 BN_CTX *ctx)
563{ 563{
564 return ec_GF2m_simple_add(group, r, a, a, ctx); 564 return ec_GF2m_simple_add(group, r, a, a, ctx);
565} 565}
566 566
567int 567int
568ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) 568ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
569{ 569{
570 if (EC_POINT_is_at_infinity(group, point) > 0 || BN_is_zero(&point->Y)) 570 if (EC_POINT_is_at_infinity(group, point) > 0 || BN_is_zero(&point->Y))
@@ -578,7 +578,7 @@ ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
578 578
579 579
580/* Indicates whether the given point is the point at infinity. */ 580/* Indicates whether the given point is the point at infinity. */
581int 581int
582ec_GF2m_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) 582ec_GF2m_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)
583{ 583{
584 return BN_is_zero(&point->Z); 584 return BN_is_zero(&point->Z);
@@ -589,7 +589,7 @@ ec_GF2m_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)
589 * in the EC_GROUP. A point is valid if it satisfies the Weierstrass equation: 589 * in the EC_GROUP. A point is valid if it satisfies the Weierstrass equation:
590 * y^2 + x*y = x^3 + a*x^2 + b. 590 * y^2 + x*y = x^3 + a*x^2 + b.
591 */ 591 */
592int 592int
593ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx) 593ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx)
594{ 594{
595 int ret = -1; 595 int ret = -1;
@@ -653,7 +653,7 @@ ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX
653 * 0 equal (in affine coordinates) 653 * 0 equal (in affine coordinates)
654 * 1 not equal 654 * 1 not equal
655 */ 655 */
656int 656int
657ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, 657ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
658 const EC_POINT *b, BN_CTX *ctx) 658 const EC_POINT *b, BN_CTX *ctx)
659{ 659{
@@ -700,7 +700,7 @@ ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
700 700
701 701
702/* Forces the given EC_POINT to internally use affine coordinates. */ 702/* Forces the given EC_POINT to internally use affine coordinates. */
703int 703int
704ec_GF2m_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx) 704ec_GF2m_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx)
705{ 705{
706 BN_CTX *new_ctx = NULL; 706 BN_CTX *new_ctx = NULL;
@@ -741,7 +741,7 @@ ec_GF2m_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ct
741 741
742 742
743/* Forces each of the EC_POINTs in the given array to use affine coordinates. */ 743/* Forces each of the EC_POINTs in the given array to use affine coordinates. */
744int 744int
745ec_GF2m_simple_points_make_affine(const EC_GROUP *group, size_t num, 745ec_GF2m_simple_points_make_affine(const EC_GROUP *group, size_t num,
746 EC_POINT *points[], BN_CTX *ctx) 746 EC_POINT *points[], BN_CTX *ctx)
747{ 747{
@@ -757,7 +757,7 @@ ec_GF2m_simple_points_make_affine(const EC_GROUP *group, size_t num,
757 757
758 758
759/* Wrapper to simple binary polynomial field multiplication implementation. */ 759/* Wrapper to simple binary polynomial field multiplication implementation. */
760int 760int
761ec_GF2m_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, 761ec_GF2m_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
762 const BIGNUM *b, BN_CTX *ctx) 762 const BIGNUM *b, BN_CTX *ctx)
763{ 763{
@@ -766,7 +766,7 @@ ec_GF2m_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
766 766
767 767
768/* Wrapper to simple binary polynomial field squaring implementation. */ 768/* Wrapper to simple binary polynomial field squaring implementation. */
769int 769int
770ec_GF2m_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, 770ec_GF2m_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
771 BN_CTX *ctx) 771 BN_CTX *ctx)
772{ 772{
@@ -775,7 +775,7 @@ ec_GF2m_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
775 775
776 776
777/* Wrapper to simple binary polynomial field division implementation. */ 777/* Wrapper to simple binary polynomial field division implementation. */
778int 778int
779ec_GF2m_simple_field_div(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, 779ec_GF2m_simple_field_div(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
780 const BIGNUM *b, BN_CTX *ctx) 780 const BIGNUM *b, BN_CTX *ctx)
781{ 781{
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c
index 5c9a76c8be..ee931a93c6 100644
--- a/src/lib/libcrypto/ec/ec_ameth.c
+++ b/src/lib/libcrypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_ameth.c,v 1.33 2022/06/27 12:36:05 tb Exp $ */ 1/* $OpenBSD: ec_ameth.c,v 1.34 2022/11/19 07:00:57 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -75,7 +75,7 @@ static int ecdh_cms_decrypt(CMS_RecipientInfo *ri);
75static int ecdh_cms_encrypt(CMS_RecipientInfo *ri); 75static int ecdh_cms_encrypt(CMS_RecipientInfo *ri);
76#endif 76#endif
77 77
78static int 78static int
79eckey_param2type(int *pptype, void **ppval, EC_KEY * ec_key) 79eckey_param2type(int *pptype, void **ppval, EC_KEY * ec_key)
80{ 80{
81 const EC_GROUP *group; 81 const EC_GROUP *group;
@@ -107,7 +107,7 @@ eckey_param2type(int *pptype, void **ppval, EC_KEY * ec_key)
107 return 1; 107 return 1;
108} 108}
109 109
110static int 110static int
111eckey_pub_encode(X509_PUBKEY * pk, const EVP_PKEY * pkey) 111eckey_pub_encode(X509_PUBKEY * pk, const EVP_PKEY * pkey)
112{ 112{
113 EC_KEY *ec_key = pkey->pkey.ec; 113 EC_KEY *ec_key = pkey->pkey.ec;
@@ -190,7 +190,7 @@ eckey_type2param(int ptype, const void *pval)
190 return NULL; 190 return NULL;
191} 191}
192 192
193static int 193static int
194eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey) 194eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey)
195{ 195{
196 const unsigned char *p = NULL; 196 const unsigned char *p = NULL;
@@ -223,7 +223,7 @@ eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey)
223 return 0; 223 return 0;
224} 224}
225 225
226static int 226static int
227eckey_pub_cmp(const EVP_PKEY * a, const EVP_PKEY * b) 227eckey_pub_cmp(const EVP_PKEY * a, const EVP_PKEY * b)
228{ 228{
229 int r; 229 int r;
@@ -238,7 +238,7 @@ eckey_pub_cmp(const EVP_PKEY * a, const EVP_PKEY * b)
238 return -2; 238 return -2;
239} 239}
240 240
241static int 241static int
242eckey_priv_decode(EVP_PKEY * pkey, const PKCS8_PRIV_KEY_INFO * p8) 242eckey_priv_decode(EVP_PKEY * pkey, const PKCS8_PRIV_KEY_INFO * p8)
243{ 243{
244 const unsigned char *p = NULL; 244 const unsigned char *p = NULL;
@@ -305,7 +305,7 @@ eckey_priv_decode(EVP_PKEY * pkey, const PKCS8_PRIV_KEY_INFO * p8)
305 return 0; 305 return 0;
306} 306}
307 307
308static int 308static int
309eckey_priv_encode(PKCS8_PRIV_KEY_INFO * p8, const EVP_PKEY * pkey) 309eckey_priv_encode(PKCS8_PRIV_KEY_INFO * p8, const EVP_PKEY * pkey)
310{ 310{
311 EC_KEY *ec_key; 311 EC_KEY *ec_key;
@@ -358,13 +358,13 @@ eckey_priv_encode(PKCS8_PRIV_KEY_INFO * p8, const EVP_PKEY * pkey)
358 return 1; 358 return 1;
359} 359}
360 360
361static int 361static int
362int_ec_size(const EVP_PKEY * pkey) 362int_ec_size(const EVP_PKEY * pkey)
363{ 363{
364 return ECDSA_size(pkey->pkey.ec); 364 return ECDSA_size(pkey->pkey.ec);
365} 365}
366 366
367static int 367static int
368ec_bits(const EVP_PKEY * pkey) 368ec_bits(const EVP_PKEY * pkey)
369{ 369{
370 BIGNUM *order = BN_new(); 370 BIGNUM *order = BN_new();
@@ -405,7 +405,7 @@ ec_security_bits(const EVP_PKEY *pkey)
405 return ecbits / 2; 405 return ecbits / 2;
406} 406}
407 407
408static int 408static int
409ec_missing_parameters(const EVP_PKEY * pkey) 409ec_missing_parameters(const EVP_PKEY * pkey)
410{ 410{
411 if (EC_KEY_get0_group(pkey->pkey.ec) == NULL) 411 if (EC_KEY_get0_group(pkey->pkey.ec) == NULL)
@@ -413,13 +413,13 @@ ec_missing_parameters(const EVP_PKEY * pkey)
413 return 0; 413 return 0;
414} 414}
415 415
416static int 416static int
417ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from) 417ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from)
418{ 418{
419 return EC_KEY_set_group(to->pkey.ec, EC_KEY_get0_group(from->pkey.ec)); 419 return EC_KEY_set_group(to->pkey.ec, EC_KEY_get0_group(from->pkey.ec));
420} 420}
421 421
422static int 422static int
423ec_cmp_parameters(const EVP_PKEY * a, const EVP_PKEY * b) 423ec_cmp_parameters(const EVP_PKEY * a, const EVP_PKEY * b)
424{ 424{
425 const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec), *group_b = EC_KEY_get0_group(b->pkey.ec); 425 const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec), *group_b = EC_KEY_get0_group(b->pkey.ec);
@@ -429,13 +429,13 @@ ec_cmp_parameters(const EVP_PKEY * a, const EVP_PKEY * b)
429 return 1; 429 return 1;
430} 430}
431 431
432static void 432static void
433int_ec_free(EVP_PKEY * pkey) 433int_ec_free(EVP_PKEY * pkey)
434{ 434{
435 EC_KEY_free(pkey->pkey.ec); 435 EC_KEY_free(pkey->pkey.ec);
436} 436}
437 437
438static int 438static int
439do_EC_KEY_print(BIO * bp, const EC_KEY * x, int off, int ktype) 439do_EC_KEY_print(BIO * bp, const EC_KEY * x, int off, int ktype)
440{ 440{
441 unsigned char *buffer = NULL; 441 unsigned char *buffer = NULL;
@@ -519,7 +519,7 @@ do_EC_KEY_print(BIO * bp, const EC_KEY * x, int off, int ktype)
519 return (ret); 519 return (ret);
520} 520}
521 521
522static int 522static int
523eckey_param_decode(EVP_PKEY * pkey, 523eckey_param_decode(EVP_PKEY * pkey,
524 const unsigned char **pder, int derlen) 524 const unsigned char **pder, int derlen)
525{ 525{
@@ -532,20 +532,20 @@ eckey_param_decode(EVP_PKEY * pkey,
532 return 1; 532 return 1;
533} 533}
534 534
535static int 535static int
536eckey_param_encode(const EVP_PKEY * pkey, unsigned char **pder) 536eckey_param_encode(const EVP_PKEY * pkey, unsigned char **pder)
537{ 537{
538 return i2d_ECParameters(pkey->pkey.ec, pder); 538 return i2d_ECParameters(pkey->pkey.ec, pder);
539} 539}
540 540
541static int 541static int
542eckey_param_print(BIO * bp, const EVP_PKEY * pkey, int indent, 542eckey_param_print(BIO * bp, const EVP_PKEY * pkey, int indent,
543 ASN1_PCTX * ctx) 543 ASN1_PCTX * ctx)
544{ 544{
545 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 0); 545 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 0);
546} 546}
547 547
548static int 548static int
549eckey_pub_print(BIO * bp, const EVP_PKEY * pkey, int indent, 549eckey_pub_print(BIO * bp, const EVP_PKEY * pkey, int indent,
550 ASN1_PCTX * ctx) 550 ASN1_PCTX * ctx)
551{ 551{
@@ -553,14 +553,14 @@ eckey_pub_print(BIO * bp, const EVP_PKEY * pkey, int indent,
553} 553}
554 554
555 555
556static int 556static int
557eckey_priv_print(BIO * bp, const EVP_PKEY * pkey, int indent, 557eckey_priv_print(BIO * bp, const EVP_PKEY * pkey, int indent,
558 ASN1_PCTX * ctx) 558 ASN1_PCTX * ctx)
559{ 559{
560 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 2); 560 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 2);
561} 561}
562 562
563static int 563static int
564old_ec_priv_decode(EVP_PKEY * pkey, 564old_ec_priv_decode(EVP_PKEY * pkey,
565 const unsigned char **pder, int derlen) 565 const unsigned char **pder, int derlen)
566{ 566{
@@ -573,13 +573,13 @@ old_ec_priv_decode(EVP_PKEY * pkey,
573 return 1; 573 return 1;
574} 574}
575 575
576static int 576static int
577old_ec_priv_encode(const EVP_PKEY * pkey, unsigned char **pder) 577old_ec_priv_encode(const EVP_PKEY * pkey, unsigned char **pder)
578{ 578{
579 return i2d_ECPrivateKey(pkey->pkey.ec, pder); 579 return i2d_ECPrivateKey(pkey->pkey.ec, pder);
580} 580}
581 581
582static int 582static int
583ec_pkey_ctrl(EVP_PKEY * pkey, int op, long arg1, void *arg2) 583ec_pkey_ctrl(EVP_PKEY * pkey, int op, long arg1, void *arg2)
584{ 584{
585 switch (op) { 585 switch (op) {
diff --git a/src/lib/libcrypto/ec/ec_asn1.c b/src/lib/libcrypto/ec/ec_asn1.c
index 6bf7e47d7d..baa58b5183 100644
--- a/src/lib/libcrypto/ec/ec_asn1.c
+++ b/src/lib/libcrypto/ec/ec_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_asn1.c,v 1.37 2022/05/24 20:06:32 tb Exp $ */ 1/* $OpenBSD: ec_asn1.c,v 1.38 2022/11/19 07:00:57 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -67,7 +67,7 @@
67#include "asn1_locl.h" 67#include "asn1_locl.h"
68#include "ec_lcl.h" 68#include "ec_lcl.h"
69 69
70int 70int
71EC_GROUP_get_basis_type(const EC_GROUP * group) 71EC_GROUP_get_basis_type(const EC_GROUP * group)
72{ 72{
73 int i = 0; 73 int i = 0;
@@ -90,7 +90,7 @@ EC_GROUP_get_basis_type(const EC_GROUP * group)
90} 90}
91 91
92#ifndef OPENSSL_NO_EC2M 92#ifndef OPENSSL_NO_EC2M
93int 93int
94EC_GROUP_get_trinomial_basis(const EC_GROUP * group, unsigned int *k) 94EC_GROUP_get_trinomial_basis(const EC_GROUP * group, unsigned int *k)
95{ 95{
96 if (group == NULL) 96 if (group == NULL)
@@ -108,7 +108,7 @@ EC_GROUP_get_trinomial_basis(const EC_GROUP * group, unsigned int *k)
108 return 1; 108 return 1;
109} 109}
110 110
111int 111int
112EC_GROUP_get_pentanomial_basis(const EC_GROUP * group, unsigned int *k1, 112EC_GROUP_get_pentanomial_basis(const EC_GROUP * group, unsigned int *k1,
113 unsigned int *k2, unsigned int *k3) 113 unsigned int *k2, unsigned int *k3)
114{ 114{
@@ -268,7 +268,7 @@ static const ASN1_ADB_TABLE X9_62_CHARACTERISTIC_TWO_adbtbl[] = {
268 .field_name = "p.onBasis", 268 .field_name = "p.onBasis",
269 .item = &ASN1_NULL_it, 269 .item = &ASN1_NULL_it,
270 }, 270 },
271 271
272 }, 272 },
273 { 273 {
274 .value = NID_X9_62_tpBasis, 274 .value = NID_X9_62_tpBasis,
@@ -279,7 +279,7 @@ static const ASN1_ADB_TABLE X9_62_CHARACTERISTIC_TWO_adbtbl[] = {
279 .field_name = "p.tpBasis", 279 .field_name = "p.tpBasis",
280 .item = &ASN1_INTEGER_it, 280 .item = &ASN1_INTEGER_it,
281 }, 281 },
282 282
283 }, 283 },
284 { 284 {
285 .value = NID_X9_62_ppBasis, 285 .value = NID_X9_62_ppBasis,
@@ -290,7 +290,7 @@ static const ASN1_ADB_TABLE X9_62_CHARACTERISTIC_TWO_adbtbl[] = {
290 .field_name = "p.ppBasis", 290 .field_name = "p.ppBasis",
291 .item = &X9_62_PENTANOMIAL_it, 291 .item = &X9_62_PENTANOMIAL_it,
292 }, 292 },
293 293
294 }, 294 },
295}; 295};
296 296
@@ -370,7 +370,7 @@ static const ASN1_ADB_TABLE X9_62_FIELDID_adbtbl[] = {
370 .field_name = "p.prime", 370 .field_name = "p.prime",
371 .item = &ASN1_INTEGER_it, 371 .item = &ASN1_INTEGER_it,
372 }, 372 },
373 373
374 }, 374 },
375 { 375 {
376 .value = NID_X9_62_characteristic_two_field, 376 .value = NID_X9_62_characteristic_two_field,
@@ -381,7 +381,7 @@ static const ASN1_ADB_TABLE X9_62_FIELDID_adbtbl[] = {
381 .field_name = "p.char_two", 381 .field_name = "p.char_two",
382 .item = &X9_62_CHARACTERISTIC_TWO_it, 382 .item = &X9_62_CHARACTERISTIC_TWO_it,
383 }, 383 },
384 384
385 }, 385 },
386}; 386};
387 387
@@ -798,7 +798,7 @@ ec_asn1_group2fieldid(const EC_GROUP * group, X9_62_FIELDID * field)
798 return (ok); 798 return (ok);
799} 799}
800 800
801static int 801static int
802ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve) 802ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve)
803{ 803{
804 BIGNUM *tmp_1 = NULL, *tmp_2 = NULL; 804 BIGNUM *tmp_1 = NULL, *tmp_2 = NULL;
@@ -1308,7 +1308,7 @@ d2i_ECPKParameters(EC_GROUP ** a, const unsigned char **in, long len)
1308 return (group); 1308 return (group);
1309} 1309}
1310 1310
1311int 1311int
1312i2d_ECPKParameters(const EC_GROUP * a, unsigned char **out) 1312i2d_ECPKParameters(const EC_GROUP * a, unsigned char **out)
1313{ 1313{
1314 int ret = 0; 1314 int ret = 0;
@@ -1420,7 +1420,7 @@ d2i_ECPrivateKey(EC_KEY ** a, const unsigned char **in, long len)
1420 return (NULL); 1420 return (NULL);
1421} 1421}
1422 1422
1423int 1423int
1424i2d_ECPrivateKey(EC_KEY * a, unsigned char **out) 1424i2d_ECPrivateKey(EC_KEY * a, unsigned char **out)
1425{ 1425{
1426 int ret = 0, ok = 0; 1426 int ret = 0, ok = 0;
@@ -1504,7 +1504,7 @@ i2d_ECPrivateKey(EC_KEY * a, unsigned char **out)
1504 return (ok ? ret : 0); 1504 return (ok ? ret : 0);
1505} 1505}
1506 1506
1507int 1507int
1508i2d_ECParameters(EC_KEY * a, unsigned char **out) 1508i2d_ECParameters(EC_KEY * a, unsigned char **out)
1509{ 1509{
1510 if (a == NULL) { 1510 if (a == NULL) {
@@ -1569,7 +1569,7 @@ o2i_ECPublicKey(EC_KEY ** a, const unsigned char **in, long len)
1569 return ret; 1569 return ret;
1570} 1570}
1571 1571
1572int 1572int
1573i2o_ECPublicKey(const EC_KEY * a, unsigned char **out) 1573i2o_ECPublicKey(const EC_KEY * a, unsigned char **out)
1574{ 1574{
1575 size_t buf_len = 0; 1575 size_t buf_len = 0;
diff --git a/src/lib/libcrypto/ec/ec_check.c b/src/lib/libcrypto/ec/ec_check.c
index dcca661674..3f6a802374 100644
--- a/src/lib/libcrypto/ec/ec_check.c
+++ b/src/lib/libcrypto/ec/ec_check.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_check.c,v 1.9 2018/07/15 16:27:39 tb Exp $ */ 1/* $OpenBSD: ec_check.c,v 1.10 2022/11/19 07:00:57 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -56,7 +56,7 @@
56#include "ec_lcl.h" 56#include "ec_lcl.h"
57#include <openssl/err.h> 57#include <openssl/err.h>
58 58
59int 59int
60EC_GROUP_check(const EC_GROUP * group, BN_CTX * ctx) 60EC_GROUP_check(const EC_GROUP * group, BN_CTX * ctx)
61{ 61{
62 int ret = 0; 62 int ret = 0;
diff --git a/src/lib/libcrypto/ec/ec_curve.c b/src/lib/libcrypto/ec/ec_curve.c
index 09f8cfe9d8..1f69d4f1dc 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.22 2022/06/30 11:14:47 tb Exp $ */ 1/* $OpenBSD: ec_curve.c,v 1.23 2022/11/19 07:00:57 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -3433,7 +3433,7 @@ EC_GROUP_new_by_curve_name(int nid)
3433 return ret; 3433 return ret;
3434} 3434}
3435 3435
3436size_t 3436size_t
3437EC_get_builtin_curves(EC_builtin_curve * r, size_t nitems) 3437EC_get_builtin_curves(EC_builtin_curve * r, size_t nitems)
3438{ 3438{
3439 size_t i, min; 3439 size_t i, min;
diff --git a/src/lib/libcrypto/ec/ec_err.c b/src/lib/libcrypto/ec/ec_err.c
index 2ff8e9974e..be6a284599 100644
--- a/src/lib/libcrypto/ec/ec_err.c
+++ b/src/lib/libcrypto/ec/ec_err.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_err.c,v 1.14 2022/11/10 16:37:52 jsing Exp $ */ 1/* $OpenBSD: ec_err.c,v 1.15 2022/11/19 07:00:57 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -131,7 +131,7 @@ static ERR_STRING_DATA EC_str_reasons[] =
131 131
132#endif 132#endif
133 133
134void 134void
135ERR_load_EC_strings(void) 135ERR_load_EC_strings(void)
136{ 136{
137#ifndef OPENSSL_NO_ERR 137#ifndef OPENSSL_NO_ERR
diff --git a/src/lib/libcrypto/ec/ec_key.c b/src/lib/libcrypto/ec/ec_key.c
index 27b8f26608..3aa6a96eb8 100644
--- a/src/lib/libcrypto/ec/ec_key.c
+++ b/src/lib/libcrypto/ec/ec_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_key.c,v 1.26 2021/04/20 17:23:37 tb Exp $ */ 1/* $OpenBSD: ec_key.c,v 1.27 2022/11/19 07:00:57 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -98,7 +98,7 @@ EC_KEY_new_by_curve_name(int nid)
98 return ret; 98 return ret;
99} 99}
100 100
101void 101void
102EC_KEY_free(EC_KEY * r) 102EC_KEY_free(EC_KEY * r)
103{ 103{
104 int i; 104 int i;
@@ -228,7 +228,7 @@ EC_KEY_dup(const EC_KEY * ec_key)
228 return ret; 228 return ret;
229} 229}
230 230
231int 231int
232EC_KEY_up_ref(EC_KEY * r) 232EC_KEY_up_ref(EC_KEY * r)
233{ 233{
234 int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC); 234 int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC);
@@ -308,7 +308,7 @@ ossl_ec_key_gen(EC_KEY *eckey)
308 return (ok); 308 return (ok);
309} 309}
310 310
311int 311int
312EC_KEY_check_key(const EC_KEY * eckey) 312EC_KEY_check_key(const EC_KEY * eckey)
313{ 313{
314 int ok = 0; 314 int ok = 0;
@@ -375,7 +375,7 @@ EC_KEY_check_key(const EC_KEY * eckey)
375 return (ok); 375 return (ok);
376} 376}
377 377
378int 378int
379EC_KEY_set_public_key_affine_coordinates(EC_KEY * key, BIGNUM * x, BIGNUM * y) 379EC_KEY_set_public_key_affine_coordinates(EC_KEY * key, BIGNUM * x, BIGNUM * y)
380{ 380{
381 BN_CTX *ctx = NULL; 381 BN_CTX *ctx = NULL;
@@ -434,7 +434,7 @@ EC_KEY_get0_group(const EC_KEY * key)
434 return key->group; 434 return key->group;
435} 435}
436 436
437int 437int
438EC_KEY_set_group(EC_KEY * key, const EC_GROUP * group) 438EC_KEY_set_group(EC_KEY * key, const EC_GROUP * group)
439{ 439{
440 if (key->meth->set_group != NULL && 440 if (key->meth->set_group != NULL &&
@@ -451,7 +451,7 @@ EC_KEY_get0_private_key(const EC_KEY * key)
451 return key->priv_key; 451 return key->priv_key;
452} 452}
453 453
454int 454int
455EC_KEY_set_private_key(EC_KEY * key, const BIGNUM * priv_key) 455EC_KEY_set_private_key(EC_KEY * key, const BIGNUM * priv_key)
456{ 456{
457 if (key->meth->set_private != NULL && 457 if (key->meth->set_private != NULL &&
@@ -468,7 +468,7 @@ EC_KEY_get0_public_key(const EC_KEY * key)
468 return key->pub_key; 468 return key->pub_key;
469} 469}
470 470
471int 471int
472EC_KEY_set_public_key(EC_KEY * key, const EC_POINT * pub_key) 472EC_KEY_set_public_key(EC_KEY * key, const EC_POINT * pub_key)
473{ 473{
474 if (key->meth->set_public != NULL && 474 if (key->meth->set_public != NULL &&
@@ -479,25 +479,25 @@ EC_KEY_set_public_key(EC_KEY * key, const EC_POINT * pub_key)
479 return (key->pub_key == NULL) ? 0 : 1; 479 return (key->pub_key == NULL) ? 0 : 1;
480} 480}
481 481
482unsigned int 482unsigned int
483EC_KEY_get_enc_flags(const EC_KEY * key) 483EC_KEY_get_enc_flags(const EC_KEY * key)
484{ 484{
485 return key->enc_flag; 485 return key->enc_flag;
486} 486}
487 487
488void 488void
489EC_KEY_set_enc_flags(EC_KEY * key, unsigned int flags) 489EC_KEY_set_enc_flags(EC_KEY * key, unsigned int flags)
490{ 490{
491 key->enc_flag = flags; 491 key->enc_flag = flags;
492} 492}
493 493
494point_conversion_form_t 494point_conversion_form_t
495EC_KEY_get_conv_form(const EC_KEY * key) 495EC_KEY_get_conv_form(const EC_KEY * key)
496{ 496{
497 return key->conv_form; 497 return key->conv_form;
498} 498}
499 499
500void 500void
501EC_KEY_set_conv_form(EC_KEY * key, point_conversion_form_t cform) 501EC_KEY_set_conv_form(EC_KEY * key, point_conversion_form_t cform)
502{ 502{
503 key->conv_form = cform; 503 key->conv_form = cform;
@@ -537,14 +537,14 @@ EC_KEY_insert_key_method_data(EC_KEY * key, void *data,
537 return ex_data; 537 return ex_data;
538} 538}
539 539
540void 540void
541EC_KEY_set_asn1_flag(EC_KEY * key, int flag) 541EC_KEY_set_asn1_flag(EC_KEY * key, int flag)
542{ 542{
543 if (key->group != NULL) 543 if (key->group != NULL)
544 EC_GROUP_set_asn1_flag(key->group, flag); 544 EC_GROUP_set_asn1_flag(key->group, flag);
545} 545}
546 546
547int 547int
548EC_KEY_precompute_mult(EC_KEY * key, BN_CTX * ctx) 548EC_KEY_precompute_mult(EC_KEY * key, BN_CTX * ctx)
549{ 549{
550 if (key->group == NULL) 550 if (key->group == NULL)
@@ -552,19 +552,19 @@ EC_KEY_precompute_mult(EC_KEY * key, BN_CTX * ctx)
552 return EC_GROUP_precompute_mult(key->group, ctx); 552 return EC_GROUP_precompute_mult(key->group, ctx);
553} 553}
554 554
555int 555int
556EC_KEY_get_flags(const EC_KEY * key) 556EC_KEY_get_flags(const EC_KEY * key)
557{ 557{
558 return key->flags; 558 return key->flags;
559} 559}
560 560
561void 561void
562EC_KEY_set_flags(EC_KEY * key, int flags) 562EC_KEY_set_flags(EC_KEY * key, int flags)
563{ 563{
564 key->flags |= flags; 564 key->flags |= flags;
565} 565}
566 566
567void 567void
568EC_KEY_clear_flags(EC_KEY * key, int flags) 568EC_KEY_clear_flags(EC_KEY * key, int flags)
569{ 569{
570 key->flags &= ~flags; 570 key->flags &= ~flags;
diff --git a/src/lib/libcrypto/ec/ec_mult.c b/src/lib/libcrypto/ec/ec_mult.c
index 05f89a5787..1198a6f6b1 100644
--- a/src/lib/libcrypto/ec/ec_mult.c
+++ b/src/lib/libcrypto/ec/ec_mult.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_mult.c,v 1.24 2018/07/15 16:27:39 tb Exp $ */ 1/* $OpenBSD: ec_mult.c,v 1.25 2022/11/19 07:00:57 tb Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. 3 * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -132,7 +132,7 @@ ec_pre_comp_dup(void *src_)
132 return src_; 132 return src_;
133} 133}
134 134
135static void 135static void
136ec_pre_comp_free(void *pre_) 136ec_pre_comp_free(void *pre_)
137{ 137{
138 int i; 138 int i;
@@ -155,7 +155,7 @@ ec_pre_comp_free(void *pre_)
155 free(pre); 155 free(pre);
156} 156}
157 157
158static void 158static void
159ec_pre_comp_clear_free(void *pre_) 159ec_pre_comp_clear_free(void *pre_)
160{ 160{
161 int i; 161 int i;
@@ -331,7 +331,7 @@ compute_wNAF(const BIGNUM * scalar, int w, size_t * ret_len)
331 * scalar*generator 331 * scalar*generator
332 * in the addition if scalar != NULL 332 * in the addition if scalar != NULL
333 */ 333 */
334int 334int
335ec_wNAF_mul(const EC_GROUP * group, EC_POINT * r, const BIGNUM * scalar, 335ec_wNAF_mul(const EC_GROUP * group, EC_POINT * r, const BIGNUM * scalar,
336 size_t num, const EC_POINT * points[], const BIGNUM * scalars[], BN_CTX * ctx) 336 size_t num, const EC_POINT * points[], const BIGNUM * scalars[], BN_CTX * ctx)
337{ 337{
@@ -721,7 +721,7 @@ ec_wNAF_mul(const EC_GROUP * group, EC_POINT * r, const BIGNUM * scalar,
721 * points[2^(w-1)*numblocks-1] = (2^(w-1)) * 2^(blocksize*(numblocks-1)) * generator 721 * points[2^(w-1)*numblocks-1] = (2^(w-1)) * 2^(blocksize*(numblocks-1)) * generator
722 * points[2^(w-1)*numblocks] = NULL 722 * points[2^(w-1)*numblocks] = NULL
723 */ 723 */
724int 724int
725ec_wNAF_precompute_mult(EC_GROUP * group, BN_CTX * ctx) 725ec_wNAF_precompute_mult(EC_GROUP * group, BN_CTX * ctx)
726{ 726{
727 const EC_POINT *generator; 727 const EC_POINT *generator;
@@ -764,7 +764,7 @@ ec_wNAF_precompute_mult(EC_GROUP * group, BN_CTX * ctx)
764 /* 764 /*
765 * The following parameters mean we precompute (approximately) one 765 * The following parameters mean we precompute (approximately) one
766 * point per bit. 766 * point per bit.
767 * 767 *
768 * TBD: The combination 8, 4 is perfect for 160 bits; for other bit 768 * TBD: The combination 8, 4 is perfect for 160 bits; for other bit
769 * lengths, other parameter combinations might provide better 769 * lengths, other parameter combinations might provide better
770 * efficiency. 770 * efficiency.
@@ -875,7 +875,7 @@ ec_wNAF_precompute_mult(EC_GROUP * group, BN_CTX * ctx)
875} 875}
876 876
877 877
878int 878int
879ec_wNAF_have_precompute_mult(const EC_GROUP * group) 879ec_wNAF_have_precompute_mult(const EC_GROUP * group)
880{ 880{
881 if (EC_EX_DATA_get_data(group->extra_data, ec_pre_comp_dup, ec_pre_comp_free, ec_pre_comp_clear_free) != NULL) 881 if (EC_EX_DATA_get_data(group->extra_data, ec_pre_comp_dup, ec_pre_comp_free, ec_pre_comp_clear_free) != NULL)
diff --git a/src/lib/libcrypto/ec/ec_pmeth.c b/src/lib/libcrypto/ec/ec_pmeth.c
index 63e6359251..3637d6bba6 100644
--- a/src/lib/libcrypto/ec/ec_pmeth.c
+++ b/src/lib/libcrypto/ec/ec_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_pmeth.c,v 1.13 2021/12/04 16:08:32 tb Exp $ */ 1/* $OpenBSD: ec_pmeth.c,v 1.14 2022/11/19 07:00:57 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -93,7 +93,7 @@ typedef struct {
93 size_t kdf_outlen; 93 size_t kdf_outlen;
94} EC_PKEY_CTX; 94} EC_PKEY_CTX;
95 95
96static int 96static int
97pkey_ec_init(EVP_PKEY_CTX * ctx) 97pkey_ec_init(EVP_PKEY_CTX * ctx)
98{ 98{
99 EC_PKEY_CTX *dctx; 99 EC_PKEY_CTX *dctx;
@@ -111,7 +111,7 @@ pkey_ec_init(EVP_PKEY_CTX * ctx)
111 return 1; 111 return 1;
112} 112}
113 113
114static int 114static int
115pkey_ec_copy(EVP_PKEY_CTX * dst, EVP_PKEY_CTX * src) 115pkey_ec_copy(EVP_PKEY_CTX * dst, EVP_PKEY_CTX * src)
116{ 116{
117 EC_PKEY_CTX *dctx, *sctx; 117 EC_PKEY_CTX *dctx, *sctx;
@@ -146,7 +146,7 @@ pkey_ec_copy(EVP_PKEY_CTX * dst, EVP_PKEY_CTX * src)
146 return 1; 146 return 1;
147} 147}
148 148
149static void 149static void
150pkey_ec_cleanup(EVP_PKEY_CTX * ctx) 150pkey_ec_cleanup(EVP_PKEY_CTX * ctx)
151{ 151{
152 EC_PKEY_CTX *dctx = ctx->data; 152 EC_PKEY_CTX *dctx = ctx->data;
@@ -160,7 +160,7 @@ pkey_ec_cleanup(EVP_PKEY_CTX * ctx)
160 } 160 }
161} 161}
162 162
163static int 163static int
164pkey_ec_sign(EVP_PKEY_CTX * ctx, unsigned char *sig, size_t * siglen, 164pkey_ec_sign(EVP_PKEY_CTX * ctx, unsigned char *sig, size_t * siglen,
165 const unsigned char *tbs, size_t tbslen) 165 const unsigned char *tbs, size_t tbslen)
166{ 166{
@@ -188,7 +188,7 @@ pkey_ec_sign(EVP_PKEY_CTX * ctx, unsigned char *sig, size_t * siglen,
188 return 1; 188 return 1;
189} 189}
190 190
191static int 191static int
192pkey_ec_verify(EVP_PKEY_CTX * ctx, 192pkey_ec_verify(EVP_PKEY_CTX * ctx,
193 const unsigned char *sig, size_t siglen, 193 const unsigned char *sig, size_t siglen,
194 const unsigned char *tbs, size_t tbslen) 194 const unsigned char *tbs, size_t tbslen)
@@ -207,7 +207,7 @@ pkey_ec_verify(EVP_PKEY_CTX * ctx,
207 return ret; 207 return ret;
208} 208}
209 209
210static int 210static int
211pkey_ec_derive(EVP_PKEY_CTX * ctx, unsigned char *key, size_t * keylen) 211pkey_ec_derive(EVP_PKEY_CTX * ctx, unsigned char *key, size_t * keylen)
212{ 212{
213 int ret; 213 int ret;
@@ -283,7 +283,7 @@ pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)
283 return rv; 283 return rv;
284} 284}
285 285
286static int 286static int
287pkey_ec_ctrl(EVP_PKEY_CTX * ctx, int type, int p1, void *p2) 287pkey_ec_ctrl(EVP_PKEY_CTX * ctx, int type, int p1, void *p2)
288{ 288{
289 EC_PKEY_CTX *dctx = ctx->data; 289 EC_PKEY_CTX *dctx = ctx->data;
@@ -410,7 +410,7 @@ pkey_ec_ctrl(EVP_PKEY_CTX * ctx, int type, int p1, void *p2)
410 } 410 }
411} 411}
412 412
413static int 413static int
414pkey_ec_ctrl_str(EVP_PKEY_CTX * ctx, const char *type, const char *value) 414pkey_ec_ctrl_str(EVP_PKEY_CTX * ctx, const char *type, const char *value)
415{ 415{
416 if (!strcmp(type, "ec_paramgen_curve")) { 416 if (!strcmp(type, "ec_paramgen_curve")) {
@@ -449,7 +449,7 @@ pkey_ec_ctrl_str(EVP_PKEY_CTX * ctx, const char *type, const char *value)
449 return -2; 449 return -2;
450} 450}
451 451
452static int 452static int
453pkey_ec_paramgen(EVP_PKEY_CTX * ctx, EVP_PKEY * pkey) 453pkey_ec_paramgen(EVP_PKEY_CTX * ctx, EVP_PKEY * pkey)
454{ 454{
455 EC_KEY *ec = NULL; 455 EC_KEY *ec = NULL;
@@ -470,7 +470,7 @@ pkey_ec_paramgen(EVP_PKEY_CTX * ctx, EVP_PKEY * pkey)
470 return ret; 470 return ret;
471} 471}
472 472
473static int 473static int
474pkey_ec_keygen(EVP_PKEY_CTX * ctx, EVP_PKEY * pkey) 474pkey_ec_keygen(EVP_PKEY_CTX * ctx, EVP_PKEY * pkey)
475{ 475{
476 EC_KEY *ec = NULL; 476 EC_KEY *ec = NULL;
diff --git a/src/lib/libcrypto/ec/eck_prn.c b/src/lib/libcrypto/ec/eck_prn.c
index 058ae57de5..14185c7605 100644
--- a/src/lib/libcrypto/ec/eck_prn.c
+++ b/src/lib/libcrypto/ec/eck_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eck_prn.c,v 1.18 2022/11/10 12:37:00 tobhe Exp $ */ 1/* $OpenBSD: eck_prn.c,v 1.19 2022/11/19 07:00:57 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -69,7 +69,7 @@
69#include <openssl/err.h> 69#include <openssl/err.h>
70#include <openssl/evp.h> 70#include <openssl/evp.h>
71 71
72int 72int
73ECPKParameters_print_fp(FILE * fp, const EC_GROUP * x, int off) 73ECPKParameters_print_fp(FILE * fp, const EC_GROUP * x, int off)
74{ 74{
75 BIO *b; 75 BIO *b;
@@ -85,7 +85,7 @@ ECPKParameters_print_fp(FILE * fp, const EC_GROUP * x, int off)
85 return (ret); 85 return (ret);
86} 86}
87 87
88int 88int
89EC_KEY_print_fp(FILE * fp, const EC_KEY * x, int off) 89EC_KEY_print_fp(FILE * fp, const EC_KEY * x, int off)
90{ 90{
91 BIO *b; 91 BIO *b;
@@ -101,7 +101,7 @@ EC_KEY_print_fp(FILE * fp, const EC_KEY * x, int off)
101 return (ret); 101 return (ret);
102} 102}
103 103
104int 104int
105ECParameters_print_fp(FILE * fp, const EC_KEY * x) 105ECParameters_print_fp(FILE * fp, const EC_KEY * x)
106{ 106{
107 BIO *b; 107 BIO *b;
@@ -117,7 +117,7 @@ ECParameters_print_fp(FILE * fp, const EC_KEY * x)
117 return (ret); 117 return (ret);
118} 118}
119 119
120int 120int
121EC_KEY_print(BIO * bp, const EC_KEY * x, int off) 121EC_KEY_print(BIO * bp, const EC_KEY * x, int off)
122{ 122{
123 EVP_PKEY *pk; 123 EVP_PKEY *pk;
@@ -135,7 +135,7 @@ EC_KEY_print(BIO * bp, const EC_KEY * x, int off)
135 return ret; 135 return ret;
136} 136}
137 137
138int 138int
139ECParameters_print(BIO * bp, const EC_KEY * x) 139ECParameters_print(BIO * bp, const EC_KEY * x)
140{ 140{
141 EVP_PKEY *pk; 141 EVP_PKEY *pk;
@@ -153,11 +153,11 @@ ECParameters_print(BIO * bp, const EC_KEY * x)
153 return ret; 153 return ret;
154} 154}
155 155
156static int 156static int
157print_bin(BIO * fp, const char *str, const unsigned char *num, 157print_bin(BIO * fp, const char *str, const unsigned char *num,
158 size_t len, int off); 158 size_t len, int off);
159 159
160int 160int
161ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off) 161ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off)
162{ 162{
163 unsigned char *buffer = NULL; 163 unsigned char *buffer = NULL;
@@ -333,7 +333,7 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off)
333 return (ret); 333 return (ret);
334} 334}
335 335
336static int 336static int
337print_bin(BIO * fp, const char *name, const unsigned char *buf, 337print_bin(BIO * fp, const char *name, const unsigned char *buf,
338 size_t len, int off) 338 size_t len, int off)
339{ 339{
diff --git a/src/lib/libcrypto/ec/ecp_nistputil.c b/src/lib/libcrypto/ec/ecp_nistputil.c
index ca55b49ba2..fc4f9f5c26 100644
--- a/src/lib/libcrypto/ec/ecp_nistputil.c
+++ b/src/lib/libcrypto/ec/ecp_nistputil.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_nistputil.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: ecp_nistputil.c,v 1.7 2022/11/19 07:00:57 tb Exp $ */
2/* 2/*
3 * Written by Bodo Moeller for the OpenSSL project. 3 * Written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -43,7 +43,7 @@
43 * tmp_felems needs to point to a temporary array of 'num'+1 field elements 43 * tmp_felems needs to point to a temporary array of 'num'+1 field elements
44 * for storage of intermediate values. 44 * for storage of intermediate values.
45 */ 45 */
46void 46void
47ec_GFp_nistp_points_make_affine_internal(size_t num, void *point_array, 47ec_GFp_nistp_points_make_affine_internal(size_t num, void *point_array,
48 size_t felem_size, void *tmp_felems, 48 size_t felem_size, void *tmp_felems,
49 void (*felem_one) (void *out), 49 void (*felem_one) (void *out),
@@ -192,7 +192,7 @@ ec_GFp_nistp_points_make_affine_internal(size_t num, void *point_array,
192 * has to be b_4 b_3 b_2 b_1 b_0 0. 192 * has to be b_4 b_3 b_2 b_1 b_0 0.
193 * 193 *
194 */ 194 */
195void 195void
196ec_GFp_nistp_recode_scalar_bits(unsigned char *sign, unsigned char *digit, unsigned char in) 196ec_GFp_nistp_recode_scalar_bits(unsigned char *sign, unsigned char *digit, unsigned char in)
197{ 197{
198 unsigned char s, d; 198 unsigned char s, d;
diff --git a/src/lib/libcrypto/ec/ecp_nistz256.c b/src/lib/libcrypto/ec/ecp_nistz256.c
index dec7d31256..e4929b92bb 100644
--- a/src/lib/libcrypto/ec/ecp_nistz256.c
+++ b/src/lib/libcrypto/ec/ecp_nistz256.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_nistz256.c,v 1.11 2022/08/29 06:08:03 jsg Exp $ */ 1/* $OpenBSD: ecp_nistz256.c,v 1.12 2022/11/19 07:00:57 tb Exp $ */
2/* Copyright (c) 2014, Intel Corporation. 2/* Copyright (c) 2014, Intel Corporation.
3 * 3 *
4 * Permission to use, copy, modify, and/or distribute this software for any 4 * Permission to use, copy, modify, and/or distribute this software for any
@@ -897,7 +897,7 @@ ecp_nistz256_points_mul(const EC_GROUP *group, EC_POINT *r,
897 */ 897 */
898 BN_ULONG infty; 898 BN_ULONG infty;
899 infty = (p.p.X[0] | p.p.X[1] | p.p.X[2] | p.p.X[3] | 899 infty = (p.p.X[0] | p.p.X[1] | p.p.X[2] | p.p.X[3] |
900 p.p.Y[0] | p.p.Y[1] | p.p.Y[2] | p.p.Y[3]); 900 p.p.Y[0] | p.p.Y[1] | p.p.Y[2] | p.p.Y[3]);
901 if (P256_LIMBS == 8) 901 if (P256_LIMBS == 8)
902 infty |= 902 infty |=
903 (p.p.X[4] | p.p.X[5] | p.p.X[6] | p.p.X[7] | 903 (p.p.X[4] | p.p.X[5] | p.p.X[6] | p.p.X[7] |
diff --git a/src/lib/libcrypto/ec/ecp_oct.c b/src/lib/libcrypto/ec/ecp_oct.c
index 177bbe152e..1536b3ee90 100644
--- a/src/lib/libcrypto/ec/ecp_oct.c
+++ b/src/lib/libcrypto/ec/ecp_oct.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_oct.c,v 1.14 2021/04/20 17:32:57 tb Exp $ */ 1/* $OpenBSD: ecp_oct.c,v 1.15 2022/11/19 07:00:57 tb Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. 3 * for the OpenSSL project.
4 * Includes code written by Bodo Moeller for the OpenSSL project. 4 * Includes code written by Bodo Moeller for the OpenSSL project.
@@ -66,7 +66,7 @@
66 66
67#include "ec_lcl.h" 67#include "ec_lcl.h"
68 68
69int 69int
70ec_GFp_simple_set_compressed_coordinates(const EC_GROUP * group, 70ec_GFp_simple_set_compressed_coordinates(const EC_GROUP * group,
71 EC_POINT * point, const BIGNUM * x_, int y_bit, BN_CTX * ctx) 71 EC_POINT * point, const BIGNUM * x_, int y_bit, BN_CTX * ctx)
72{ 72{
@@ -197,7 +197,7 @@ ec_GFp_simple_set_compressed_coordinates(const EC_GROUP * group,
197} 197}
198 198
199 199
200size_t 200size_t
201ec_GFp_simple_point2oct(const EC_GROUP * group, const EC_POINT * point, point_conversion_form_t form, 201ec_GFp_simple_point2oct(const EC_GROUP * group, const EC_POINT * point, point_conversion_form_t form,
202 unsigned char *buf, size_t len, BN_CTX * ctx) 202 unsigned char *buf, size_t len, BN_CTX * ctx)
203{ 203{
@@ -302,7 +302,7 @@ ec_GFp_simple_point2oct(const EC_GROUP * group, const EC_POINT * point, point_co
302} 302}
303 303
304 304
305int 305int
306ec_GFp_simple_oct2point(const EC_GROUP * group, EC_POINT * point, 306ec_GFp_simple_oct2point(const EC_GROUP * group, EC_POINT * point,
307 const unsigned char *buf, size_t len, BN_CTX * ctx) 307 const unsigned char *buf, size_t len, BN_CTX * ctx)
308{ 308{
diff --git a/src/lib/libcrypto/ec/ecp_smpl.c b/src/lib/libcrypto/ec/ecp_smpl.c
index 6f5280bbc9..c9d73bd629 100644
--- a/src/lib/libcrypto/ec/ecp_smpl.c
+++ b/src/lib/libcrypto/ec/ecp_smpl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_smpl.c,v 1.34 2022/01/20 11:02:44 inoguchi Exp $ */ 1/* $OpenBSD: ecp_smpl.c,v 1.35 2022/11/19 07:00:57 tb Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. 3 * for the OpenSSL project.
4 * Includes code written by Bodo Moeller for the OpenSSL project. 4 * Includes code written by Bodo Moeller for the OpenSSL project.
@@ -1416,7 +1416,7 @@ ec_GFp_simple_field_sqr(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a, BN
1416/* 1416/*
1417 * Apply randomization of EC point projective coordinates: 1417 * Apply randomization of EC point projective coordinates:
1418 * 1418 *
1419 * (X, Y, Z) = (lambda^2 * X, lambda^3 * Y, lambda * Z) 1419 * (X, Y, Z) = (lambda^2 * X, lambda^3 * Y, lambda * Z)
1420 * 1420 *
1421 * where lambda is in the interval [1, group->field). 1421 * where lambda is in the interval [1, group->field).
1422 */ 1422 */
@@ -1473,14 +1473,14 @@ ec_GFp_simple_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx)
1473 1473
1474 1474
1475#define EC_POINT_BN_set_flags(P, flags) do { \ 1475#define EC_POINT_BN_set_flags(P, flags) do { \
1476 BN_set_flags(&(P)->X, (flags)); \ 1476 BN_set_flags(&(P)->X, (flags)); \
1477 BN_set_flags(&(P)->Y, (flags)); \ 1477 BN_set_flags(&(P)->Y, (flags)); \
1478 BN_set_flags(&(P)->Z, (flags)); \ 1478 BN_set_flags(&(P)->Z, (flags)); \
1479} while(0) 1479} while(0)
1480 1480
1481#define EC_POINT_CSWAP(c, a, b, w, t) do { \ 1481#define EC_POINT_CSWAP(c, a, b, w, t) do { \
1482 if (!BN_swap_ct(c, &(a)->X, &(b)->X, w) || \ 1482 if (!BN_swap_ct(c, &(a)->X, &(b)->X, w) || \
1483 !BN_swap_ct(c, &(a)->Y, &(b)->Y, w) || \ 1483 !BN_swap_ct(c, &(a)->Y, &(b)->Y, w) || \
1484 !BN_swap_ct(c, &(a)->Z, &(b)->Z, w)) \ 1484 !BN_swap_ct(c, &(a)->Z, &(b)->Z, w)) \
1485 goto err; \ 1485 goto err; \
1486 t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \ 1486 t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
diff --git a/src/lib/libcrypto/ec/ecx_methods.c b/src/lib/libcrypto/ec/ecx_methods.c
index 741cb2de6b..8829d8fdbc 100644
--- a/src/lib/libcrypto/ec/ecx_methods.c
+++ b/src/lib/libcrypto/ec/ecx_methods.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecx_methods.c,v 1.1 2022/11/10 16:37:52 jsing Exp $ */ 1/* $OpenBSD: ecx_methods.c,v 1.2 2022/11/19 07:00:57 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2022 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -676,7 +676,7 @@ ecx_item_verify(EVP_MD_CTX *md_ctx, const ASN1_ITEM *it, void *asn,
676{ 676{
677 const ASN1_OBJECT *aobj; 677 const ASN1_OBJECT *aobj;
678 int nid, param_type; 678 int nid, param_type;
679 679
680 X509_ALGOR_get0(&aobj, &param_type, NULL, algor); 680 X509_ALGOR_get0(&aobj, &param_type, NULL, algor);
681 681
682 nid = OBJ_obj2nid(aobj); 682 nid = OBJ_obj2nid(aobj);