Browse code

Call cl_initialize_crypto() in cl_init()

Shawn Webb authored on 2014/07/04 11:14:40
Showing 7 changed files
... ...
@@ -242,8 +242,6 @@ int main(int argc, char *argv[])
242 242
     int fd = -1;
243 243
     unsigned tracelevel;
244 244
 
245
-    cl_initialize_crypto();
246
-
247 245
     if(check_flevel())
248 246
 	exit(1);
249 247
 
... ...
@@ -372,8 +372,6 @@ int main(int argc, char **argv)
372 372
 	unsigned int i, j;
373 373
 	struct cli_environment env;
374 374
 
375
-    cl_initialize_crypto();
376
-
377 375
     opts = optparse(NULL, argc, argv, 1, OPT_CLAMCONF, 0, NULL);
378 376
     if(!opts) {
379 377
 	printf("ERROR: Can't parse command line options\n");
... ...
@@ -137,8 +137,6 @@ int main(int argc, char **argv)
137 137
     sigaction(SIGUSR2, &sa, NULL);
138 138
 #endif
139 139
 
140
-    cl_initialize_crypto();
141
-
142 140
     if((opts = optparse(NULL, argc, argv, 1, OPT_CLAMD, 0, NULL)) == NULL) {
143 141
         mprintf("!Can't parse command line options\n");
144 142
         return 1;
... ...
@@ -68,8 +68,6 @@ int main(int argc, char **argv)
68 68
 	struct sigaction sigact;
69 69
 #endif
70 70
 
71
-    cl_initialize_crypto();
72
-
73 71
     if((opts = optparse(NULL, argc, argv, 1, OPT_CLAMDSCAN, OPT_CLAMSCAN, NULL)) == NULL) {
74 72
 	mprintf("!Can't parse command line options\n");
75 73
 	return 2;
... ...
@@ -298,8 +298,6 @@ main (int argc, char **argv)
298 298
     if (check_flevel ())
299 299
         exit (FCE_INIT);
300 300
 
301
-    cl_initialize_crypto();
302
-
303 301
     if ((retcl = cl_init (CL_INIT_DEFAULT)))
304 302
     {
305 303
         mprintf ("!Can't initialize libclamav: %s\n", cl_strerror (retcl));
... ...
@@ -286,6 +286,8 @@ int cl_init(unsigned int initoptions)
286 286
 	struct timeval tv;
287 287
 	unsigned int pid = (unsigned int) getpid();
288 288
 
289
+    cl_initialize_crypto();
290
+
289 291
     {
290 292
 	unrar_main_header_t x;
291 293
 	if (((char*)&x.flags - (char*)&x) != 3) {
... ...
@@ -2991,8 +2991,6 @@ int main(int argc, char **argv)
2991 2991
     if(check_flevel())
2992 2992
 	exit(1);
2993 2993
 
2994
-    cl_initialize_crypto();
2995
-
2996 2994
     if((ret = cl_init(CL_INIT_DEFAULT)) != CL_SUCCESS) {
2997 2995
 	mprintf("!Can't initialize libclamav: %s\n", cl_strerror(ret));
2998 2996
 	return -1;