@@ -26,7 +26,6 @@ static int ssl_initialized = 0;
2626static char * ssl_global_rand_file = NULL ;
2727extern apr_pool_t * tcn_global_pool ;
2828
29- ENGINE * tcn_ssl_engine = NULL ;
3029tcn_pass_cb_t tcn_password_callback ;
3130
3231static BIO * key_log_file = NULL ;
@@ -78,14 +77,6 @@ static apr_status_t ssl_init_cleanup(void *data)
7877
7978 free_bio_methods ();
8079
81- #ifndef OPENSSL_NO_ENGINE
82- if (tcn_ssl_engine != NULL ) {
83- /* Release the SSL Engine structural reference */
84- ENGINE_free (tcn_ssl_engine );
85- tcn_ssl_engine = NULL ;
86- }
87- #endif
88-
8980 /* Openssl v1.1+ handles all termination automatically. */
9081
9182 if (key_log_file ) {
@@ -105,22 +96,6 @@ static apr_status_t ssl_init_cleanup(void *data)
10596 return APR_SUCCESS ;
10697}
10798
108- #ifndef OPENSSL_NO_ENGINE
109- /* Try to load an engine in a shareable library */
110- static ENGINE * ssl_try_load_engine (const char * engine )
111- {
112- ENGINE * e = ENGINE_by_id ("dynamic" );
113- if (e ) {
114- if (!ENGINE_ctrl_cmd_string (e , "SO_PATH" , engine , 0 )
115- || !ENGINE_ctrl_cmd_string (e , "LOAD" , NULL , 0 )) {
116- ENGINE_free (e );
117- e = NULL ;
118- }
119- }
120- return e ;
121- }
122- #endif
123-
12499/*
125100 * To ensure thread-safetyness in LibreSSL
126101 */
@@ -205,9 +180,6 @@ TCN_IMPLEMENT_CALL(jint, SSL, initialize)(TCN_STDARGS, jstring engine)
205180{
206181 jclass clazz ;
207182 jclass sClazz ;
208- #if !defined(OPENSSL_NO_ENGINE )
209- apr_status_t err = APR_SUCCESS ;
210- #endif
211183
212184 TCN_ALLOC_CSTRING (engine );
213185
@@ -222,41 +194,6 @@ TCN_IMPLEMENT_CALL(jint, SSL, initialize)(TCN_STDARGS, jstring engine)
222194 TCN_FREE_CSTRING (engine );
223195 return (jint )APR_SUCCESS ;
224196 }
225- /* Openssl v1.1+ handles all initialisation automatically, apart
226- * from hints as to how we want to use the library.
227- *
228- * We tell openssl we want to include engine support.
229- */
230- OPENSSL_init_ssl (OPENSSL_INIT_ENGINE_ALL_BUILTIN , NULL );
231-
232- #ifndef OPENSSL_NO_ENGINE
233- if (J2S (engine )) {
234- ENGINE * ee = NULL ;
235- if (strcmp (J2S (engine ), "auto" ) == 0 ) {
236- ENGINE_register_all_complete ();
237- }
238- else {
239- if ((ee = ENGINE_by_id (J2S (engine ))) == NULL
240- && (ee = ssl_try_load_engine (J2S (engine ))) == NULL )
241- err = APR_ENOTIMPL ;
242- else {
243- #ifdef ENGINE_CTRL_CHIL_SET_FORKCHECK
244- if (strcmp (J2S (engine ), "chil" ) == 0 )
245- ENGINE_ctrl (ee , ENGINE_CTRL_CHIL_SET_FORKCHECK , 1 , 0 , 0 );
246- #endif
247- if (!ENGINE_set_default (ee , ENGINE_METHOD_ALL ))
248- err = APR_ENOTIMPL ;
249- }
250- }
251- if (err != APR_SUCCESS ) {
252- TCN_FREE_CSTRING (engine );
253- ssl_init_cleanup (NULL );
254- tcn_ThrowAPRException (e , err );
255- return (jint )err ;
256- }
257- tcn_ssl_engine = ee ;
258- }
259- #endif
260197
261198 memset (& tcn_password_callback , 0 , sizeof (tcn_pass_cb_t ));
262199 /* Initialize PRNG
0 commit comments