From 9e356d4225ee2dcd3e3eebabf384851ee547ec95 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 19 Nov 2023 15:46:10 +0000 Subject: Unifdef OPENSSL_NO_ENGINE in libcrypto This is mechanical apart from a few manual edits to avoid doubled empty lines. ok jsing --- src/lib/libcrypto/ec/ec_key.c | 18 +----------------- src/lib/libcrypto/ec/ec_kmeth.c | 27 +-------------------------- 2 files changed, 2 insertions(+), 43 deletions(-) (limited to 'src/lib/libcrypto/ec') diff --git a/src/lib/libcrypto/ec/ec_key.c b/src/lib/libcrypto/ec/ec_key.c index d9ddd5d797..2716db6dd0 100644 --- a/src/lib/libcrypto/ec/ec_key.c +++ b/src/lib/libcrypto/ec/ec_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_key.c,v 1.37 2023/08/03 18:53:56 tb Exp $ */ +/* $OpenBSD: ec_key.c,v 1.38 2023/11/19 15:46:09 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -65,9 +65,6 @@ #include -#ifndef OPENSSL_NO_ENGINE -#include -#endif #include #include "bn_local.h" @@ -115,9 +112,6 @@ EC_KEY_free(EC_KEY *r) if (r->meth != NULL && r->meth->finish != NULL) r->meth->finish(r); -#ifndef OPENSSL_NO_ENGINE - ENGINE_finish(r->engine); -#endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data); EC_GROUP_free(r->group); @@ -138,11 +132,6 @@ EC_KEY_copy(EC_KEY *dest, const EC_KEY *src) if (src->meth != dest->meth) { if (dest->meth != NULL && dest->meth->finish != NULL) dest->meth->finish(dest); -#ifndef OPENSSL_NO_ENGINE - if (ENGINE_finish(dest->engine) == 0) - return 0; - dest->engine = NULL; -#endif } /* copy the parameters */ if (src->group) { @@ -186,11 +175,6 @@ EC_KEY_copy(EC_KEY *dest, const EC_KEY *src) return NULL; if (src->meth != dest->meth) { -#ifndef OPENSSL_NO_ENGINE - if (src->engine != NULL && ENGINE_init(src->engine) == 0) - return 0; - dest->engine = src->engine; -#endif dest->meth = src->meth; } diff --git a/src/lib/libcrypto/ec/ec_kmeth.c b/src/lib/libcrypto/ec/ec_kmeth.c index 38aca0028e..856afc89dc 100644 --- a/src/lib/libcrypto/ec/ec_kmeth.c +++ b/src/lib/libcrypto/ec/ec_kmeth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_kmeth.c,v 1.12 2023/07/28 09:28:37 tb Exp $ */ +/* $OpenBSD: ec_kmeth.c,v 1.13 2023/11/19 15:46:09 tb Exp $ */ /* * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. @@ -53,9 +53,6 @@ */ #include -#ifndef OPENSSL_NO_ENGINE -#include -#endif #include #include "bn_local.h" @@ -126,11 +123,6 @@ EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth) if (finish != NULL) finish(key); -#ifndef OPENSSL_NO_ENGINE - ENGINE_finish(key->engine); - key->engine = NULL; -#endif - key->meth = meth; if (meth->init != NULL) return meth->init(key); @@ -148,23 +140,6 @@ EC_KEY_new_method(ENGINE *engine) return NULL; } ret->meth = EC_KEY_get_default_method(); -#ifndef OPENSSL_NO_ENGINE - if (engine != NULL) { - if (!ENGINE_init(engine)) { - ECerror(ERR_R_ENGINE_LIB); - goto err; - } - ret->engine = engine; - } else - ret->engine = ENGINE_get_default_EC(); - if (ret->engine) { - ret->meth = ENGINE_get_EC(ret->engine); - if (ret->meth == NULL) { - ECerror(ERR_R_ENGINE_LIB); - goto err; - } - } -#endif ret->version = 1; ret->flags = 0; ret->group = NULL; -- cgit v1.2.3-55-g6feb