summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_lib.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/dsa/dsa_lib.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/dsa/dsa_lib.c')
-rw-r--r--src/lib/libcrypto/dsa/dsa_lib.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_lib.c b/src/lib/libcrypto/dsa/dsa_lib.c
index a9d2179aeb..5c01c20255 100644
--- a/src/lib/libcrypto/dsa/dsa_lib.c
+++ b/src/lib/libcrypto/dsa/dsa_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_lib.c,v 1.44 2023/08/12 06:14:36 tb Exp $ */ 1/* $OpenBSD: dsa_lib.c,v 1.45 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 *
@@ -70,9 +70,6 @@
70#ifndef OPENSSL_NO_DH 70#ifndef OPENSSL_NO_DH
71#include <openssl/dh.h> 71#include <openssl/dh.h>
72#endif 72#endif
73#ifndef OPENSSL_NO_ENGINE
74#include <openssl/engine.h>
75#endif
76 73
77#include "dh_local.h" 74#include "dh_local.h"
78#include "dsa_local.h" 75#include "dsa_local.h"
@@ -113,10 +110,6 @@ DSA_set_method(DSA *dsa, const DSA_METHOD *meth)
113 mtmp = dsa->meth; 110 mtmp = dsa->meth;
114 if (mtmp->finish) 111 if (mtmp->finish)
115 mtmp->finish(dsa); 112 mtmp->finish(dsa);
116#ifndef OPENSSL_NO_ENGINE
117 ENGINE_finish(dsa->engine);
118 dsa->engine = NULL;
119#endif
120 dsa->meth = meth; 113 dsa->meth = meth;
121 if (meth->init) 114 if (meth->init)
122 meth->init(dsa); 115 meth->init(dsa);
@@ -138,24 +131,6 @@ DSA_new_method(ENGINE *engine)
138 dsa->flags = dsa->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW; 131 dsa->flags = dsa->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
139 dsa->references = 1; 132 dsa->references = 1;
140 133
141#ifndef OPENSSL_NO_ENGINE
142 if (engine) {
143 if (!ENGINE_init(engine)) {
144 DSAerror(ERR_R_ENGINE_LIB);
145 goto err;
146 }
147 dsa->engine = engine;
148 } else
149 dsa->engine = ENGINE_get_default_DSA();
150 if (dsa->engine != NULL) {
151 if ((dsa->meth = ENGINE_get_DSA(dsa->engine)) == NULL) {
152 DSAerror(ERR_R_ENGINE_LIB);
153 goto err;
154 }
155 dsa->flags = dsa->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
156 }
157#endif
158
159 if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, dsa, &dsa->ex_data)) 134 if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, dsa, &dsa->ex_data))
160 goto err; 135 goto err;
161 if (dsa->meth->init != NULL && !dsa->meth->init(dsa)) 136 if (dsa->meth->init != NULL && !dsa->meth->init(dsa))
@@ -184,9 +159,6 @@ DSA_free(DSA *r)
184 159
185 if (r->meth != NULL && r->meth->finish != NULL) 160 if (r->meth != NULL && r->meth->finish != NULL)
186 r->meth->finish(r); 161 r->meth->finish(r);
187#ifndef OPENSSL_NO_ENGINE
188 ENGINE_finish(r->engine);
189#endif
190 162
191 CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data); 163 CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
192 164