summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-04-25 19:26:45 +0000
committertb <>2023-04-25 19:26:45 +0000
commitd450bc3bc87081cdb0f831c070906e9ecf5fd137 (patch)
treea3af15f664ba745ec6f1dd24bd78b427fee17458 /src/lib
parent67debf20de785e46126aa900cfe4c5d7fd9ca7d8 (diff)
downloadopenbsd-d450bc3bc87081cdb0f831c070906e9ecf5fd137.tar.gz
openbsd-d450bc3bc87081cdb0f831c070906e9ecf5fd137.tar.bz2
openbsd-d450bc3bc87081cdb0f831c070906e9ecf5fd137.zip
Move EC_KEY_{insert,set}_key_method_data() to internal-only
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/ec/ec.h18
-rw-r--r--src/lib/libcrypto/ec/ec_local.h7
-rw-r--r--src/lib/libcrypto/ecdh/ech_lib.c6
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_lib.c6
4 files changed, 15 insertions, 22 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h
index 8ae40ed869..d67a1bfed7 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.35 2023/04/18 15:14:46 tb Exp $ */ 1/* $OpenBSD: ec.h,v 1.36 2023/04/25 19:26:45 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 */
@@ -821,22 +821,6 @@ void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
821point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key); 821point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
822void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform); 822void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
823 823
824#if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
825/* functions to set/get method specific data */
826void *EC_KEY_get_key_method_data(EC_KEY *key,
827 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
828/** Sets the key method data of an EC_KEY object, if none has yet been set.
829 * \param key EC_KEY object
830 * \param data opaque data to install.
831 * \param dup_func a function that duplicates |data|.
832 * \param free_func a function that frees |data|.
833 * \param clear_free_func a function that wipes and frees |data|.
834 * \return the previously set data pointer, or NULL if |data| was inserted.
835 */
836void *EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
837 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
838#endif
839
840/* wrapper functions for the underlying EC_GROUP object */ 824/* wrapper functions for the underlying EC_GROUP object */
841void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag); 825void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
842 826
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h
index d26ec47a24..95ef6fba7c 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.11 2023/03/08 05:45:31 jsing Exp $ */ 1/* $OpenBSD: ec_local.h,v 1.12 2023/04/25 19:26:45 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 */
@@ -407,4 +407,9 @@ int ossl_ecdsa_verify(int type, const unsigned char *dgst, int dgst_len,
407int ossl_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len, 407int ossl_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len,
408 const ECDSA_SIG *sig, EC_KEY *eckey); 408 const ECDSA_SIG *sig, EC_KEY *eckey);
409 409
410void *EC_KEY_get_key_method_data(EC_KEY *key,
411 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
412void *EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
413 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
414
410__END_HIDDEN_DECLS 415__END_HIDDEN_DECLS
diff --git a/src/lib/libcrypto/ecdh/ech_lib.c b/src/lib/libcrypto/ecdh/ech_lib.c
index 6caef5988f..15d7737c39 100644
--- a/src/lib/libcrypto/ecdh/ech_lib.c
+++ b/src/lib/libcrypto/ecdh/ech_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ech_lib.c,v 1.15 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: ech_lib.c,v 1.16 2023/04/25 19:26:45 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -71,12 +71,14 @@
71 71
72#include <openssl/opensslconf.h> 72#include <openssl/opensslconf.h>
73 73
74#include "ech_local.h"
75#ifndef OPENSSL_NO_ENGINE 74#ifndef OPENSSL_NO_ENGINE
76#include <openssl/engine.h> 75#include <openssl/engine.h>
77#endif 76#endif
78#include <openssl/err.h> 77#include <openssl/err.h>
79 78
79#include "ec_local.h"
80#include "ech_local.h"
81
80static const ECDH_METHOD *default_ECDH_method = NULL; 82static const ECDH_METHOD *default_ECDH_method = NULL;
81 83
82static void *ecdh_data_new(void); 84static void *ecdh_data_new(void);
diff --git a/src/lib/libcrypto/ecdsa/ecs_lib.c b/src/lib/libcrypto/ecdsa/ecs_lib.c
index 5c44c793ed..9a35a030db 100644
--- a/src/lib/libcrypto/ecdsa/ecs_lib.c
+++ b/src/lib/libcrypto/ecdsa/ecs_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_lib.c,v 1.16 2023/03/07 09:27:10 jsing Exp $ */ 1/* $OpenBSD: ecs_lib.c,v 1.17 2023/04/25 19:26:45 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -57,13 +57,15 @@
57 57
58#include <openssl/opensslconf.h> 58#include <openssl/opensslconf.h>
59 59
60#include "ecs_local.h"
61#ifndef OPENSSL_NO_ENGINE 60#ifndef OPENSSL_NO_ENGINE
62#include <openssl/engine.h> 61#include <openssl/engine.h>
63#endif 62#endif
64#include <openssl/err.h> 63#include <openssl/err.h>
65#include <openssl/bn.h> 64#include <openssl/bn.h>
66 65
66#include "ec_local.h"
67#include "ecs_local.h"
68
67static const ECDSA_METHOD *default_ECDSA_method = NULL; 69static const ECDSA_METHOD *default_ECDSA_method = NULL;
68 70
69static void *ecdsa_data_new(void); 71static void *ecdsa_data_new(void);