From 78ee2250aeec46c91017c735712140d69474b903 Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Thu, 3 Jul 2014 22:14:40 -0400 Subject: [PATCH] Call cl_initialize_crypto() in cl_init() --- clambc/bcrun.c | 2 -- clamconf/clamconf.c | 2 -- clamd/clamd.c | 2 -- clamdscan/clamdscan.c | 2 -- freshclam/freshclam.c | 2 -- libclamav/others.c | 2 ++ sigtool/sigtool.c | 2 -- 7 files changed, 2 insertions(+), 12 deletions(-) diff --git a/clambc/bcrun.c b/clambc/bcrun.c index 0b75b8daca..0ac2ce8f9d 100644 --- a/clambc/bcrun.c +++ b/clambc/bcrun.c @@ -242,8 +242,6 @@ int main(int argc, char *argv[]) int fd = -1; unsigned tracelevel; - cl_initialize_crypto(); - if(check_flevel()) exit(1); diff --git a/clamconf/clamconf.c b/clamconf/clamconf.c index d50f8e37cd..3c7dcafda8 100644 --- a/clamconf/clamconf.c +++ b/clamconf/clamconf.c @@ -372,8 +372,6 @@ int main(int argc, char **argv) unsigned int i, j; struct cli_environment env; - cl_initialize_crypto(); - opts = optparse(NULL, argc, argv, 1, OPT_CLAMCONF, 0, NULL); if(!opts) { printf("ERROR: Can't parse command line options\n"); diff --git a/clamd/clamd.c b/clamd/clamd.c index 6fecd77679..ab48756a0d 100644 --- a/clamd/clamd.c +++ b/clamd/clamd.c @@ -137,8 +137,6 @@ int main(int argc, char **argv) sigaction(SIGUSR2, &sa, NULL); #endif - cl_initialize_crypto(); - if((opts = optparse(NULL, argc, argv, 1, OPT_CLAMD, 0, NULL)) == NULL) { mprintf("!Can't parse command line options\n"); return 1; diff --git a/clamdscan/clamdscan.c b/clamdscan/clamdscan.c index 59272f5218..f58e08dc91 100644 --- a/clamdscan/clamdscan.c +++ b/clamdscan/clamdscan.c @@ -68,8 +68,6 @@ int main(int argc, char **argv) struct sigaction sigact; #endif - cl_initialize_crypto(); - if((opts = optparse(NULL, argc, argv, 1, OPT_CLAMDSCAN, OPT_CLAMSCAN, NULL)) == NULL) { mprintf("!Can't parse command line options\n"); return 2; diff --git a/freshclam/freshclam.c b/freshclam/freshclam.c index d55f09dcd7..0b385f0a9c 100644 --- a/freshclam/freshclam.c +++ b/freshclam/freshclam.c @@ -298,8 +298,6 @@ main (int argc, char **argv) if (check_flevel ()) exit (FCE_INIT); - cl_initialize_crypto(); - if ((retcl = cl_init (CL_INIT_DEFAULT))) { mprintf ("!Can't initialize libclamav: %s\n", cl_strerror (retcl)); diff --git a/libclamav/others.c b/libclamav/others.c index 5b033693d2..8249969119 100644 --- a/libclamav/others.c +++ b/libclamav/others.c @@ -286,6 +286,8 @@ int cl_init(unsigned int initoptions) struct timeval tv; unsigned int pid = (unsigned int) getpid(); + cl_initialize_crypto(); + { unrar_main_header_t x; if (((char*)&x.flags - (char*)&x) != 3) { diff --git a/sigtool/sigtool.c b/sigtool/sigtool.c index 5169e4ac7c..7382a2def0 100644 --- a/sigtool/sigtool.c +++ b/sigtool/sigtool.c @@ -2991,8 +2991,6 @@ int main(int argc, char **argv) if(check_flevel()) exit(1); - cl_initialize_crypto(); - if((ret = cl_init(CL_INIT_DEFAULT)) != CL_SUCCESS) { mprintf("!Can't initialize libclamav: %s\n", cl_strerror(ret)); return -1;