diff options
| author | tb <> | 2023-11-19 15:46:10 +0000 |
|---|---|---|
| committer | tb <> | 2023-11-19 15:46:10 +0000 |
| commit | 593d97e74cc873d99aced677883cf55625efe62d (patch) | |
| tree | 9a8bf5329015d40f6a79820880c1ca7bb820bf58 /src/lib/libcrypto/ts | |
| parent | cde35b41c5eb9d9d0b61fe730c39e6a5c553b840 (diff) | |
| download | openbsd-593d97e74cc873d99aced677883cf55625efe62d.tar.gz openbsd-593d97e74cc873d99aced677883cf55625efe62d.tar.bz2 openbsd-593d97e74cc873d99aced677883cf55625efe62d.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')
| -rw-r--r-- | src/lib/libcrypto/ts/ts.h | 7 | ||||
| -rw-r--r-- | src/lib/libcrypto/ts/ts_conf.c | 56 |
2 files changed, 2 insertions, 61 deletions
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 @@ | |||
| 1 | /* $OpenBSD: ts.h,v 1.22 2023/07/28 09:53:55 tb Exp $ */ | 1 | /* $OpenBSD: ts.h,v 1.23 2023/11/19 15:46:10 tb Exp $ */ |
| 2 | /* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL | 2 | /* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL |
| 3 | * project 2002, 2003, 2004. | 3 | * project 2002, 2003, 2004. |
| 4 | */ | 4 | */ |
| @@ -542,11 +542,6 @@ EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass); | |||
| 542 | const char *TS_CONF_get_tsa_section(CONF *conf, const char *section); | 542 | const char *TS_CONF_get_tsa_section(CONF *conf, const char *section); |
| 543 | int TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb, | 543 | int TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb, |
| 544 | TS_RESP_CTX *ctx); | 544 | TS_RESP_CTX *ctx); |
| 545 | #ifndef OPENSSL_NO_ENGINE | ||
| 546 | int TS_CONF_set_crypto_device(CONF *conf, const char *section, | ||
| 547 | const char *device); | ||
| 548 | int TS_CONF_set_default_engine(const char *name); | ||
| 549 | #endif | ||
| 550 | int TS_CONF_set_signer_cert(CONF *conf, const char *section, | 545 | int TS_CONF_set_signer_cert(CONF *conf, const char *section, |
| 551 | const char *cert, TS_RESP_CTX *ctx); | 546 | const char *cert, TS_RESP_CTX *ctx); |
| 552 | int TS_CONF_set_certs(CONF *conf, const char *section, const char *certs, | 547 | 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 @@ | |||
| 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 | } |
| 212 | LCRYPTO_ALIAS(TS_CONF_set_serial); | 208 | LCRYPTO_ALIAS(TS_CONF_set_serial); |
| 213 | 209 | ||
| 214 | #ifndef OPENSSL_NO_ENGINE | ||
| 215 | |||
| 216 | int | ||
| 217 | TS_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 | |||
| 230 | err: | ||
| 231 | return ret; | ||
| 232 | } | ||
| 233 | LCRYPTO_ALIAS(TS_CONF_set_crypto_device); | ||
| 234 | |||
| 235 | int | ||
| 236 | TS_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 | |||
| 252 | err: | ||
| 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 | } | ||
| 260 | LCRYPTO_ALIAS(TS_CONF_set_default_engine); | ||
| 261 | |||
| 262 | #endif | ||
| 263 | |||
| 264 | int | 210 | int |
| 265 | TS_CONF_set_signer_cert(CONF *conf, const char *section, const char *cert, | 211 | TS_CONF_set_signer_cert(CONF *conf, const char *section, const char *cert, |
| 266 | TS_RESP_CTX *ctx) | 212 | TS_RESP_CTX *ctx) |
