summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ecdh
diff options
context:
space:
mode:
authortb <>2023-06-25 19:04:35 +0000
committertb <>2023-06-25 19:04:35 +0000
commit500ba3bf943245ebd4fb77b8691fdb06e51a615d (patch)
treeaf87b42bf5227888532aa40b6a65f2a288988c84 /src/lib/libcrypto/ecdh
parent70d8987d04d28fe256835167778ab28f3e6bdd3c (diff)
downloadopenbsd-500ba3bf943245ebd4fb77b8691fdb06e51a615d.tar.gz
openbsd-500ba3bf943245ebd4fb77b8691fdb06e51a615d.tar.bz2
openbsd-500ba3bf943245ebd4fb77b8691fdb06e51a615d.zip
Move ECDH_OpenSSL() ECDSA_OpenSSL() to *_lib.c
Now that they no longer use static methods, they can move where they belong. Also make the static method const, as it should have been all along.
Diffstat (limited to 'src/lib/libcrypto/ecdh')
-rw-r--r--src/lib/libcrypto/ecdh/ech_key.c13
-rw-r--r--src/lib/libcrypto/ecdh/ech_lib.c13
2 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c
index 108a5ff8f6..5f68b01860 100644
--- a/src/lib/libcrypto/ecdh/ech_key.c
+++ b/src/lib/libcrypto/ecdh/ech_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ech_key.c,v 1.15 2023/06/25 18:41:36 tb Exp $ */ 1/* $OpenBSD: ech_key.c,v 1.16 2023/06/25 19:04:35 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -189,17 +189,6 @@ err:
189 return (ret); 189 return (ret);
190} 190}
191 191
192static ECDH_METHOD openssl_ecdh_meth = {
193 .name = "OpenSSL ECDH method",
194 .compute_key = ossl_ecdh_compute_key,
195};
196
197const ECDH_METHOD *
198ECDH_OpenSSL(void)
199{
200 return &openssl_ecdh_meth;
201}
202
203int 192int
204ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, 193ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
205 EC_KEY *eckey, 194 EC_KEY *eckey,
diff --git a/src/lib/libcrypto/ecdh/ech_lib.c b/src/lib/libcrypto/ecdh/ech_lib.c
index f062ec3fdc..d968793208 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.19 2023/06/25 18:45:56 tb Exp $ */ 1/* $OpenBSD: ech_lib.c,v 1.20 2023/06/25 19:04:35 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -81,6 +81,17 @@
81 81
82static const ECDH_METHOD *default_ECDH_method = NULL; 82static const ECDH_METHOD *default_ECDH_method = NULL;
83 83
84static const ECDH_METHOD openssl_ecdh_meth = {
85 .name = "OpenSSL ECDH method",
86 .compute_key = ossl_ecdh_compute_key,
87};
88
89const ECDH_METHOD *
90ECDH_OpenSSL(void)
91{
92 return &openssl_ecdh_meth;
93}
94
84void 95void
85ECDH_set_default_method(const ECDH_METHOD *meth) 96ECDH_set_default_method(const ECDH_METHOD *meth)
86{ 97{