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/ec | |
| 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/ec')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_key.c | 18 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/ec_kmeth.c | 27 |
2 files changed, 2 insertions, 43 deletions
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 @@ | |||
| 1 | /* $OpenBSD: ec_key.c,v 1.37 2023/08/03 18:53:56 tb Exp $ */ | 1 | /* $OpenBSD: ec_key.c,v 1.38 2023/11/19 15:46:09 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -65,9 +65,6 @@ | |||
| 65 | 65 | ||
| 66 | #include <openssl/opensslconf.h> | 66 | #include <openssl/opensslconf.h> |
| 67 | 67 | ||
| 68 | #ifndef OPENSSL_NO_ENGINE | ||
| 69 | #include <openssl/engine.h> | ||
| 70 | #endif | ||
| 71 | #include <openssl/err.h> | 68 | #include <openssl/err.h> |
| 72 | 69 | ||
| 73 | #include "bn_local.h" | 70 | #include "bn_local.h" |
| @@ -115,9 +112,6 @@ EC_KEY_free(EC_KEY *r) | |||
| 115 | if (r->meth != NULL && r->meth->finish != NULL) | 112 | if (r->meth != NULL && r->meth->finish != NULL) |
| 116 | r->meth->finish(r); | 113 | r->meth->finish(r); |
| 117 | 114 | ||
| 118 | #ifndef OPENSSL_NO_ENGINE | ||
| 119 | ENGINE_finish(r->engine); | ||
| 120 | #endif | ||
| 121 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data); | 115 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data); |
| 122 | 116 | ||
| 123 | EC_GROUP_free(r->group); | 117 | EC_GROUP_free(r->group); |
| @@ -138,11 +132,6 @@ EC_KEY_copy(EC_KEY *dest, const EC_KEY *src) | |||
| 138 | if (src->meth != dest->meth) { | 132 | if (src->meth != dest->meth) { |
| 139 | if (dest->meth != NULL && dest->meth->finish != NULL) | 133 | if (dest->meth != NULL && dest->meth->finish != NULL) |
| 140 | dest->meth->finish(dest); | 134 | dest->meth->finish(dest); |
| 141 | #ifndef OPENSSL_NO_ENGINE | ||
| 142 | if (ENGINE_finish(dest->engine) == 0) | ||
| 143 | return 0; | ||
| 144 | dest->engine = NULL; | ||
| 145 | #endif | ||
| 146 | } | 135 | } |
| 147 | /* copy the parameters */ | 136 | /* copy the parameters */ |
| 148 | if (src->group) { | 137 | if (src->group) { |
| @@ -186,11 +175,6 @@ EC_KEY_copy(EC_KEY *dest, const EC_KEY *src) | |||
| 186 | return NULL; | 175 | return NULL; |
| 187 | 176 | ||
| 188 | if (src->meth != dest->meth) { | 177 | if (src->meth != dest->meth) { |
| 189 | #ifndef OPENSSL_NO_ENGINE | ||
| 190 | if (src->engine != NULL && ENGINE_init(src->engine) == 0) | ||
| 191 | return 0; | ||
| 192 | dest->engine = src->engine; | ||
| 193 | #endif | ||
| 194 | dest->meth = src->meth; | 178 | dest->meth = src->meth; |
| 195 | } | 179 | } |
| 196 | 180 | ||
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 @@ | |||
| 1 | /* $OpenBSD: ec_kmeth.c,v 1.12 2023/07/28 09:28:37 tb Exp $ */ | 1 | /* $OpenBSD: ec_kmeth.c,v 1.13 2023/11/19 15:46:09 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 4 | * project. | 4 | * project. |
| @@ -53,9 +53,6 @@ | |||
| 53 | */ | 53 | */ |
| 54 | 54 | ||
| 55 | #include <openssl/ec.h> | 55 | #include <openssl/ec.h> |
| 56 | #ifndef OPENSSL_NO_ENGINE | ||
| 57 | #include <openssl/engine.h> | ||
| 58 | #endif | ||
| 59 | #include <openssl/err.h> | 56 | #include <openssl/err.h> |
| 60 | 57 | ||
| 61 | #include "bn_local.h" | 58 | #include "bn_local.h" |
| @@ -126,11 +123,6 @@ EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth) | |||
| 126 | if (finish != NULL) | 123 | if (finish != NULL) |
| 127 | finish(key); | 124 | finish(key); |
| 128 | 125 | ||
| 129 | #ifndef OPENSSL_NO_ENGINE | ||
| 130 | ENGINE_finish(key->engine); | ||
| 131 | key->engine = NULL; | ||
| 132 | #endif | ||
| 133 | |||
| 134 | key->meth = meth; | 126 | key->meth = meth; |
| 135 | if (meth->init != NULL) | 127 | if (meth->init != NULL) |
| 136 | return meth->init(key); | 128 | return meth->init(key); |
| @@ -148,23 +140,6 @@ EC_KEY_new_method(ENGINE *engine) | |||
| 148 | return NULL; | 140 | return NULL; |
| 149 | } | 141 | } |
| 150 | ret->meth = EC_KEY_get_default_method(); | 142 | ret->meth = EC_KEY_get_default_method(); |
| 151 | #ifndef OPENSSL_NO_ENGINE | ||
| 152 | if (engine != NULL) { | ||
| 153 | if (!ENGINE_init(engine)) { | ||
| 154 | ECerror(ERR_R_ENGINE_LIB); | ||
| 155 | goto err; | ||
| 156 | } | ||
| 157 | ret->engine = engine; | ||
| 158 | } else | ||
| 159 | ret->engine = ENGINE_get_default_EC(); | ||
| 160 | if (ret->engine) { | ||
| 161 | ret->meth = ENGINE_get_EC(ret->engine); | ||
| 162 | if (ret->meth == NULL) { | ||
| 163 | ECerror(ERR_R_ENGINE_LIB); | ||
| 164 | goto err; | ||
| 165 | } | ||
| 166 | } | ||
| 167 | #endif | ||
| 168 | ret->version = 1; | 143 | ret->version = 1; |
| 169 | ret->flags = 0; | 144 | ret->flags = 0; |
| 170 | ret->group = NULL; | 145 | ret->group = NULL; |
