Browse code

Properly initialize the crypto interfaces on Windows platforms

Shawn Webb authored on 2014/03/08 04:09:46
Showing 5 changed files
... ...
@@ -139,6 +139,8 @@ int main(int argc, char **argv)
139 139
     sa.sa_handler = SIG_IGN;
140 140
     sigaction(SIGHUP, &sa, NULL);
141 141
     sigaction(SIGUSR2, &sa, NULL);
142
+#else
143
+    cl_initialize_crypto();
142 144
 #endif
143 145
 
144 146
     if((opts = optparse(NULL, argc, argv, 1, OPT_CLAMD, 0, NULL)) == NULL) {
... ...
@@ -65,6 +65,10 @@ int main(int argc, char **argv)
65 65
 	struct sigaction sigact;
66 66
 #endif
67 67
 
68
+#if defined(_WIN32)
69
+    cl_initialize_crypto();
70
+#endif
71
+
68 72
     if((opts = optparse(NULL, argc, argv, 1, OPT_CLAMDSCAN, OPT_CLAMSCAN, NULL)) == NULL) {
69 73
 	mprintf("!Can't parse command line options\n");
70 74
 	return 2;
... ...
@@ -80,6 +80,10 @@ int main(int argc, char **argv)
80 80
     sigprocmask(SIG_SETMASK, &sigset, NULL);
81 81
 #endif
82 82
 
83
+#if defined(_WIN32)
84
+    cl_initialize_crypto();
85
+#endif
86
+
83 87
 
84 88
     if((opts = optparse(NULL, argc, argv, 1, OPT_CLAMSCAN, 0, NULL)) == NULL) {
85 89
 	mprintf("!Can't parse command line options\n");
... ...
@@ -302,6 +302,10 @@ main (int argc, char **argv)
302 302
     if (check_flevel ())
303 303
         exit (FCE_INIT);
304 304
 
305
+#if defined(_WIN32)
306
+    cl_initialize_crypto();
307
+#endif
308
+
305 309
     if ((retcl = cl_init (CL_INIT_DEFAULT)))
306 310
     {
307 311
         mprintf ("!Can't initialize libclamav: %s\n", cl_strerror (retcl));
... ...
@@ -2995,6 +2995,10 @@ int main(int argc, char **argv)
2995 2995
     if(check_flevel())
2996 2996
 	exit(1);
2997 2997
 
2998
+#if defined(_WIN32)
2999
+    cl_initialize_crypto();
3000
+#endif
3001
+
2998 3002
     if((ret = cl_init(CL_INIT_DEFAULT)) != CL_SUCCESS) {
2999 3003
 	mprintf("!Can't initialize libclamav: %s\n", cl_strerror(ret));
3000 3004
 	return -1;