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/rsa/rsa_lib.c | |
| 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/rsa/rsa_lib.c')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_lib.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c index fbd2c2274c..b379cddc07 100644 --- a/src/lib/libcrypto/rsa/rsa_lib.c +++ b/src/lib/libcrypto/rsa/rsa_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa_lib.c,v 1.48 2023/07/28 10:05:16 tb Exp $ */ | 1 | /* $OpenBSD: rsa_lib.c,v 1.49 2023/11/19 15:46:10 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -71,10 +71,6 @@ | |||
| 71 | #include "evp_local.h" | 71 | #include "evp_local.h" |
| 72 | #include "rsa_local.h" | 72 | #include "rsa_local.h" |
| 73 | 73 | ||
| 74 | #ifndef OPENSSL_NO_ENGINE | ||
| 75 | #include <openssl/engine.h> | ||
| 76 | #endif | ||
| 77 | |||
| 78 | static const RSA_METHOD *default_RSA_meth = NULL; | 74 | static const RSA_METHOD *default_RSA_meth = NULL; |
| 79 | 75 | ||
| 80 | RSA * | 76 | RSA * |
| @@ -122,10 +118,6 @@ RSA_set_method(RSA *rsa, const RSA_METHOD *meth) | |||
| 122 | mtmp = rsa->meth; | 118 | mtmp = rsa->meth; |
| 123 | if (mtmp->finish) | 119 | if (mtmp->finish) |
| 124 | mtmp->finish(rsa); | 120 | mtmp->finish(rsa); |
| 125 | #ifndef OPENSSL_NO_ENGINE | ||
| 126 | ENGINE_finish(rsa->engine); | ||
| 127 | rsa->engine = NULL; | ||
| 128 | #endif | ||
| 129 | rsa->meth = meth; | 121 | rsa->meth = meth; |
| 130 | if (meth->init) | 122 | if (meth->init) |
| 131 | meth->init(rsa); | 123 | meth->init(rsa); |
| @@ -145,25 +137,6 @@ RSA_new_method(ENGINE *engine) | |||
| 145 | 137 | ||
| 146 | ret->meth = RSA_get_default_method(); | 138 | ret->meth = RSA_get_default_method(); |
| 147 | 139 | ||
| 148 | #ifndef OPENSSL_NO_ENGINE | ||
| 149 | if (engine != NULL) { | ||
| 150 | if (!ENGINE_init(engine)) { | ||
| 151 | RSAerror(ERR_R_ENGINE_LIB); | ||
| 152 | goto err; | ||
| 153 | } | ||
| 154 | ret->engine = engine; | ||
| 155 | } else { | ||
| 156 | ret->engine = ENGINE_get_default_RSA(); | ||
| 157 | } | ||
| 158 | |||
| 159 | if (ret->engine != NULL) { | ||
| 160 | if ((ret->meth = ENGINE_get_RSA(ret->engine)) == NULL) { | ||
| 161 | RSAerror(ERR_R_ENGINE_LIB); | ||
| 162 | goto err; | ||
| 163 | } | ||
| 164 | } | ||
| 165 | #endif | ||
| 166 | |||
| 167 | ret->references = 1; | 140 | ret->references = 1; |
| 168 | ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW; | 141 | ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW; |
| 169 | 142 | ||
| @@ -178,9 +151,6 @@ RSA_new_method(ENGINE *engine) | |||
| 178 | return ret; | 151 | return ret; |
| 179 | 152 | ||
| 180 | err: | 153 | err: |
| 181 | #ifndef OPENSSL_NO_ENGINE | ||
| 182 | ENGINE_finish(ret->engine); | ||
| 183 | #endif | ||
| 184 | free(ret); | 154 | free(ret); |
| 185 | 155 | ||
| 186 | return NULL; | 156 | return NULL; |
| @@ -201,9 +171,6 @@ RSA_free(RSA *r) | |||
| 201 | 171 | ||
| 202 | if (r->meth->finish) | 172 | if (r->meth->finish) |
| 203 | r->meth->finish(r); | 173 | r->meth->finish(r); |
| 204 | #ifndef OPENSSL_NO_ENGINE | ||
| 205 | ENGINE_finish(r->engine); | ||
| 206 | #endif | ||
| 207 | 174 | ||
| 208 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data); | 175 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data); |
| 209 | 176 | ||
