summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ts/ts_conf.c
diff options
context:
space:
mode:
authortb <>2023-11-19 15:46:10 +0000
committertb <>2023-11-19 15:46:10 +0000
commit9e356d4225ee2dcd3e3eebabf384851ee547ec95 (patch)
tree9a8bf5329015d40f6a79820880c1ca7bb820bf58 /src/lib/libcrypto/ts/ts_conf.c
parentfea63fbd7eeaebeff6720b8ec754575f90e8eb77 (diff)
downloadopenbsd-9e356d4225ee2dcd3e3eebabf384851ee547ec95.tar.gz
openbsd-9e356d4225ee2dcd3e3eebabf384851ee547ec95.tar.bz2
openbsd-9e356d4225ee2dcd3e3eebabf384851ee547ec95.zip
Unifdef OPENSSL_NO_ENGINE in libcrypto
This is mechanical apart from a few manual edits to avoid doubled empty lines. ok jsing
Diffstat (limited to 'src/lib/libcrypto/ts/ts_conf.c')
-rw-r--r--src/lib/libcrypto/ts/ts_conf.c56
1 files changed, 1 insertions, 55 deletions
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 @@
1/* $OpenBSD: ts_conf.c,v 1.12 2023/07/07 07:25:21 beck Exp $ */ 1/* $OpenBSD: ts_conf.c,v 1.13 2023/11/19 15:46:10 tb Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -65,10 +65,6 @@
65#include <openssl/pem.h> 65#include <openssl/pem.h>
66#include <openssl/ts.h> 66#include <openssl/ts.h>
67 67
68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h>
70#endif
71
72/* Macro definitions for the configuration file. */ 68/* Macro definitions for the configuration file. */
73 69
74#define BASE_SECTION "tsa" 70#define BASE_SECTION "tsa"
@@ -211,56 +207,6 @@ err:
211} 207}
212LCRYPTO_ALIAS(TS_CONF_set_serial); 208LCRYPTO_ALIAS(TS_CONF_set_serial);
213 209
214#ifndef OPENSSL_NO_ENGINE
215
216int
217TS_CONF_set_crypto_device(CONF *conf, const char *section, const char *device)
218{
219 int ret = 0;
220
221 if (!device)
222 device = NCONF_get_string(conf, section, ENV_CRYPTO_DEVICE);
223
224 if (device && !TS_CONF_set_default_engine(device)) {
225 TS_CONF_invalid(section, ENV_CRYPTO_DEVICE);
226 goto err;
227 }
228 ret = 1;
229
230err:
231 return ret;
232}
233LCRYPTO_ALIAS(TS_CONF_set_crypto_device);
234
235int
236TS_CONF_set_default_engine(const char *name)
237{
238 ENGINE *e = NULL;
239 int ret = 0;
240
241 /* Leave the default if builtin specified. */
242 if (strcmp(name, "builtin") == 0)
243 return 1;
244
245 if (!(e = ENGINE_by_id(name)))
246 goto err;
247 /* All the operations are going to be carried out by the engine. */
248 if (!ENGINE_set_default(e, ENGINE_METHOD_ALL))
249 goto err;
250 ret = 1;
251
252err:
253 if (!ret) {
254 TSerror(TS_R_COULD_NOT_SET_ENGINE);
255 ERR_asprintf_error_data("engine:%s", name);
256 }
257 ENGINE_free(e);
258 return ret;
259}
260LCRYPTO_ALIAS(TS_CONF_set_default_engine);
261
262#endif
263
264int 210int
265TS_CONF_set_signer_cert(CONF *conf, const char *section, const char *cert, 211TS_CONF_set_signer_cert(CONF *conf, const char *section, const char *cert,
266 TS_RESP_CTX *ctx) 212 TS_RESP_CTX *ctx)