From 500ba3bf943245ebd4fb77b8691fdb06e51a615d Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 25 Jun 2023 19:04:35 +0000 Subject: 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. --- src/lib/libcrypto/ecdh/ech_key.c | 13 +------------ src/lib/libcrypto/ecdh/ech_lib.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/lib/libcrypto/ecdh') 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 @@ -/* $OpenBSD: ech_key.c,v 1.15 2023/06/25 18:41:36 tb Exp $ */ +/* $OpenBSD: ech_key.c,v 1.16 2023/06/25 19:04:35 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -189,17 +189,6 @@ err: return (ret); } -static ECDH_METHOD openssl_ecdh_meth = { - .name = "OpenSSL ECDH method", - .compute_key = ossl_ecdh_compute_key, -}; - -const ECDH_METHOD * -ECDH_OpenSSL(void) -{ - return &openssl_ecdh_meth; -} - int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, 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 @@ -/* $OpenBSD: ech_lib.c,v 1.19 2023/06/25 18:45:56 tb Exp $ */ +/* $OpenBSD: ech_lib.c,v 1.20 2023/06/25 19:04:35 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -81,6 +81,17 @@ static const ECDH_METHOD *default_ECDH_method = NULL; +static const ECDH_METHOD openssl_ecdh_meth = { + .name = "OpenSSL ECDH method", + .compute_key = ossl_ecdh_compute_key, +}; + +const ECDH_METHOD * +ECDH_OpenSSL(void) +{ + return &openssl_ecdh_meth; +} + void ECDH_set_default_method(const ECDH_METHOD *meth) { -- cgit v1.2.3-55-g6feb