diff options
author | tb <> | 2023-11-19 15:46:10 +0000 |
---|---|---|
committer | tb <> | 2023-11-19 15:46:10 +0000 |
commit | 9e356d4225ee2dcd3e3eebabf384851ee547ec95 (patch) | |
tree | 9a8bf5329015d40f6a79820880c1ca7bb820bf58 /src/lib/libcrypto/dh | |
parent | fea63fbd7eeaebeff6720b8ec754575f90e8eb77 (diff) | |
download | openbsd-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/dh')
-rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index 8d63787689..90ce7625c6 100644 --- a/src/lib/libcrypto/dh/dh_lib.c +++ b/src/lib/libcrypto/dh/dh_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_lib.c,v 1.41 2023/08/13 12:09:14 tb Exp $ */ | 1 | /* $OpenBSD: dh_lib.c,v 1.42 2023/11/19 15:46:09 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 | * |
@@ -65,10 +65,6 @@ | |||
65 | #include <openssl/dh.h> | 65 | #include <openssl/dh.h> |
66 | #include <openssl/err.h> | 66 | #include <openssl/err.h> |
67 | 67 | ||
68 | #ifndef OPENSSL_NO_ENGINE | ||
69 | #include <openssl/engine.h> | ||
70 | #endif | ||
71 | |||
72 | #include "dh_local.h" | 68 | #include "dh_local.h" |
73 | 69 | ||
74 | static const DH_METHOD *default_DH_method = NULL; | 70 | static const DH_METHOD *default_DH_method = NULL; |
@@ -101,10 +97,6 @@ DH_set_method(DH *dh, const DH_METHOD *meth) | |||
101 | mtmp = dh->meth; | 97 | mtmp = dh->meth; |
102 | if (mtmp->finish) | 98 | if (mtmp->finish) |
103 | mtmp->finish(dh); | 99 | mtmp->finish(dh); |
104 | #ifndef OPENSSL_NO_ENGINE | ||
105 | ENGINE_finish(dh->engine); | ||
106 | dh->engine = NULL; | ||
107 | #endif | ||
108 | dh->meth = meth; | 100 | dh->meth = meth; |
109 | if (meth->init) | 101 | if (meth->init) |
110 | meth->init(dh); | 102 | meth->init(dh); |
@@ -133,24 +125,6 @@ DH_new_method(ENGINE *engine) | |||
133 | dh->flags = dh->meth->flags & ~DH_FLAG_NON_FIPS_ALLOW; | 125 | dh->flags = dh->meth->flags & ~DH_FLAG_NON_FIPS_ALLOW; |
134 | dh->references = 1; | 126 | dh->references = 1; |
135 | 127 | ||
136 | #ifndef OPENSSL_NO_ENGINE | ||
137 | if (engine != NULL) { | ||
138 | if (!ENGINE_init(engine)) { | ||
139 | DHerror(ERR_R_ENGINE_LIB); | ||
140 | goto err; | ||
141 | } | ||
142 | dh->engine = engine; | ||
143 | } else | ||
144 | dh->engine = ENGINE_get_default_DH(); | ||
145 | if (dh->engine != NULL) { | ||
146 | if ((dh->meth = ENGINE_get_DH(dh->engine)) == NULL) { | ||
147 | DHerror(ERR_R_ENGINE_LIB); | ||
148 | goto err; | ||
149 | } | ||
150 | dh->flags = dh->meth->flags & ~DH_FLAG_NON_FIPS_ALLOW; | ||
151 | } | ||
152 | #endif | ||
153 | |||
154 | if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, dh, &dh->ex_data)) | 128 | if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, dh, &dh->ex_data)) |
155 | goto err; | 129 | goto err; |
156 | if (dh->meth->init != NULL && !dh->meth->init(dh)) | 130 | if (dh->meth->init != NULL && !dh->meth->init(dh)) |
@@ -178,9 +152,6 @@ DH_free(DH *r) | |||
178 | 152 | ||
179 | if (r->meth != NULL && r->meth->finish != NULL) | 153 | if (r->meth != NULL && r->meth->finish != NULL) |
180 | r->meth->finish(r); | 154 | r->meth->finish(r); |
181 | #ifndef OPENSSL_NO_ENGINE | ||
182 | ENGINE_finish(r->engine); | ||
183 | #endif | ||
184 | 155 | ||
185 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data); | 156 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data); |
186 | 157 | ||