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/ts/ts.h | 7 +----- src/lib/libcrypto/ts/ts_conf.c | 56 +----------------------------------------- 2 files changed, 2 insertions(+), 61 deletions(-) (limited to 'src/lib/libcrypto/ts') diff --git a/src/lib/libcrypto/ts/ts.h b/src/lib/libcrypto/ts/ts.h index 0d5de6223c..5215fc0583 100644 --- a/src/lib/libcrypto/ts/ts.h +++ b/src/lib/libcrypto/ts/ts.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ts.h,v 1.22 2023/07/28 09:53:55 tb Exp $ */ +/* $OpenBSD: ts.h,v 1.23 2023/11/19 15:46:10 tb Exp $ */ /* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL * project 2002, 2003, 2004. */ @@ -542,11 +542,6 @@ EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass); const char *TS_CONF_get_tsa_section(CONF *conf, const char *section); int TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb, TS_RESP_CTX *ctx); -#ifndef OPENSSL_NO_ENGINE -int TS_CONF_set_crypto_device(CONF *conf, const char *section, - const char *device); -int TS_CONF_set_default_engine(const char *name); -#endif int TS_CONF_set_signer_cert(CONF *conf, const char *section, const char *cert, TS_RESP_CTX *ctx); int TS_CONF_set_certs(CONF *conf, const char *section, const char *certs, diff --git a/src/lib/libcrypto/ts/ts_conf.c b/src/lib/libcrypto/ts/ts_conf.c index 103d430272..5d27a8bbc3 100644 --- a/src/lib/libcrypto/ts/ts_conf.c +++ b/src/lib/libcrypto/ts/ts_conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts_conf.c,v 1.12 2023/07/07 07:25:21 beck Exp $ */ +/* $OpenBSD: ts_conf.c,v 1.13 2023/11/19 15:46:10 tb Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -65,10 +65,6 @@ #include #include -#ifndef OPENSSL_NO_ENGINE -#include -#endif - /* Macro definitions for the configuration file. */ #define BASE_SECTION "tsa" @@ -211,56 +207,6 @@ err: } LCRYPTO_ALIAS(TS_CONF_set_serial); -#ifndef OPENSSL_NO_ENGINE - -int -TS_CONF_set_crypto_device(CONF *conf, const char *section, const char *device) -{ - int ret = 0; - - if (!device) - device = NCONF_get_string(conf, section, ENV_CRYPTO_DEVICE); - - if (device && !TS_CONF_set_default_engine(device)) { - TS_CONF_invalid(section, ENV_CRYPTO_DEVICE); - goto err; - } - ret = 1; - -err: - return ret; -} -LCRYPTO_ALIAS(TS_CONF_set_crypto_device); - -int -TS_CONF_set_default_engine(const char *name) -{ - ENGINE *e = NULL; - int ret = 0; - - /* Leave the default if builtin specified. */ - if (strcmp(name, "builtin") == 0) - return 1; - - if (!(e = ENGINE_by_id(name))) - goto err; - /* All the operations are going to be carried out by the engine. */ - if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) - goto err; - ret = 1; - -err: - if (!ret) { - TSerror(TS_R_COULD_NOT_SET_ENGINE); - ERR_asprintf_error_data("engine:%s", name); - } - ENGINE_free(e); - return ret; -} -LCRYPTO_ALIAS(TS_CONF_set_default_engine); - -#endif - int TS_CONF_set_signer_cert(CONF *conf, const char *section, const char *cert, TS_RESP_CTX *ctx) -- cgit v1.2.3-55-g6feb