From: Rosen Penev Date: Sun, 10 Mar 2019 09:26:11 +0000 (+0100) Subject: Load OpenSSL engines X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31a8424aa35b6601154190a6f473ba82cd61857a;p=thirdparty%2Ftvheadend.git Load OpenSSL engines --- diff --git a/src/main.c b/src/main.c index a6770e236..6d3c84046 100644 --- a/src/main.c +++ b/src/main.c @@ -98,7 +98,7 @@ typedef struct { enum { OPT_STR, OPT_INT, - OPT_BOOL, + OPT_BOOL, OPT_STR_LIST, } type; void *param; @@ -526,7 +526,7 @@ show_usage free(desc); } } - printf("%s", + printf("%s", _("\n" "For more information please visit the Tvheadend website:\n" "https://tvheadend.org\n")); @@ -615,7 +615,7 @@ mtimer_thread(void *aux) next = now + sec2mono(3600); while((mti = LIST_FIRST(&mtimers)) != NULL) { - + if (mti->mti_expire > now) { next = mti->mti_expire; break; @@ -648,7 +648,7 @@ mtimer_thread(void *aux) tvh_cond_timedwait(&mtimer_cond, &global_lock, next); pthread_mutex_unlock(&global_lock); } - + return NULL; } @@ -678,7 +678,7 @@ mainloop(void) // TODO: there is a risk that if timers re-insert themselves to // the top of the list with a 0 offset we could loop indefinitely - + #if 0 tvhdebug(LS_GTIMER, "now %"PRItime_t, ts.tv_sec); LIST_FOREACH(gti, >imers, gti_link) @@ -686,7 +686,7 @@ mainloop(void) #endif while((gti = LIST_FIRST(>imers)) != NULL) { - + if (gti->gti_expire > now) { ts.tv_sec = gti->gti_expire; break; @@ -1033,12 +1033,12 @@ main(int argc, char **argv) } if (opt_log_debug) log_debug = opt_log_debug; - + tvhlog_init(log_level, log_options, opt_logpath); tvhlog_set_debug(log_debug); tvhlog_set_trace(log_trace); tvhinfo(LS_MAIN, "Log started"); - + signal(SIGPIPE, handle_sigpipe); // will be redundant later signal(SIGILL, handle_sigill); // see handler.. @@ -1144,7 +1144,7 @@ main(int argc, char **argv) tvhlog_options &= ~TVHLOG_OPT_STDERR; if (!isatty(2)) tvhlog_options &= ~TVHLOG_OPT_DECORATE; - + /* Initialise clock */ pthread_mutex_lock(&global_lock); __mdispatch_clock = getmonoclock(); @@ -1159,6 +1159,12 @@ main(int argc, char **argv) OPENSSL_config(NULL); SSL_load_error_strings(); SSL_library_init(); + + #ifndef OPENSSL_NO_ENGINE + /* ENGINE init */ + ENGINE_load_builtin_engines(); + #endif + /* Rand seed */ randseed.thread_id = (void *)main_tid; gettimeofday(&randseed.tv, NULL); @@ -1345,7 +1351,7 @@ main(int argc, char **argv) if(opt_fork) unlink(opt_pidpath); - + /* OpenSSL - welcome to the "cleanup" hell */ ENGINE_cleanup(); RAND_cleanup();