summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec')
-rw-r--r--src/lib/libcrypto/ec/ec.h11
-rw-r--r--src/lib/libcrypto/ec/ec_err.c3
-rw-r--r--src/lib/libcrypto/ec/ec_kmeth.c10
-rw-r--r--src/lib/libcrypto/ec/ec_local.h10
4 files changed, 18 insertions, 16 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h
index 686f018a9d..85951f0b97 100644
--- a/src/lib/libcrypto/ec/ec.h
+++ b/src/lib/libcrypto/ec/ec.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec.h,v 1.44 2023/07/28 09:25:12 tb Exp $ */ 1/* $OpenBSD: ec.h,v 1.45 2023/07/28 09:28:37 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 */
@@ -368,8 +368,8 @@ void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth,
368void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth, 368void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth,
369 int (*keygen)(EC_KEY *key)); 369 int (*keygen)(EC_KEY *key));
370void EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth, 370void EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth,
371 int (*ckey)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, 371 int (*ckey)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key,
372 void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))); 372 const EC_KEY *ecdh));
373void EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth, 373void EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth,
374 int (*sign)(int type, const unsigned char *digest, int digest_len, 374 int (*sign)(int type, const unsigned char *digest, int digest_len,
375 unsigned char *signature, unsigned int *signature_len, 375 unsigned char *signature, unsigned int *signature_len,
@@ -392,8 +392,8 @@ void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth,
392void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, 392void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth,
393 int (**pkeygen)(EC_KEY *key)); 393 int (**pkeygen)(EC_KEY *key));
394void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, 394void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth,
395 int (**pck)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, 395 int (**pck)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key,
396 void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))); 396 const EC_KEY *ecdh));
397void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, 397void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth,
398 int (**psign)(int type, const unsigned char *digest, int digest_len, 398 int (**psign)(int type, const unsigned char *digest, int digest_len,
399 unsigned char *signature, unsigned int *signature_len, 399 unsigned char *signature, unsigned int *signature_len,
@@ -684,6 +684,7 @@ void ERR_load_EC_strings(void);
684#define EC_R_INVALID_FORM 104 684#define EC_R_INVALID_FORM 104
685#define EC_R_INVALID_GROUP_ORDER 122 685#define EC_R_INVALID_GROUP_ORDER 122
686#define EC_R_INVALID_KEY 165 686#define EC_R_INVALID_KEY 165
687#define EC_R_INVALID_OUTPUT_LENGTH 171
687#define EC_R_INVALID_PEER_KEY 152 688#define EC_R_INVALID_PEER_KEY 152
688#define EC_R_INVALID_PENTANOMIAL_BASIS 132 689#define EC_R_INVALID_PENTANOMIAL_BASIS 132
689#define EC_R_INVALID_PRIVATE_KEY 123 690#define EC_R_INVALID_PRIVATE_KEY 123
diff --git a/src/lib/libcrypto/ec/ec_err.c b/src/lib/libcrypto/ec/ec_err.c
index d797b937c2..9f2253dddd 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.17 2023/07/07 13:54:45 beck Exp $ */ 1/* $OpenBSD: ec_err.c,v 1.18 2023/07/28 09:28:37 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 *
@@ -98,6 +98,7 @@ static ERR_STRING_DATA EC_str_reasons[] =
98 {ERR_REASON(EC_R_INVALID_FORM), "invalid form"}, 98 {ERR_REASON(EC_R_INVALID_FORM), "invalid form"},
99 {ERR_REASON(EC_R_INVALID_GROUP_ORDER), "invalid group order"}, 99 {ERR_REASON(EC_R_INVALID_GROUP_ORDER), "invalid group order"},
100 {ERR_REASON(EC_R_INVALID_KEY), "invalid key"}, 100 {ERR_REASON(EC_R_INVALID_KEY), "invalid key"},
101 {ERR_REASON(EC_R_INVALID_OUTPUT_LENGTH), "invalid output length"},
101 {ERR_REASON(EC_R_INVALID_PEER_KEY), "invalid peer key"}, 102 {ERR_REASON(EC_R_INVALID_PEER_KEY), "invalid peer key"},
102 {ERR_REASON(EC_R_INVALID_PENTANOMIAL_BASIS), "invalid pentanomial basis"}, 103 {ERR_REASON(EC_R_INVALID_PENTANOMIAL_BASIS), "invalid pentanomial basis"},
103 {ERR_REASON(EC_R_INVALID_PRIVATE_KEY), "invalid private key"}, 104 {ERR_REASON(EC_R_INVALID_PRIVATE_KEY), "invalid private key"},
diff --git a/src/lib/libcrypto/ec/ec_kmeth.c b/src/lib/libcrypto/ec/ec_kmeth.c
index 3e997f8a5e..38aca0028e 100644
--- a/src/lib/libcrypto/ec/ec_kmeth.c
+++ b/src/lib/libcrypto/ec/ec_kmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_kmeth.c,v 1.11 2023/07/07 13:54:45 beck Exp $ */ 1/* $OpenBSD: ec_kmeth.c,v 1.12 2023/07/28 09:28:37 tb Exp $ */
2/* 2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
4 * project. 4 * project.
@@ -238,8 +238,8 @@ LCRYPTO_ALIAS(EC_KEY_METHOD_set_keygen);
238 238
239void 239void
240EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth, 240EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth,
241 int (*ckey)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, 241 int (*ckey)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key,
242 void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))) 242 const EC_KEY *ecdh))
243{ 243{
244 meth->compute_key = ckey; 244 meth->compute_key = ckey;
245} 245}
@@ -310,8 +310,8 @@ LCRYPTO_ALIAS(EC_KEY_METHOD_get_keygen);
310 310
311void 311void
312EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, 312EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth,
313 int (**pck)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, 313 int (**pck)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key,
314 void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))) 314 const EC_KEY *ecdh))
315{ 315{
316 if (pck != NULL) 316 if (pck != NULL)
317 *pck = meth->compute_key; 317 *pck = meth->compute_key;
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h
index 7a1f90886d..8153d4a96a 100644
--- a/src/lib/libcrypto/ec/ec_local.h
+++ b/src/lib/libcrypto/ec/ec_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_local.h,v 1.24 2023/07/05 08:39:40 tb Exp $ */ 1/* $OpenBSD: ec_local.h,v 1.25 2023/07/28 09:28:37 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 */
@@ -323,8 +323,8 @@ struct ec_key_method_st {
323 int (*set_private)(EC_KEY *key, const BIGNUM *priv_key); 323 int (*set_private)(EC_KEY *key, const BIGNUM *priv_key);
324 int (*set_public)(EC_KEY *key, const EC_POINT *pub_key); 324 int (*set_public)(EC_KEY *key, const EC_POINT *pub_key);
325 int (*keygen)(EC_KEY *key); 325 int (*keygen)(EC_KEY *key);
326 int (*compute_key)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, 326 int (*compute_key)(unsigned char **out, size_t *out_len,
327 void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen)); 327 const EC_POINT *pub_key, const EC_KEY *ecdh);
328 int (*sign)(int type, const unsigned char *dgst, int dlen, unsigned char 328 int (*sign)(int type, const unsigned char *dgst, int dlen, unsigned char
329 *sig, unsigned int *siglen, const BIGNUM *kinv, 329 *sig, unsigned int *siglen, const BIGNUM *kinv,
330 const BIGNUM *r, EC_KEY *eckey); 330 const BIGNUM *r, EC_KEY *eckey);
@@ -342,8 +342,8 @@ struct ec_key_method_st {
342#define EC_KEY_METHOD_DYNAMIC 1 342#define EC_KEY_METHOD_DYNAMIC 1
343 343
344int ec_key_gen(EC_KEY *eckey); 344int ec_key_gen(EC_KEY *eckey);
345int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, 345int ecdh_compute_key(unsigned char **out, size_t *out_len,
346 void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen)); 346 const EC_POINT *pub_key, const EC_KEY *ecdh);
347int ecdsa_verify(int type, const unsigned char *dgst, int dgst_len, 347int ecdsa_verify(int type, const unsigned char *dgst, int dgst_len,
348 const unsigned char *sigbuf, int sig_len, EC_KEY *eckey); 348 const unsigned char *sigbuf, int sig_len, EC_KEY *eckey);
349int ecdsa_verify_sig(const unsigned char *dgst, int dgst_len, 349int ecdsa_verify_sig(const unsigned char *dgst, int dgst_len,