summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-11-16 10:30:49 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-11-16 10:30:49 +0000
commit3ed82a1a9b75bca5cc682b6c4592b7ba1530a340 (patch)
tree5b3aba52b7e37b9864557a1a8ba3aeddc4408cb6
parentbe35ad05711194820f5255328ec8ef589bc60acb (diff)
Move the default EC_KEY_METHOD to the end of the file
-rw-r--r--lib/libcrypto/ec/ec_kmeth.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/lib/libcrypto/ec/ec_kmeth.c b/lib/libcrypto/ec/ec_kmeth.c
index fa79b9a29f4..6795af8bbf8 100644
--- a/lib/libcrypto/ec/ec_kmeth.c
+++ b/lib/libcrypto/ec/ec_kmeth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_kmeth.c,v 1.14 2024/08/03 13:06:37 tb Exp $ */
+/* $OpenBSD: ec_kmeth.c,v 1.15 2024/11/16 10:30:48 tb Exp $ */
/*
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
@@ -59,55 +59,6 @@
#include "ec_local.h"
#include "ecdsa_local.h"
-static const EC_KEY_METHOD openssl_ec_key_method = {
- .name = "OpenSSL EC_KEY method",
- .flags = 0,
-
- .init = NULL,
- .finish = NULL,
- .copy = NULL,
-
- .set_group = NULL,
- .set_private = NULL,
- .set_public = NULL,
-
- .keygen = ec_key_gen,
- .compute_key = ecdh_compute_key,
-
- .sign = ecdsa_sign,
- .sign_setup = ecdsa_sign_setup,
- .sign_sig = ecdsa_sign_sig,
-
- .verify = ecdsa_verify,
- .verify_sig = ecdsa_verify_sig,
-};
-
-const EC_KEY_METHOD *default_ec_key_meth = &openssl_ec_key_method;
-
-const EC_KEY_METHOD *
-EC_KEY_OpenSSL(void)
-{
- return &openssl_ec_key_method;
-}
-LCRYPTO_ALIAS(EC_KEY_OpenSSL);
-
-const EC_KEY_METHOD *
-EC_KEY_get_default_method(void)
-{
- return default_ec_key_meth;
-}
-LCRYPTO_ALIAS(EC_KEY_get_default_method);
-
-void
-EC_KEY_set_default_method(const EC_KEY_METHOD *meth)
-{
- if (meth == NULL)
- default_ec_key_meth = &openssl_ec_key_method;
- else
- default_ec_key_meth = meth;
-}
-LCRYPTO_ALIAS(EC_KEY_set_default_method);
-
const EC_KEY_METHOD *
EC_KEY_get_method(const EC_KEY *key)
{
@@ -326,3 +277,52 @@ EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth,
*pverify_sig = meth->verify_sig;
}
LCRYPTO_ALIAS(EC_KEY_METHOD_get_verify);
+
+static const EC_KEY_METHOD openssl_ec_key_method = {
+ .name = "OpenSSL EC_KEY method",
+ .flags = 0,
+
+ .init = NULL,
+ .finish = NULL,
+ .copy = NULL,
+
+ .set_group = NULL,
+ .set_private = NULL,
+ .set_public = NULL,
+
+ .keygen = ec_key_gen,
+ .compute_key = ecdh_compute_key,
+
+ .sign = ecdsa_sign,
+ .sign_setup = ecdsa_sign_setup,
+ .sign_sig = ecdsa_sign_sig,
+
+ .verify = ecdsa_verify,
+ .verify_sig = ecdsa_verify_sig,
+};
+
+const EC_KEY_METHOD *default_ec_key_meth = &openssl_ec_key_method;
+
+const EC_KEY_METHOD *
+EC_KEY_OpenSSL(void)
+{
+ return &openssl_ec_key_method;
+}
+LCRYPTO_ALIAS(EC_KEY_OpenSSL);
+
+const EC_KEY_METHOD *
+EC_KEY_get_default_method(void)
+{
+ return default_ec_key_meth;
+}
+LCRYPTO_ALIAS(EC_KEY_get_default_method);
+
+void
+EC_KEY_set_default_method(const EC_KEY_METHOD *meth)
+{
+ if (meth == NULL)
+ default_ec_key_meth = &openssl_ec_key_method;
+ else
+ default_ec_key_meth = meth;
+}
+LCRYPTO_ALIAS(EC_KEY_set_default_method);