Browse code

Move all the crypto API to clamav.h

Shawn Webb authored on 2014/07/02 08:38:01
Showing 173 changed files
... ...
@@ -34,10 +34,6 @@
34 34
 #include <time.h>
35 35
 #include <libmilter/mfapi.h>
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
41 37
 #include "clamav.h"
42 38
 
43 39
 #include "shared/output.h"
... ...
@@ -33,10 +33,7 @@
33 33
 
34 34
 #include <libmilter/mfapi.h>
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
36
+#include "libclamav/clamav.h"
40 37
 #include "shared/optparser.h"
41 38
 #include "shared/output.h"
42 39
 #include "libclamav/others.h"
... ...
@@ -42,10 +42,7 @@
42 42
 #include <netdb.h>
43 43
 #include <sys/uio.h>
44 44
 
45
-#include <openssl/ssl.h>
46
-#include <openssl/err.h>
47
-#include "libclamav/crypto.h"
48
-
45
+#include "libclamav/clamav.h"
49 46
 #include "shared/output.h"
50 47
 #include "shared/optparser.h"
51 48
 #include "libclamav/others.h"
... ...
@@ -28,10 +28,6 @@
28 28
 #endif
29 29
 #include <stdlib.h>
30 30
 
31
-#include <openssl/ssl.h>
32
-#include <openssl/err.h>
33
-#include "libclamav/crypto.h"
34
-
35 31
 #include "bytecode.h"
36 32
 #include "bytecode_priv.h"
37 33
 #include "clamav.h"
... ...
@@ -35,10 +35,6 @@
35 35
 #include <sys/stat.h>
36 36
 #include <dirent.h>
37 37
 
38
-#include <openssl/ssl.h>
39
-#include <openssl/err.h>
40
-#include "libclamav/crypto.h"
41
-
42 38
 #include "shared/optparser.h"
43 39
 #include "shared/misc.h"
44 40
 
... ...
@@ -53,10 +53,6 @@
53 53
 #include <sys/resource.h>
54 54
 #endif
55 55
 
56
-#include <openssl/ssl.h>
57
-#include <openssl/err.h>
58
-#include "libclamav/crypto.h"
59
-
60 56
 #include "target.h"
61 57
 
62 58
 #include "libclamav/clamav.h"
... ...
@@ -36,10 +36,6 @@
36 36
 
37 37
 #include <sys/fanotify.h>
38 38
 
39
-#include <openssl/ssl.h>
40
-#include <openssl/err.h>
41
-#include "libclamav/crypto.h"
42
-
43 39
 #include "fan.h"
44 40
 
45 41
 #include "libclamav/clamav.h"
... ...
@@ -236,10 +232,6 @@ void *fan_th(void *arg)
236 236
 #include <string.h>
237 237
 #include <errno.h>
238 238
 
239
-#include <openssl/ssl.h>
240
-#include <openssl/err.h>
241
-#include "libclamav/crypto.h"
242
-
243 239
 #include "libclamav/clamav.h"
244 240
 #include "libclamav/scanners.h"
245 241
 
... ...
@@ -65,11 +65,8 @@
65 65
 #endif /* HAVE_POLL_H */
66 66
 #endif /* HAVE_POLL */
67 67
 
68
-#include <openssl/ssl.h>
69
-#include <openssl/err.h>
70
-#include "libclamav/crypto.h"
71
-
72 68
 #include <limits.h>
69
+#include "libclamav/clamav.h"
73 70
 #include "shared/optparser.h"
74 71
 #include "shared/output.h"
75 72
 #include "shared/misc.h"
... ...
@@ -49,10 +49,6 @@
49 49
 #include <stddef.h>
50 50
 #endif
51 51
 
52
-#include <openssl/ssl.h>
53
-#include <openssl/err.h>
54
-#include "libclamav/crypto.h"
55
-
56 52
 #include "libclamav/clamav.h"
57 53
 #include "libclamav/others.h"
58 54
 #include "libclamav/scanners.h"
... ...
@@ -40,10 +40,6 @@
40 40
 #include <unistd.h>
41 41
 #endif
42 42
 
43
-#include <openssl/ssl.h>
44
-#include <openssl/err.h>
45
-#include "libclamav/crypto.h"
46
-
47 43
 #include <fcntl.h>
48 44
 #ifdef C_SOLARIS
49 45
 #include <stdio_ext.h>
... ...
@@ -49,10 +49,6 @@
49 49
 #include <stddef.h>
50 50
 #include <limits.h>
51 51
 
52
-#include <openssl/ssl.h>
53
-#include <openssl/err.h>
54
-#include "libclamav/crypto.h"
55
-
56 52
 #include "libclamav/clamav.h"
57 53
 #include "libclamav/str.h"
58 54
 #include "libclamav/others.h"
... ...
@@ -29,12 +29,9 @@
29 29
 #include <errno.h>
30 30
 #include <string.h>
31 31
 
32
-#include <openssl/ssl.h>
33
-#include <openssl/err.h>
34
-#include "libclamav/crypto.h"
35
-
36 32
 #include "shared/output.h"
37 33
 
34
+#include "libclamav/clamav.h"
38 35
 #include "thrmgr.h"
39 36
 #include "others.h"
40 37
 #include "mpool.h"
... ...
@@ -36,10 +36,7 @@
36 36
 
37 37
 #include "clamav.h"
38 38
 
39
-#include <openssl/ssl.h>
40
-#include <openssl/err.h>
41
-#include "libclamav/crypto.h"
42
-
39
+#include "libclamav/clamav.h"
43 40
 #include "shared/output.h"
44 41
 #include "shared/misc.h"
45 42
 #include "shared/optparser.h"
... ...
@@ -52,10 +52,7 @@
52 52
 #include <sys/uio.h>
53 53
 #endif
54 54
 
55
-#include <openssl/ssl.h>
56
-#include <openssl/err.h>
57
-#include "libclamav/crypto.h"
58
-
55
+#include "libclamav/clamav.h"
59 56
 #include "shared/optparser.h"
60 57
 #include "shared/output.h"
61 58
 #include "shared/misc.h"
... ...
@@ -48,10 +48,7 @@
48 48
 #include <netdb.h>
49 49
 #endif
50 50
 
51
-#include <openssl/ssl.h>
52
-#include <openssl/err.h>
53
-#include "libclamav/crypto.h"
54
-
51
+#include "libclamav/clamav.h"
55 52
 #include "libclamav/others.h"
56 53
 #include "shared/actions.h"
57 54
 #include "shared/output.h"
... ...
@@ -38,10 +38,6 @@
38 38
 #include <sys/resource.h>
39 39
 #endif
40 40
 
41
-#include <openssl/ssl.h>
42
-#include <openssl/err.h>
43
-#include "libclamav/crypto.h"
44
-
45 41
 #include "others.h"
46 42
 #include "global.h"
47 43
 #include "manager.h"
... ...
@@ -48,10 +48,6 @@
48 48
 #include <errno.h>
49 49
 #include <target.h>
50 50
 
51
-#include <openssl/ssl.h>
52
-#include <openssl/err.h>
53
-#include "libclamav/crypto.h"
54
-
55 51
 #include "manager.h"
56 52
 #include "global.h"
57 53
 
... ...
@@ -3,10 +3,6 @@
3 3
 #include <unistd.h>
4 4
 #include <string.h>
5 5
 
6
-#include <openssl/ssl.h>
7
-#include <openssl/err.h>
8
-#include "libclamav/crypto.h"
9
-
10 6
 #include <curl/curl.h>
11 7
 
12 8
 #include "libclamav/clamav.h"
... ...
@@ -46,10 +46,6 @@
46 46
 #include <syslog.h>
47 47
 #endif
48 48
 
49
-#include <openssl/ssl.h>
50
-#include <openssl/err.h>
51
-#include "libclamav/crypto.h"
52
-
53 49
 #include "target.h"
54 50
 #include "clamav.h"
55 51
 #include "freshclamcodes.h"
... ...
@@ -60,10 +60,6 @@
60 60
 #include <errno.h>
61 61
 #include <zlib.h>
62 62
 
63
-#include <openssl/ssl.h>
64
-#include <openssl/err.h>
65
-#include "libclamav/crypto.h"
66
-
67 63
 #include "target.h"
68 64
 
69 65
 #include "freshclamcodes.h"
... ...
@@ -6,10 +6,6 @@
6 6
 #include <Windows.h>
7 7
 #endif
8 8
 
9
-#include <openssl/ssl.h>
10
-#include <openssl/err.h>
11
-#include "libclamav/crypto.h"
12
-
13 9
 #include "7zCrc.h"
14 10
 #include "CpuArch.h"
15 11
 
... ...
@@ -6,10 +6,6 @@
6 6
 #include <Windows.h>
7 7
 #endif
8 8
 
9
-#include <openssl/ssl.h>
10
-#include <openssl/err.h>
11
-#include "libclamav/crypto.h"
12
-
13 9
 #include "CpuArch.h"
14 10
 
15 11
 #ifdef MY_CPU_LE
... ...
@@ -8,10 +8,6 @@
8 8
 #include <Windows.h>
9 9
 #endif
10 10
 
11
-#include <openssl/ssl.h>
12
-#include <openssl/err.h>
13
-#include "libclamav/crypto.h"
14
-
15 11
 #define _7ZIP_PPMD_SUPPPORT
16 12
 
17 13
 #include "7z.h"
... ...
@@ -8,10 +8,6 @@
8 8
 #include <Windows.h>
9 9
 #endif
10 10
 
11
-#include <openssl/ssl.h>
12
-#include <openssl/err.h>
13
-#include "libclamav/crypto.h"
14
-
15 11
 #include "7z.h"
16 12
 #include "7zCrc.h"
17 13
 #include "CpuArch.h"
... ...
@@ -6,10 +6,6 @@
6 6
 #include <Windows.h>
7 7
 #endif
8 8
 
9
-#include <openssl/ssl.h>
10
-#include <openssl/err.h>
11
-#include "libclamav/crypto.h"
12
-
13 9
 #include "CpuArch.h"
14 10
 
15 11
 #ifdef MY_CPU_X86_OR_AMD64
... ...
@@ -4,10 +4,6 @@ This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
4 4
 
5 5
 #include <memory.h>
6 6
 
7
-#include <openssl/ssl.h>
8
-#include <openssl/err.h>
9
-#include "libclamav/crypto.h"
10
-
11 7
 #include "Ppmd7.h"
12 8
 
13 9
 const Byte PPMD7_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 };
... ...
@@ -2,10 +2,6 @@
2 2
 2010-03-12 : Igor Pavlov : Public domain
3 3
 This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
4 4
 
5
-#include <openssl/ssl.h>
6
-#include <openssl/err.h>
7
-#include "libclamav/crypto.h"
8
-
9 5
 #include "Ppmd7.h"
10 6
 
11 7
 #define kTopValue (1 << 24)
... ...
@@ -6,10 +6,6 @@
6 6
 #include <Windows.h>
7 7
 #endif
8 8
 
9
-#include <openssl/ssl.h>
10
-#include <openssl/err.h>
11
-#include "libclamav/crypto.h"
12
-
13 9
 #include "7zCrc.h"
14 10
 #include "CpuArch.h"
15 11
 #include "Xz.h"
... ...
@@ -15,10 +15,7 @@
15 15
 #include <Windows.h>
16 16
 #endif
17 17
 
18
-#include <openssl/ssl.h>
19
-#include <openssl/err.h>
20
-#include "libclamav/crypto.h"
21
-
18
+#include "clamav.h"
22 19
 #include "7zCrc.h"
23 20
 #include "Alloc.h"
24 21
 #include "Bra.h"
... ...
@@ -8,10 +8,7 @@
8 8
 #include <Windows.h>
9 9
 #endif
10 10
 
11
-#include <openssl/ssl.h>
12
-#include <openssl/err.h>
13
-#include "libclamav/crypto.h"
14
-
11
+#include "clamav.h"
15 12
 #include "7zCrc.h"
16 13
 #include "CpuArch.h"
17 14
 #include "Xz.h"
... ...
@@ -23,10 +23,7 @@
23 23
 #include <Windows.h>
24 24
 #endif
25 25
 
26
-#include <openssl/ssl.h>
27
-#include <openssl/err.h>
28
-#include "libclamav/crypto.h"
29
-
26
+#include "clamav.h"
30 27
 #include "7z_iface.h"
31 28
 #include "lzma_iface.h"
32 29
 #include "scanners.h"
... ...
@@ -76,7 +76,6 @@ libclamav_internal_utils_la_SOURCES=str.c\
76 76
 					conv.c \
77 77
 					conv.h \
78 78
 					crypto.c \
79
-					crypto.h \
80 79
 					clamav.h \
81 80
 				    iowrap.c \
82 81
 				    iowrap.h \
... ...
@@ -102,7 +101,6 @@ libclamav_internal_utils_nothreads_la_SOURCES=str.c\
102 102
 					conv.c \
103 103
 					conv.h \
104 104
 					crypto.c \
105
-					crypto.h \
106 105
 					clamav.h \
107 106
 				    str.h\
108 107
 				    iowrap.c \
... ...
@@ -769,7 +769,6 @@ libclamav_internal_utils_la_SOURCES = str.c\
769 769
 					conv.c \
770 770
 					conv.h \
771 771
 					crypto.c \
772
-					crypto.h \
773 772
 					clamav.h \
774 773
 				    iowrap.c \
775 774
 				    iowrap.h \
... ...
@@ -794,7 +793,6 @@ libclamav_internal_utils_nothreads_la_SOURCES = str.c\
794 794
 					conv.c \
795 795
 					conv.h \
796 796
 					crypto.c \
797
-					crypto.h \
798 797
 					clamav.h \
799 798
 				    str.h\
800 799
 				    iowrap.c \
... ...
@@ -28,10 +28,7 @@
28 28
 #include <string.h>
29 29
 #endif
30 30
 
31
-#include <openssl/ssl.h>
32
-#include <openssl/err.h>
33
-#include "libclamav/crypto.h"
34
-
31
+#include "clamav.h"
35 32
 #include "cltypes.h"
36 33
 #include "others.h"
37 34
 #include "adc.h"
... ...
@@ -30,10 +30,6 @@
30 30
 #include <ctype.h>
31 31
 #include <fcntl.h>
32 32
 
33
-#include <openssl/ssl.h>
34
-#include <openssl/err.h>
35
-#include "libclamav/crypto.h"
36
-
37 33
 #include "cltypes.h"
38 34
 #include "others.h"
39 35
 #include "apm.h"
... ...
@@ -24,10 +24,7 @@
24 24
 
25 25
 #include <time.h>
26 26
 
27
-#include <openssl/ssl.h>
28
-#include <openssl/err.h>
29
-#include "libclamav/crypto.h"
30
-
27
+#include "clamav.h"
31 28
 #include "asn1.h"
32 29
 #include "bignum.h"
33 30
 #include "matcher-hash.h"
... ...
@@ -20,10 +20,7 @@
20 20
 
21 21
 #include <string.h>
22 22
 
23
-#include <openssl/ssl.h>
24
-#include <openssl/err.h>
25
-#include "libclamav/crypto.h"
26
-
23
+#include "clamav.h"
27 24
 #include "cltypes.h"
28 25
 #include "execs.h"
29 26
 #include "others.h"
... ...
@@ -35,10 +35,7 @@
35 35
 #include <unistd.h>
36 36
 #endif
37 37
 
38
-#include <openssl/ssl.h>
39
-#include <openssl/err.h>
40
-#include "libclamav/crypto.h"
41
-
38
+#include "clamav.h"
42 39
 #include "others.h"
43 40
 #include "scanners.h"
44 41
 #include "autoit.h"
... ...
@@ -25,10 +25,6 @@
25 25
 
26 26
 #include <string.h>
27 27
 
28
-#include <openssl/ssl.h>
29
-#include <openssl/err.h>
30
-#include "libclamav/crypto.h"
31
-
32 28
 #include "scanners.h"
33 29
 #include "cltypes.h"
34 30
 #include "others.h"
... ...
@@ -44,10 +44,6 @@ static	char	const	rcsid[] = "$Id: blob.c,v 1.64 2007/02/12 22:25:14 njh Exp $";
44 44
 #include <unistd.h>
45 45
 #endif
46 46
 
47
-#include <openssl/ssl.h>
48
-#include <openssl/err.h>
49
-#include "libclamav/crypto.h"
50
-
51 47
 #include "others.h"
52 48
 #include "mbox.h"
53 49
 #include "matcher.h"
... ...
@@ -28,10 +28,6 @@
28 28
 #include <assert.h>
29 29
 #include <fcntl.h>
30 30
 
31
-#include <openssl/ssl.h>
32
-#include <openssl/err.h>
33
-#include "libclamav/crypto.h"
34
-
35 31
 #include "dconf.h"
36 32
 #include "clamav.h"
37 33
 #include "others.h"
... ...
@@ -34,10 +34,7 @@
34 34
 #include <math.h>
35 35
 #include <ctype.h>
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
37
+#include "clamav.h"
41 38
 #include "cltypes.h"
42 39
 #include "clambc.h"
43 40
 #include "bytecode.h"
... ...
@@ -24,10 +24,7 @@
24 24
 #include "clamav-config.h"
25 25
 #endif
26 26
 
27
-#include <openssl/ssl.h>
28
-#include <openssl/err.h>
29
-#include "libclamav/crypto.h"
30
-
27
+#include "clamav.h"
31 28
 #include "target.h"
32 29
 #include "cltypes.h"
33 30
 
... ...
@@ -23,10 +23,6 @@
23 23
 #include <stdio.h>
24 24
 #include <stdlib.h>
25 25
 
26
-#include <openssl/ssl.h>
27
-#include <openssl/err.h>
28
-#include "libclamav/crypto.h"
29
-
30 26
 #include "cltypes.h"
31 27
 #include "bytecode.h"
32 28
 #include "bytecode_priv.h"
... ...
@@ -23,10 +23,6 @@
23 23
 #include "clamav-config.h"
24 24
 #endif
25 25
 
26
-#include <openssl/ssl.h>
27
-#include <openssl/err.h>
28
-#include "libclamav/crypto.h"
29
-
30 26
 #include "clamav.h"
31 27
 #include "others.h"
32 28
 #include "bytecode.h"
... ...
@@ -128,13 +128,6 @@ void LLVMInitializePowerPCAsmPrinter();
128 128
 #include "clamav-config.h"
129 129
 #endif
130 130
 
131
-#include <openssl/ssl.h>
132
-#include <openssl/err.h>
133
-
134
-extern "C" {
135
-#include "libclamav/crypto.h"
136
-}
137
-
138 131
 #include "dconf.h"
139 132
 #include "clamav.h"
140 133
 #include "clambc.h"
... ...
@@ -32,10 +32,7 @@
32 32
 #endif
33 33
 #include <fcntl.h>
34 34
 
35
-#include <openssl/ssl.h>
36
-#include <openssl/err.h>
37
-#include "libclamav/crypto.h"
38
-
35
+#include "clamav.h"
39 36
 #include "cltypes.h"
40 37
 #include "others.h"
41 38
 #include "mspack.h"
... ...
@@ -27,10 +27,6 @@
27 27
 #include <pthread.h>
28 28
 #include <assert.h>
29 29
 
30
-#include <openssl/ssl.h>
31
-#include <openssl/err.h>
32
-#include "libclamav/crypto.h"
33
-
34 30
 #include "mpool.h"
35 31
 #include "clamav.h"
36 32
 #include "cache.h"
... ...
@@ -34,10 +34,7 @@
34 34
 #include <string.h>
35 35
 #include <errno.h>
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
37
+#include "clamav.h"
41 38
 #include "fmap.h"
42 39
 #include "others.h"
43 40
 #include "mspack.h"
... ...
@@ -22,6 +22,9 @@
22 22
 #ifndef __CLAMAV_H
23 23
 #define __CLAMAV_H
24 24
 
25
+#include <openssl/ssl.h>
26
+#include <openssl/err.h>
27
+
25 28
 /* Certain OSs already use 64bit variables in their stat struct */
26 29
 #define STAT64_BLACKLIST !defined(__FreeBSD__) && !defined(__APPLE__)
27 30
 
... ...
@@ -510,6 +513,247 @@ extern void cl_fmap_close(cl_fmap_t*);
510 510
 /* Scan custom data */
511 511
 extern int cl_scanmap_callback(cl_fmap_t *map, const char **virname, unsigned long int *scanned, const struct cl_engine *engine, unsigned int scanoptions, void *context);
512 512
 
513
+/* Crypto/hashing functions */
514
+#define SHA1_HASH_SIZE 20
515
+#define SHA256_HASH_SIZE 32
516
+
517
+/** Generate a hash of data.
518
+ @param[in] alg The hashing algorithm to use
519
+ @param[in] buf The data to be hashed
520
+ @param[in] len The length of the to-be-hashed data
521
+ @param[out] obuf An optional buffer to store the generated hash. Use NULL to dynamically allocate buffer.
522
+ @param[out] olen An optional pointer that stores how long the generated hash is.
523
+ @return A pointer to the generated hash or obuf if obuf is not NULL.
524
+ */
525
+unsigned char *cl_hash_data(char *alg, const void *buf, size_t len, unsigned char *obuf, unsigned int *olen);
526
+
527
+/** Generate a hash of a file.
528
+ @param[in] ctx A pointer to the OpenSSL EVP_MD_CTX object
529
+ @param[in] fd The file descriptor
530
+ @param[out] olen An optional pointer that stores how long the generated hash is
531
+ @return A pointer to a dynamically-created buffer that holds the generated hash
532
+ */
533
+unsigned char *cl_hash_file_fd_ctx(EVP_MD_CTX *ctx, int fd, unsigned int *olen);
534
+
535
+/** Generate a hash of a file.
536
+ @param[in] fd The file descriptor
537
+ @param[in] alg The hashing algorithm to use
538
+ @param[out] olen An optional pointer that stores how long the generated hash is
539
+ @return A pointer to a dynamically-created buffer that holds the generated hash
540
+ */
541
+unsigned char *cl_hash_file_fd(int fd, char *alg, unsigned int *olen);
542
+
543
+/** Generate a hash of a file.
544
+ @param[in] fp A pointer to a FILE object
545
+ @param[in] alg The hashing algorithm to use
546
+ @param[out] olen An optional pointer that stores how long the generated hash is
547
+ @return A pointer to a dynamically-created buffer that holds the generated hash
548
+ */
549
+unsigned char *cl_hash_file_fp(FILE *fp, char *alg, unsigned int *olen);
550
+
551
+/** Generate a sha256 hash of data
552
+ @param[in] buf The data to hash
553
+ @param[in] len The length of the to-be-hashed data
554
+ @param[out] obuf An optional pointer to store the generated hash. Use NULL to dynamically allocate buffer.
555
+ @param[out] olen An optional pointer that stores how long the generated hash is.
556
+ @return A pointer to the buffer that holds the generated hash
557
+ */
558
+unsigned char *cl_sha256(const void *buf, size_t len, unsigned char *obuf, unsigned int *olen);
559
+
560
+/** Generate a sha1 hash of data
561
+ @param[in] buf The data to hash
562
+ @param[in] len The length of the to-be-hashed data
563
+ @param[out] obuf An optional pointer to store the generated hash. Use NULL to dynamically allocate buffer.
564
+ @param[out] olen An optional pointer that stores how long the generated hash is.
565
+ @return A pointer to the buffer that holds the generated hash or obuf if obuf is not NULL
566
+ */
567
+unsigned char *cl_sha1(const void *buf, size_t len, unsigned char *obuf, unsigned int *olen);
568
+
569
+/** Verify validity of signed data
570
+ @param[in] pkey The public key of the keypair that signed the data
571
+ @param[in] alg The algorithm used to hash the data
572
+ @param[in] sig The signature block
573
+ @param[in] siglen The length of the signature
574
+ @param[in] data The data that was signed
575
+ @param[in] datalen The length of the data
576
+ @param[in] decode Whether or not to base64-decode the signature prior to verification. 1 for yes, 0 for no.
577
+ @return 0 for success, -1 for error or invalid signature
578
+ */
579
+int cl_verify_signature(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode);
580
+
581
+/** Verify validity of signed data
582
+ @param[in] pkey The public key of the keypair that signed the data
583
+ @param[in] alg The algorithm used to hash the data
584
+ @param[in] sig The signature block
585
+ @param[in] siglen The length of the signature
586
+ @param[in] digest The hash of the signed data
587
+ @return 0 for success, -1 for error or invalid signature
588
+ */
589
+int cl_verify_signature_hash(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest);
590
+
591
+/** Verify validity of signed data
592
+ @param[in] pkey The public key of the keypair that signed the data
593
+ @param[in] alg The algorithm used to hash the data
594
+ @param[in] sig The signature block
595
+ @param[in] siglen The length of the signature
596
+ @param[in] fd The file descriptor
597
+ @return 0 for success, -1 for error or invalid signature
598
+ */
599
+int cl_verify_signature_fd(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, int fd);
600
+
601
+/** Verify validity of signed data
602
+ @param[in] x509path The path to the public key of the keypair that signed the data
603
+ @param[in] alg The algorithm used to hash the data
604
+ @param[in] sig The signature block
605
+ @param[in] siglen The length of the signature
606
+ @param[in] digest The hash of the signed data
607
+ @return 0 for success, -1 for error or invalid signature
608
+ */
609
+int cl_verify_signature_hash_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest);
610
+
611
+/** Verify validity of signed data
612
+ @param[in] x509path The path to the public key of the keypair that signed the data
613
+ @param[in] alg The algorithm used to hash the data
614
+ @param[in] sig The signature block
615
+ @param[in] siglen The length of the signature
616
+ @param[in] fd The file descriptor
617
+ @return 0 for success, -1 for error or invalid signature
618
+ */
619
+int cl_verify_signature_fd_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, int fd);
620
+
621
+/** Verify validity of signed data
622
+ @param[in] x509path The path to the public key of the keypair that signed the data
623
+ @param[in] alg The algorithm used to hash the data
624
+ @param[in] sig The signature block
625
+ @param[in] siglen The length of the signature
626
+ @param[in] data The data that was signed
627
+ @param[in] datalen The length of the data
628
+ @param[in] decode Whether or not to base64-decode the signature prior to verification. 1 for yes, 0 for no.
629
+ @return 0 for success, -1 for error or invalid signature
630
+ */
631
+int cl_verify_signature_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode);
632
+
633
+/** Verify validity of signed data
634
+ @param[in] x509 The X509 object of the public key of the keypair that signed the data
635
+ @param[in] alg The algorithm used to hash the data
636
+ @param[in] sig The signature block
637
+ @param[in] siglen The length of the signature
638
+ @param[in] digest The hash of the signed data
639
+ @return 0 for success, -1 for error or invalid signature
640
+ */
641
+int cl_verify_signature_hash_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest);
642
+
643
+/** Verify validity of signed data
644
+ @param[in] x509 The X509 object of the public key of the keypair that signed the data
645
+ @param[in] alg The algorithm used to hash the data
646
+ @param[in] sig The signature block
647
+ @param[in] siglen The length of the signature
648
+ @param[in] fd The file descriptor
649
+ @return 0 for success, -1 for error or invalid signature
650
+ */
651
+int cl_verify_signature_fd_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, int fd);
652
+
653
+/** Verify validity of signed data
654
+ @param[in] x509 The X509 object of the public key of the keypair that signed the data
655
+ @param[in] alg The algorithm used to hash the data
656
+ @param[in] sig The signature block
657
+ @param[in] siglen The length of the signature
658
+ @param[in] data The data that was signed
659
+ @param[in] datalen The length of the data
660
+ @param[in] decode Whether or not to base64-decode the signature prior to verification. 1 for yes, 0 for no.
661
+ @return 0 for success, -1 for error or invalid signature
662
+ */
663
+int cl_verify_signature_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode);
664
+
665
+/** Get an X509 object from memory
666
+ * @param[in] data A pointer to a spot in memory that contains the PEM X509 cert
667
+ * @param[in] len The length of the data
668
+ * @return a pointer to the X509 object on success, NULL on error
669
+ */
670
+X509 *cl_get_x509_from_mem(void *data, unsigned int len);
671
+
672
+/** Validate an X509 certificate chain, with the chain being located in a directory
673
+ @param[in] tsdir The path to the trust store directory
674
+ @param[in] certpath The path to the X509 certificate to be validated.
675
+ @return 0 for success, -1 for error or invalid certificate.
676
+ */
677
+int cl_validate_certificate_chain_ts_dir(char *tsdir, char *certpath);
678
+
679
+/** Validate an X509 certificate chain with support for a CRL
680
+ @param[in] authorities A NULL-terminated array of strings that hold the path of the CA's X509 certificate
681
+ @param[in] crlpath An optional path to the CRL file. NULL if no CRL.
682
+ @param[in] certpath The path to the X509 certificate to be validated.
683
+ @return 0 for success, -1 for error or invalid certificate.
684
+ */
685
+int cl_validate_certificate_chain(char **authorities, char *crlpath, char *certpath);
686
+
687
+/** Load an X509 certificate from a file
688
+ @param[in] certpath The path to the X509 certificate
689
+ */
690
+X509 *cl_load_cert(const char *certpath);
691
+
692
+/** Parse an ASN1_TIME object
693
+ @param[in] timeobj The ASN1_TIME object
694
+ @return A pointer to a (struct tm). Adjusted for time zone and daylight savings time.
695
+ */
696
+struct tm *cl_ASN1_GetTimeT(ASN1_TIME *timeobj);
697
+
698
+/** Load a CRL file into an X509_CRL object
699
+ @param[in] file The path to the CRL
700
+ @return A pointer to an X509_CRL object or NULL on error.
701
+ */
702
+X509_CRL *cl_load_crl(const char *timeobj);
703
+
704
+/** Sign data with a key stored on disk
705
+ @param[in] keypath The path to the RSA private key
706
+ @param[in] alg The hash/signature algorithm to use
707
+ @param[in] hash The hash to sign
708
+ @param[out] olen A pointer that stores the size of the signature
709
+ @param[in] Whether or not to base64-encode the signature. 1 for yes, 0 for no.
710
+ @return The generated signature
711
+ */
712
+unsigned char *cl_sign_data_keyfile(char *keypath, char *alg, unsigned char *hash, unsigned int *olen, int encode);
713
+
714
+/** Sign data with an RSA private key object
715
+ @param[in] pkey The RSA private key object
716
+ @param[in] alg The hash/signature algorithm to use
717
+ @param[in] hash The hash to sign
718
+ @param[out] olen A pointer that stores the size of the signature
719
+ @param[in] Whether or not to base64-encode the signature. 1 for yes, 0 for no.
720
+ @return The generated signature
721
+ */
722
+unsigned char *cl_sign_data(EVP_PKEY *pkey, char *alg, unsigned char *hash, unsigned int *olen, int encode);
723
+
724
+/** Sign a file with an RSA private key object
725
+ @param[in] fd The file descriptor
726
+ @param[in] pkey The RSA private key object
727
+ @param[in] alg The hash/signature algorithm to use
728
+ @param[out] olen A pointer that stores the size of the signature
729
+ @param[in] encode Whether or not to base64-encode the signature. 1 for yes, 0 for no.
730
+ */
731
+unsigned char *cl_sign_file_fd(int fd, EVP_PKEY *pkey, char *alg, unsigned int *olen, int encode);
732
+
733
+/** Sign a file with an RSA private key object
734
+ @param[in] fp A pointer to a FILE object
735
+ @param[in] pkey The RSA private key object
736
+ @param[in] alg The hash/signature algorithm to use
737
+ @param[out] olen A pointer that stores the size of the signature
738
+ @param[in] encode Whether or not to base64-encode the signature. 1 for yes, 0 for no.
739
+ */
740
+unsigned char *cl_sign_file_fp(FILE *fp, EVP_PKEY *pkey, char *alg, unsigned int *olen, int encode);
741
+
742
+/** Get the Private Key stored on disk
743
+ * @param[in] keypath The path on disk where the private key is stored
744
+ * @return A pointer to the EVP_PKEY object that contains the private key in memory
745
+ */
746
+EVP_PKEY *cl_get_pkey_file(char *keypath);
747
+
748
+void *cl_hash_init(const char *alg);
749
+int cl_update_hash(void *ctx, void *data, size_t sz);
750
+int cl_finish_hash(void *ctx, void *buf);
751
+void cl_hash_destroy(void *ctx);
752
+/* End of crypto/hashing functions */
753
+
513 754
 #ifdef __cplusplus
514 755
 }
515 756
 #endif
... ...
@@ -34,11 +34,11 @@
34 34
 
35 35
 #include <sys/types.h>
36 36
 
37
+#include "clamav.h"
37 38
 #include <openssl/bio.h>
38 39
 #include <openssl/evp.h>
39 40
 
40 41
 #include "libclamav/conv.h"
41
-#include "libclamav/crypto.h"
42 42
 
43 43
 /** Get the expected decoded length of a base64-encoded string
44 44
  * @param[in] data Base64-encoded string
... ...
@@ -32,10 +32,7 @@
32 32
 #include <sys/stat.h>
33 33
 #include <fcntl.h>
34 34
 
35
-#include <openssl/ssl.h>
36
-#include <openssl/err.h>
37
-#include "libclamav/crypto.h"
38
-
35
+#include "clamav.h"
39 36
 #include "cltypes.h"
40 37
 #include "others.h"
41 38
 #include "cpio.h"
... ...
@@ -22,10 +22,7 @@
22 22
 #include "clamav-config.h"
23 23
 #endif
24 24
 
25
-#include <openssl/ssl.h>
26
-#include <openssl/err.h>
27
-#include "libclamav/crypto.h"
28
-
25
+#include "clamav.h"
29 26
 #include "others.h"
30 27
 #include "crtmgr.h"
31 28
 
... ...
@@ -55,10 +55,6 @@
55 55
 #include <unistd.h>
56 56
 #endif
57 57
 
58
-#include <openssl/ssl.h>
59
-#include <openssl/err.h>
60
-#include "libclamav/crypto.h"
61
-
62 58
 #include "clamav.h"
63 59
 #include "default.h"
64 60
 #include "others.h"
65 61
deleted file mode 100644
... ...
@@ -1,286 +0,0 @@
1
-/*
2
- *  Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved.
3
- *
4
- *  Author: Shawn Webb
5
- *
6
- *  This program is free software; you can redistribute it and/or modify
7
- *  it under the terms of the GNU General Public License version 2 as
8
- *  published by the Free Software Foundation.
9
- *
10
- *  This program is distributed in the hope that it will be useful,
11
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
- *  GNU General Public License for more details.
14
- *
15
- *  You should have received a copy of the GNU General Public License
16
- *  along with this program; if not, write to the Free Software
17
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
- *  MA 02110-1301, USA.
19
- *
20
- *  In addition, as a special exception, the copyright holders give
21
- *  permission to link the code of portions of this program with the
22
- *  OpenSSL library under certain conditions as described in each
23
- *  individual source file, and distribute linked combinations
24
- *  including the two.
25
- *
26
- *  You must obey the GNU General Public License in all respects
27
- *  for all of the code used other than OpenSSL.  If you modify
28
- *  file(s) with this exception, you may extend this exception to your
29
- *  version of the file(s), but you are not obligated to do so.  If you
30
- *  do not wish to do so, delete this exception statement from your
31
- *  version.  If you delete this exception statement from all source
32
- *  files in the program, then also delete it here.
33
- */
34
-
35
-#if !defined(_CLAMAV_CRYPTO_H)
36
-#define _CLAMAV_CRYPTO_H
37
-
38
-/**
39
- * \defgroup CryptoAPI ClamAV Crypto API
40
- * @{
41
- */
42
-
43
-#define SHA1_HASH_SIZE 20
44
-#define SHA256_HASH_SIZE 32
45
-
46
-/** Generate a hash of data.
47
- @param[in] alg The hashing algorithm to use
48
- @param[in] buf The data to be hashed
49
- @param[in] len The length of the to-be-hashed data
50
- @param[out] obuf An optional buffer to store the generated hash. Use NULL to dynamically allocate buffer.
51
- @param[out] olen An optional pointer that stores how long the generated hash is.
52
- @return A pointer to the generated hash or obuf if obuf is not NULL.
53
- */
54
-unsigned char *cl_hash_data(char *alg, const void *buf, size_t len, unsigned char *obuf, unsigned int *olen);
55
-
56
-/** Generate a hash of a file.
57
- @param[in] ctx A pointer to the OpenSSL EVP_MD_CTX object
58
- @param[in] fd The file descriptor
59
- @param[out] olen An optional pointer that stores how long the generated hash is
60
- @return A pointer to a dynamically-created buffer that holds the generated hash
61
- */
62
-unsigned char *cl_hash_file_fd_ctx(EVP_MD_CTX *ctx, int fd, unsigned int *olen);
63
-
64
-/** Generate a hash of a file.
65
- @param[in] fd The file descriptor
66
- @param[in] alg The hashing algorithm to use
67
- @param[out] olen An optional pointer that stores how long the generated hash is
68
- @return A pointer to a dynamically-created buffer that holds the generated hash
69
- */
70
-unsigned char *cl_hash_file_fd(int fd, char *alg, unsigned int *olen);
71
-
72
-/** Generate a hash of a file.
73
- @param[in] fp A pointer to a FILE object
74
- @param[in] alg The hashing algorithm to use
75
- @param[out] olen An optional pointer that stores how long the generated hash is
76
- @return A pointer to a dynamically-created buffer that holds the generated hash
77
- */
78
-unsigned char *cl_hash_file_fp(FILE *fp, char *alg, unsigned int *olen);
79
-
80
-/** Generate a sha256 hash of data
81
- @param[in] buf The data to hash
82
- @param[in] len The length of the to-be-hashed data
83
- @param[out] obuf An optional pointer to store the generated hash. Use NULL to dynamically allocate buffer.
84
- @param[out] olen An optional pointer that stores how long the generated hash is.
85
- @return A pointer to the buffer that holds the generated hash
86
- */
87
-unsigned char *cl_sha256(const void *buf, size_t len, unsigned char *obuf, unsigned int *olen);
88
-
89
-/** Generate a sha1 hash of data
90
- @param[in] buf The data to hash
91
- @param[in] len The length of the to-be-hashed data
92
- @param[out] obuf An optional pointer to store the generated hash. Use NULL to dynamically allocate buffer.
93
- @param[out] olen An optional pointer that stores how long the generated hash is.
94
- @return A pointer to the buffer that holds the generated hash or obuf if obuf is not NULL
95
- */
96
-unsigned char *cl_sha1(const void *buf, size_t len, unsigned char *obuf, unsigned int *olen);
97
-
98
-/** Verify validity of signed data
99
- @param[in] pkey The public key of the keypair that signed the data
100
- @param[in] alg The algorithm used to hash the data
101
- @param[in] sig The signature block
102
- @param[in] siglen The length of the signature
103
- @param[in] data The data that was signed
104
- @param[in] datalen The length of the data
105
- @param[in] decode Whether or not to base64-decode the signature prior to verification. 1 for yes, 0 for no.
106
- @return 0 for success, -1 for error or invalid signature
107
- */
108
-int cl_verify_signature(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode);
109
-
110
-/** Verify validity of signed data
111
- @param[in] pkey The public key of the keypair that signed the data
112
- @param[in] alg The algorithm used to hash the data
113
- @param[in] sig The signature block
114
- @param[in] siglen The length of the signature
115
- @param[in] digest The hash of the signed data
116
- @return 0 for success, -1 for error or invalid signature
117
- */
118
-int cl_verify_signature_hash(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest);
119
-
120
-/** Verify validity of signed data
121
- @param[in] pkey The public key of the keypair that signed the data
122
- @param[in] alg The algorithm used to hash the data
123
- @param[in] sig The signature block
124
- @param[in] siglen The length of the signature
125
- @param[in] fd The file descriptor
126
- @return 0 for success, -1 for error or invalid signature
127
- */
128
-int cl_verify_signature_fd(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, int fd);
129
-
130
-/** Verify validity of signed data
131
- @param[in] x509path The path to the public key of the keypair that signed the data
132
- @param[in] alg The algorithm used to hash the data
133
- @param[in] sig The signature block
134
- @param[in] siglen The length of the signature
135
- @param[in] digest The hash of the signed data
136
- @return 0 for success, -1 for error or invalid signature
137
- */
138
-int cl_verify_signature_hash_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest);
139
-
140
-/** Verify validity of signed data
141
- @param[in] x509path The path to the public key of the keypair that signed the data
142
- @param[in] alg The algorithm used to hash the data
143
- @param[in] sig The signature block
144
- @param[in] siglen The length of the signature
145
- @param[in] fd The file descriptor
146
- @return 0 for success, -1 for error or invalid signature
147
- */
148
-int cl_verify_signature_fd_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, int fd);
149
-
150
-/** Verify validity of signed data
151
- @param[in] x509path The path to the public key of the keypair that signed the data
152
- @param[in] alg The algorithm used to hash the data
153
- @param[in] sig The signature block
154
- @param[in] siglen The length of the signature
155
- @param[in] data The data that was signed
156
- @param[in] datalen The length of the data
157
- @param[in] decode Whether or not to base64-decode the signature prior to verification. 1 for yes, 0 for no.
158
- @return 0 for success, -1 for error or invalid signature
159
- */
160
-int cl_verify_signature_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode);
161
-
162
-/** Verify validity of signed data
163
- @param[in] x509 The X509 object of the public key of the keypair that signed the data
164
- @param[in] alg The algorithm used to hash the data
165
- @param[in] sig The signature block
166
- @param[in] siglen The length of the signature
167
- @param[in] digest The hash of the signed data
168
- @return 0 for success, -1 for error or invalid signature
169
- */
170
-int cl_verify_signature_hash_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest);
171
-
172
-/** Verify validity of signed data
173
- @param[in] x509 The X509 object of the public key of the keypair that signed the data
174
- @param[in] alg The algorithm used to hash the data
175
- @param[in] sig The signature block
176
- @param[in] siglen The length of the signature
177
- @param[in] fd The file descriptor
178
- @return 0 for success, -1 for error or invalid signature
179
- */
180
-int cl_verify_signature_fd_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, int fd);
181
-
182
-/** Verify validity of signed data
183
- @param[in] x509 The X509 object of the public key of the keypair that signed the data
184
- @param[in] alg The algorithm used to hash the data
185
- @param[in] sig The signature block
186
- @param[in] siglen The length of the signature
187
- @param[in] data The data that was signed
188
- @param[in] datalen The length of the data
189
- @param[in] decode Whether or not to base64-decode the signature prior to verification. 1 for yes, 0 for no.
190
- @return 0 for success, -1 for error or invalid signature
191
- */
192
-int cl_verify_signature_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode);
193
-
194
-/** Get an X509 object from memory
195
- * @param[in] data A pointer to a spot in memory that contains the PEM X509 cert
196
- * @param[in] len The length of the data
197
- * @return a pointer to the X509 object on success, NULL on error
198
- */
199
-X509 *cl_get_x509_from_mem(void *data, unsigned int len);
200
-
201
-/** Validate an X509 certificate chain, with the chain being located in a directory
202
- @param[in] tsdir The path to the trust store directory
203
- @param[in] certpath The path to the X509 certificate to be validated.
204
- @return 0 for success, -1 for error or invalid certificate.
205
- */
206
-int cl_validate_certificate_chain_ts_dir(char *tsdir, char *certpath);
207
-
208
-/** Validate an X509 certificate chain with support for a CRL
209
- @param[in] authorities A NULL-terminated array of strings that hold the path of the CA's X509 certificate
210
- @param[in] crlpath An optional path to the CRL file. NULL if no CRL.
211
- @param[in] certpath The path to the X509 certificate to be validated.
212
- @return 0 for success, -1 for error or invalid certificate.
213
- */
214
-int cl_validate_certificate_chain(char **authorities, char *crlpath, char *certpath);
215
-
216
-/** Load an X509 certificate from a file
217
- @param[in] certpath The path to the X509 certificate
218
- */
219
-X509 *cl_load_cert(const char *certpath);
220
-
221
-/** Parse an ASN1_TIME object
222
- @param[in] timeobj The ASN1_TIME object
223
- @return A pointer to a (struct tm). Adjusted for time zone and daylight savings time.
224
- */
225
-struct tm *cl_ASN1_GetTimeT(ASN1_TIME *timeobj);
226
-
227
-/** Load a CRL file into an X509_CRL object
228
- @param[in] file The path to the CRL
229
- @return A pointer to an X509_CRL object or NULL on error.
230
- */
231
-X509_CRL *cl_load_crl(const char *timeobj);
232
-
233
-/** Sign data with a key stored on disk
234
- @param[in] keypath The path to the RSA private key
235
- @param[in] alg The hash/signature algorithm to use
236
- @param[in] hash The hash to sign
237
- @param[out] olen A pointer that stores the size of the signature
238
- @param[in] Whether or not to base64-encode the signature. 1 for yes, 0 for no.
239
- @return The generated signature
240
- */
241
-unsigned char *cl_sign_data_keyfile(char *keypath, char *alg, unsigned char *hash, unsigned int *olen, int encode);
242
-
243
-/** Sign data with an RSA private key object
244
- @param[in] pkey The RSA private key object
245
- @param[in] alg The hash/signature algorithm to use
246
- @param[in] hash The hash to sign
247
- @param[out] olen A pointer that stores the size of the signature
248
- @param[in] Whether or not to base64-encode the signature. 1 for yes, 0 for no.
249
- @return The generated signature
250
- */
251
-unsigned char *cl_sign_data(EVP_PKEY *pkey, char *alg, unsigned char *hash, unsigned int *olen, int encode);
252
-
253
-/** Sign a file with an RSA private key object
254
- @param[in] fd The file descriptor
255
- @param[in] pkey The RSA private key object
256
- @param[in] alg The hash/signature algorithm to use
257
- @param[out] olen A pointer that stores the size of the signature
258
- @param[in] encode Whether or not to base64-encode the signature. 1 for yes, 0 for no.
259
- */
260
-unsigned char *cl_sign_file_fd(int fd, EVP_PKEY *pkey, char *alg, unsigned int *olen, int encode);
261
-
262
-/** Sign a file with an RSA private key object
263
- @param[in] fp A pointer to a FILE object
264
- @param[in] pkey The RSA private key object
265
- @param[in] alg The hash/signature algorithm to use
266
- @param[out] olen A pointer that stores the size of the signature
267
- @param[in] encode Whether or not to base64-encode the signature. 1 for yes, 0 for no.
268
- */
269
-unsigned char *cl_sign_file_fp(FILE *fp, EVP_PKEY *pkey, char *alg, unsigned int *olen, int encode);
270
-
271
-/** Get the Private Key stored on disk
272
- * @param[in] keypath The path on disk where the private key is stored
273
- * @return A pointer to the EVP_PKEY object that contains the private key in memory
274
- */
275
-EVP_PKEY *cl_get_pkey_file(char *keypath);
276
-
277
-void *cl_hash_init(const char *alg);
278
-int cl_update_hash(void *ctx, void *data, size_t sz);
279
-int cl_finish_hash(void *ctx, void *buf);
280
-void cl_hash_destroy(void *ctx);
281
-
282
-/**
283
- * @}
284
- */
285
-
286
-#endif
... ...
@@ -35,10 +35,6 @@
35 35
 #include <time.h>
36 36
 #include <errno.h>
37 37
 
38
-#include <openssl/ssl.h>
39
-#include <openssl/err.h>
40
-#include "libclamav/crypto.h"
41
-
42 38
 #include "clamav.h"
43 39
 #include "others.h"
44 40
 #include "dsig.h"
... ...
@@ -29,10 +29,6 @@
29 29
 #include <ctype.h>
30 30
 #include <zlib.h>
31 31
 
32
-#include <openssl/ssl.h>
33
-#include <openssl/err.h>
34
-#include "libclamav/crypto.h"
35
-
36 32
 #include "clamav.h"
37 33
 #include "cltypes.h"
38 34
 #include "dconf.h"
... ...
@@ -28,14 +28,11 @@
28 28
 #include <string.h>
29 29
 #include <assert.h>
30 30
 
31
-#include <openssl/ssl.h>
32
-#include <openssl/err.h>
33
-#include "libclamav/crypto.h"
34
-
35 31
 #include "others.h"
36 32
 
37 33
 #include "disasmpriv.h"
38 34
 #include "disasm.h"
35
+#include "clamav.h"
39 36
 
40 37
 enum ADDRS {
41 38
   ADDR_REG_EAX,
... ...
@@ -24,10 +24,6 @@
24 24
 #include "clamav-config.h"
25 25
 #endif
26 26
 
27
-#include <openssl/ssl.h>
28
-#include <openssl/err.h>
29
-#include "libclamav/crypto.h"
30
-
31 27
 #include <stdio.h>
32 28
 #include <ctype.h>  
33 29
 #include <string.h>
... ...
@@ -49,10 +49,7 @@
49 49
 #include <libxml/xmlreader.h>
50 50
 #endif
51 51
 
52
-#include <openssl/ssl.h>
53
-#include <openssl/err.h>
54
-#include "libclamav/crypto.h"
55
-
52
+#include "clamav.h"
56 53
 #include "cltypes.h"
57 54
 #include "others.h"
58 55
 #include "dmg.h"
... ...
@@ -27,10 +27,6 @@
27 27
 #include <stdlib.h>
28 28
 #include <ctype.h>
29 29
 
30
-#include <openssl/ssl.h>
31
-#include <openssl/err.h>
32
-#include "libclamav/crypto.h"
33
-
34 30
 #include "clamav.h"
35 31
 #include "others.h"
36 32
 #include "dsig.h"
... ...
@@ -33,10 +33,6 @@
33 33
 #endif
34 34
 #include <time.h>
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
40 36
 #include "cltypes.h"
41 37
 #include "elf.h"
42 38
 #include "clamav.h"
... ...
@@ -35,10 +35,6 @@
35 35
 
36 36
 #include <assert.h>
37 37
 
38
-#include <openssl/ssl.h>
39
-#include <openssl/err.h>
40
-#include "libclamav/crypto.h"
41
-
42 38
 #include "clamav.h"
43 39
 #include "others.h"
44 40
 #include "htmlnorm.h"
... ...
@@ -24,10 +24,7 @@
24 24
 #include <sys/time.h>
25 25
 #endif
26 26
 
27
-#include <openssl/ssl.h>
28
-#include <openssl/err.h>
29
-#include "libclamav/crypto.h"
30
-
27
+#include "clamav.h"
31 28
 #include "events.h"
32 29
 #include "others.h"
33 30
 #include "7z/7zCrc.h"
... ...
@@ -38,10 +38,7 @@
38 38
 #include <string.h>
39 39
 #endif
40 40
 
41
-#include <openssl/ssl.h>
42
-#include <openssl/err.h>
43
-#include "libclamav/crypto.h"
44
-
41
+#include "clamav.h"
45 42
 #include "explode.h"
46 43
 #include "others.h"
47 44
 
... ...
@@ -30,10 +30,6 @@
30 30
 #include <unistd.h>
31 31
 #endif
32 32
 
33
-#include <openssl/ssl.h>
34
-#include <openssl/err.h>
35
-#include "libclamav/crypto.h"
36
-
37 33
 #include "clamav.h"
38 34
 #include "filetypes.h"
39 35
 #include "others.h"
... ...
@@ -23,10 +23,7 @@
23 23
 #include "clamav-config.h"
24 24
 #endif
25 25
 
26
-#include <openssl/ssl.h>
27
-#include <openssl/err.h>
28
-#include "libclamav/crypto.h"
29
-
26
+#include "clamav.h"
30 27
 #include "filtering.h"
31 28
 #include "matcher-ac.h"
32 29
 #include <string.h>
... ...
@@ -41,10 +41,7 @@
41 41
 #include <pthread.h>
42 42
 #endif
43 43
 
44
-#include <openssl/ssl.h>
45
-#include <openssl/err.h>
46
-#include "libclamav/crypto.h"
47
-
44
+#include "clamav.h"
48 45
 #include "others.h"
49 46
 #include "cltypes.h"
50 47
 
... ...
@@ -18,10 +18,6 @@
18 18
  *  MA 02110-1301, USA.
19 19
  */
20 20
 
21
-#include <openssl/ssl.h>
22
-#include <openssl/err.h>
23
-#include "libclamav/crypto.h"
24
-
25 21
 #include "others.h"
26 22
 #include "fpu.h"
27 23
 
... ...
@@ -40,10 +40,7 @@
40 40
 
41 41
 #include <stdlib.h>
42 42
 
43
-#include <openssl/ssl.h>
44
-#include <openssl/err.h>
45
-#include "libclamav/crypto.h"
46
-
43
+#include "clamav.h"
47 44
 #include "cltypes.h"
48 45
 #include "rebuildpe.h"
49 46
 #include "others.h"
... ...
@@ -31,10 +31,7 @@
31 31
 #include <fcntl.h>
32 32
 #include <zlib.h>
33 33
 
34
-#include <openssl/ssl.h>
35
-#include <openssl/err.h>
36
-#include "libclamav/crypto.h"
37
-
34
+#include "clamav.h"
38 35
 #include "cltypes.h"
39 36
 #include "others.h"
40 37
 #include "gpt.h"
... ...
@@ -25,10 +25,6 @@
25 25
 #include <stdio.h>
26 26
 #include <string.h>
27 27
 
28
-#include <openssl/ssl.h>
29
-#include <openssl/err.h>
30
-#include "libclamav/crypto.h"
31
-
32 28
 #include "cltypes.h"
33 29
 #include "clamav.h"
34 30
 #include "others.h"
... ...
@@ -22,10 +22,7 @@
22 22
 #include "clamav-config.h"
23 23
 #endif
24 24
 
25
-#include <openssl/ssl.h>
26
-#include <openssl/err.h>
27
-#include "libclamav/crypto.h"
28
-
25
+#include "clamav.h"
29 26
 #include "cltypes.h"
30 27
 #include "others.h"
31 28
 #include "hfsplus.h"
... ...
@@ -58,10 +58,7 @@
58 58
 
59 59
 #include <errno.h>
60 60
 
61
-#include <openssl/ssl.h>
62
-#include <openssl/err.h>
63
-#include "libclamav/crypto.h"
64
-
61
+#include "clamav.h"
65 62
 #include "hostid.h"
66 63
 #include "libclamav/others.h"
67 64
 
... ...
@@ -40,10 +40,7 @@
40 40
 #include <stdio.h>
41 41
 #include <ctype.h>
42 42
 
43
-#include <openssl/ssl.h>
44
-#include <openssl/err.h>
45
-#include "libclamav/crypto.h"
46
-
43
+#include "clamav.h"
47 44
 #include "fmap.h"
48 45
 #include "others.h"
49 46
 #include "htmlnorm.h"
... ...
@@ -46,17 +46,12 @@ const char inflate64_copyright[] =
46 46
   copyright string in the executable of your product.
47 47
  */
48 48
 
49
-
50
-
51
-#include <openssl/ssl.h>
52
-#include <openssl/err.h>
53
-#include "libclamav/crypto.h"
54
-
55 49
 #include "inflate64_priv.h"
56 50
 
57 51
 #include <stdlib.h> /* calloc/free */
58 52
 #include <string.h> /* memcpy */
59 53
 
54
+#include "clamav.h"
60 55
 #include "others.h"
61 56
 
62 57
 /* function prototypes */
... ...
@@ -20,10 +20,7 @@
20 20
 #include <sys/types.h>
21 21
 #include "is_tar.h"
22 22
 
23
-#include <openssl/ssl.h>
24
-#include <openssl/err.h>
25
-#include "libclamav/crypto.h"
26
-
23
+#include "clamav.h"
27 24
 #include "others.h"
28 25
 
29 26
 #define	isodigit(c)	( ((c) >= '0') && ((c) <= '7') )
... ...
@@ -42,10 +42,7 @@
42 42
 #endif
43 43
 #include <zlib.h>
44 44
 
45
-#include <openssl/ssl.h>
46
-#include <openssl/err.h>
47
-#include "libclamav/crypto.h"
48
-
45
+#include "clamav.h"
49 46
 #include "scanners.h"
50 47
 #include "cltypes.h"
51 48
 #include "others.h"
... ...
@@ -20,10 +20,7 @@
20 20
 
21 21
 #include <string.h>
22 22
 
23
-#include <openssl/ssl.h>
24
-#include <openssl/err.h>
25
-#include "libclamav/crypto.h"
26
-
23
+#include "clamav.h"
27 24
 #include "scanners.h"
28 25
 #include "iso9660.h"
29 26
 #include "fmap.h"
... ...
@@ -33,10 +33,6 @@
33 33
 #endif
34 34
 #include <time.h>
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
40 36
 #include "cltypes.h"
41 37
 #include "jpeg.h"
42 38
 #include "clamav.h"
... ...
@@ -23,10 +23,7 @@
23 23
 #include "clamav-config.h"
24 24
 #endif
25 25
 
26
-#include <openssl/ssl.h>
27
-#include <openssl/err.h>
28
-#include "libclamav/crypto.h"
29
-
26
+#include "clamav.h"
30 27
 #include "cltypes.h"
31 28
 #include "others.h"
32 29
 #include "json_api.h"
... ...
@@ -34,10 +34,7 @@
34 34
 #include <ctype.h>
35 35
 #include <assert.h>
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
37
+#include "clamav.h"
41 38
 #include "cltypes.h"
42 39
 #include "jsparse/lexglobal.h"
43 40
 #include "hashtab.h"
... ...
@@ -63,10 +63,7 @@ static	char	const	rcsid[] = "$Id: line.c,v 1.11 2007/02/12 20:46:08 njh Exp $";
63 63
 #include <string.h>
64 64
 #include <assert.h>
65 65
 
66
-#include <openssl/ssl.h>
67
-#include <openssl/err.h>
68
-#include "libclamav/crypto.h"
69
-
66
+#include "clamav.h"
70 67
 #include "line.h"
71 68
 #include "others.h"
72 69
 
... ...
@@ -24,10 +24,7 @@
24 24
 #include "clamav-config.h"
25 25
 #endif
26 26
 
27
-#include <openssl/ssl.h>
28
-#include <openssl/err.h>
29
-#include "libclamav/crypto.h"
30
-
27
+#include "clamav.h"
31 28
 #include "lzma_iface.h"
32 29
 
33 30
 void *__lzma_wrap_alloc(void *unused, size_t size) { 
... ...
@@ -28,10 +28,6 @@
28 28
 #include <sys/stat.h>
29 29
 #include <fcntl.h>
30 30
 
31
-#include <openssl/ssl.h>
32
-#include <openssl/err.h>
33
-#include "libclamav/crypto.h"
34
-
35 31
 #include "clamav.h"
36 32
 #include "cltypes.h"
37 33
 #include "others.h"
... ...
@@ -33,10 +33,6 @@
33 33
 #include <unistd.h>
34 34
 #endif
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
40 36
 #include "clamav.h"
41 37
 #include "others.h"
42 38
 #include "matcher.h"
... ...
@@ -25,10 +25,6 @@
25 25
 #include <stdio.h>
26 26
 #include <assert.h>
27 27
 
28
-#include <openssl/ssl.h>
29
-#include <openssl/err.h>
30
-#include "libclamav/crypto.h"
31
-
32 28
 #include "clamav.h"
33 29
 #include "memory.h"
34 30
 #include "others.h"
... ...
@@ -21,10 +21,6 @@
21 21
 #include <string.h>
22 22
 #include <stdlib.h>
23 23
 
24
-#include <openssl/ssl.h>
25
-#include <openssl/err.h>
26
-#include "libclamav/crypto.h"
27
-
28 24
 #include "matcher.h"
29 25
 #include "others.h"
30 26
 #include "str.h"
... ...
@@ -30,10 +30,6 @@
30 30
 #include <unistd.h>
31 31
 #endif
32 32
 
33
-#include <openssl/ssl.h>
34
-#include <openssl/err.h>
35
-#include "libclamav/crypto.h"
36
-
37 33
 #include "clamav.h"
38 34
 #include "others.h"
39 35
 #include "matcher-ac.h"
... ...
@@ -64,10 +64,7 @@ static	char	const	rcsid[] = "$Id: mbox.c,v 1.381 2007/02/15 12:26:44 njh Exp $";
64 64
 #include <pthread.h>
65 65
 #endif
66 66
 
67
-#include <openssl/ssl.h>
68
-#include <openssl/err.h>
69
-#include "libclamav/crypto.h"
70
-
67
+#include "clamav.h"
71 68
 #include "others.h"
72 69
 #include "str.h"
73 70
 #include "filetypes.h"
... ...
@@ -31,10 +31,7 @@
31 31
 #include <fcntl.h>
32 32
 #include <zlib.h>
33 33
 
34
-#include <openssl/ssl.h>
35
-#include <openssl/err.h>
36
-#include "libclamav/crypto.h"
37
-
34
+#include "clamav.h"
38 35
 #include "cltypes.h"
39 36
 #include "others.h"
40 37
 #include "mbr.h"
... ...
@@ -47,15 +47,12 @@ static	char	const	rcsid[] = "$Id: message.c,v 1.195 2007/02/12 20:46:09 njh Exp
47 47
 #include <pthread.h>
48 48
 #endif
49 49
 
50
-#include <openssl/ssl.h>
51
-#include <openssl/err.h>
52
-#include "libclamav/crypto.h"
53
-
54 50
 #include "others.h"
55 51
 #include "str.h"
56 52
 #include "filetypes.h"
57 53
 
58 54
 #include "mbox.h"
55
+#include "clamav.h"
59 56
 
60 57
 #ifndef isblank
61 58
 #define isblank(c)	(((c) == ' ') || ((c) == '\t'))
... ...
@@ -48,10 +48,7 @@
48 48
 #include <string.h>
49 49
 #endif
50 50
 
51
-#include <openssl/ssl.h>
52
-#include <openssl/err.h>
53
-#include "libclamav/crypto.h"
54
-
51
+#include "clamav.h"
55 52
 #include "cltypes.h"
56 53
 #include "pe.h"
57 54
 #include "others.h"
... ...
@@ -40,10 +40,7 @@
40 40
 #endif
41 41
 #include <stddef.h>
42 42
 
43
-#include <openssl/ssl.h>
44
-#include <openssl/err.h>
45
-#include "libclamav/crypto.h"
46
-
43
+#include "clamav.h"
47 44
 #include "others.h"
48 45
 #include "str.h"
49 46
 #include "readdb.h"
... ...
@@ -29,10 +29,6 @@
29 29
 #include <fcntl.h>
30 30
 #include <string.h>
31 31
 
32
-#include <openssl/ssl.h>
33
-#include <openssl/err.h>
34
-#include "libclamav/crypto.h"
35
-
36 32
 #include "clamav.h"
37 33
 #include "cltypes.h"
38 34
 #include "others.h"
... ...
@@ -26,10 +26,6 @@
26 26
 #include <stdio.h>
27 27
 #include <string.h>
28 28
 
29
-#include <openssl/ssl.h>
30
-#include <openssl/err.h>
31
-#include "libclamav/crypto.h"
32
-
33 29
 #include "others.h"
34 30
 #include "clamav.h"
35 31
 #include "mspack.h"
... ...
@@ -30,10 +30,7 @@
30 30
 #include "clamav-config.h"
31 31
 #endif
32 32
 
33
-#include <openssl/ssl.h>
34
-#include <openssl/err.h>
35
-#include "libclamav/crypto.h"
36
-
33
+#include "clamav.h"
37 34
 #include "bzlib_private.h"
38 35
 #include "others.h"
39 36
 
... ...
@@ -31,10 +31,7 @@
31 31
 #include <unistd.h>
32 32
 #endif
33 33
 
34
-#include <openssl/ssl.h>
35
-#include <openssl/err.h>
36
-#include "libclamav/crypto.h"
37
-
34
+#include "clamav.h"
38 35
 #include "others.h"
39 36
 #include "cltypes.h"
40 37
 #include "nsis_bzlib.h"
... ...
@@ -35,10 +35,7 @@
35 35
 #include <stdlib.h>
36 36
 #include "clamav.h"
37 37
 
38
-#include <openssl/ssl.h>
39
-#include <openssl/err.h>
40
-#include "libclamav/crypto.h"
41
-
38
+#include "clamav.h"
42 39
 #include "cltypes.h"
43 40
 #include "others.h"
44 41
 #include "ole2_extract.h"
... ...
@@ -23,10 +23,7 @@
23 23
 #include "clamav-config.h"
24 24
 #endif
25 25
 
26
-#include <openssl/ssl.h>
27
-#include <openssl/err.h>
28
-#include "libclamav/crypto.h"
29
-
26
+#include "clamav.h"
30 27
 #include "cltypes.h"
31 28
 #include "others.h"
32 29
 #include "unzip.h"
... ...
@@ -26,10 +26,8 @@
26 26
 #include <dirent.h>
27 27
 #include <errno.h>
28 28
 #include <string.h>
29
-#include <openssl/ssl.h>
30
-#include <openssl/err.h>
31 29
 
32
-#include "libclamav/crypto.h"
30
+#include "clamav.h"
33 31
 #include "others.h"
34 32
 #include "openioc.h"
35 33
 
... ...
@@ -65,10 +65,6 @@
65 65
 #include <libxml/parser.h>
66 66
 #endif
67 67
 
68
-#include <openssl/ssl.h>
69
-#include <openssl/err.h>
70
-#include "libclamav/crypto.h"
71
-
72 68
 #include "clamav.h"
73 69
 #include "others.h"
74 70
 #include "cltypes.h"
... ...
@@ -52,10 +52,6 @@
52 52
 #include <malloc.h>
53 53
 #endif
54 54
 
55
-#include <openssl/ssl.h>
56
-#include <openssl/err.h>
57
-#include "libclamav/crypto.h"
58
-
59 55
 #include "clamav.h"
60 56
 #include "others.h"
61 57
 #include "cltypes.h"
... ...
@@ -22,10 +22,7 @@
22 22
 #include "clamav-config.h"
23 23
 #endif
24 24
 
25
-#include <openssl/ssl.h>
26
-#include <openssl/err.h>
27
-#include "libclamav/crypto.h"
28
-
25
+#include "clamav.h"
29 26
 #include "others.h"
30 27
 #include "execs.h"
31 28
 #include "pe.h"
... ...
@@ -49,10 +49,6 @@ static	char	const	rcsid[] = "$Id: pdf.c,v 1.61 2007/02/12 20:46:09 njh Exp $";
49 49
 #include <iconv.h>
50 50
 #endif
51 51
 
52
-#include <openssl/ssl.h>
53
-#include <openssl/err.h>
54
-#include "libclamav/crypto.h"
55
-
56 52
 #include "clamav.h"
57 53
 #include "others.h"
58 54
 #include "pdf.h"
... ...
@@ -56,10 +56,6 @@
56 56
 #include <iconv.h>
57 57
 #endif
58 58
 
59
-#include <openssl/ssl.h>
60
-#include <openssl/err.h>
61
-#include "libclamav/crypto.h"
62
-
63 59
 #include "clamav.h"
64 60
 #include "others.h"
65 61
 #include "pdf.h"
... ...
@@ -35,10 +35,6 @@
35 35
 #include <time.h>
36 36
 #include <stdarg.h>
37 37
 
38
-#include <openssl/ssl.h>
39
-#include <openssl/err.h>
40
-#include "libclamav/crypto.h"
41
-
42 38
 #include "cltypes.h"
43 39
 #include "clamav.h"
44 40
 #include "others.h"
... ...
@@ -25,10 +25,7 @@
25 25
 #include <string.h>
26 26
 #include <math.h>
27 27
 
28
-#include <openssl/ssl.h>
29
-#include <openssl/err.h>
30
-#include "libclamav/crypto.h"
31
-
28
+#include "clamav.h"
32 29
 #include "pe_icons.h"
33 30
 #include "others.h"
34 31
 
... ...
@@ -52,10 +52,7 @@
52 52
 #include <stdlib.h>
53 53
 #include <string.h>
54 54
 
55
-#include <openssl/ssl.h>
56
-#include <openssl/err.h>
57
-#include "libclamav/crypto.h"
58
-
55
+#include "clamav.h"
59 56
 #include "cltypes.h"
60 57
 #include "rebuildpe.h"
61 58
 #include "execs.h"
... ...
@@ -34,10 +34,6 @@
34 34
 #include <string.h>
35 35
 #include <ctype.h>
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
41 37
 #include "clamav.h"
42 38
 #include "others.h"
43 39
 #include "phishcheck.h"
... ...
@@ -34,10 +34,6 @@
34 34
 #include <string.h>
35 35
 #include <ctype.h>
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
41 37
 #include "clamav.h"
42 38
 #include "others.h"
43 39
 #include "phish_whitelist.h"
... ...
@@ -34,10 +34,6 @@
34 34
 #include <string.h>
35 35
 #include <ctype.h>
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
41 37
 #include "clamav.h"
42 38
 #include "cltypes.h"
43 39
 #include "others.h"
... ...
@@ -33,10 +33,6 @@
33 33
 #endif
34 34
 #include <zlib.h>
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
40 36
 #include "clamav.h"
41 37
 #include "others.h"
42 38
 #include "png.h"
... ...
@@ -22,10 +22,7 @@
22 22
 #include "clamav-config.h"
23 23
 #endif
24 24
 
25
-#include <openssl/ssl.h>
26
-#include <openssl/err.h>
27
-#include "libclamav/crypto.h"
28
-
25
+#include "clamav.h"
29 26
 #include "cltypes.h"
30 27
 #include "others.h"
31 28
 #include "prtn_intxn.h"
... ...
@@ -32,10 +32,7 @@
32 32
 
33 33
 #include <stdlib.h>
34 34
 
35
-#include <openssl/ssl.h>
36
-#include <openssl/err.h>
37
-#include "libclamav/crypto.h"
38
-
35
+#include "clamav.h"
39 36
 #include "platform.h"
40 37
 #include "cltypes.h"
41 38
 #include "others.h"
... ...
@@ -39,10 +39,6 @@
39 39
 #include <zlib.h>
40 40
 #include <errno.h>
41 41
 
42
-#include <openssl/ssl.h>
43
-#include <openssl/err.h>
44
-#include "libclamav/crypto.h"
45
-
46 42
 #include "clamav.h"
47 43
 #include "cvd.h"
48 44
 #ifdef	HAVE_STRINGS_H
... ...
@@ -40,10 +40,7 @@
40 40
 
41 41
 #include <string.h>
42 42
 
43
-#include <openssl/ssl.h>
44
-#include <openssl/err.h>
45
-#include "libclamav/crypto.h"
46
-
43
+#include "clamav.h"
47 44
 #include "rebuildpe.h"
48 45
 #include "others.h"
49 46
 
... ...
@@ -42,10 +42,7 @@
42 42
 #include <limits.h>
43 43
 #include <stdlib.h>
44 44
 
45
-#include <openssl/ssl.h>
46
-#include <openssl/err.h>
47
-#include "libclamav/crypto.h"
48
-
45
+#include "clamav.h"
49 46
 #include "others.h"
50 47
 #include "regex.h"
51 48
 
... ...
@@ -42,10 +42,7 @@
42 42
 #include <limits.h>
43 43
 #include <stdlib.h>
44 44
 
45
-#include <openssl/ssl.h>
46
-#include <openssl/err.h>
47
-#include "libclamav/crypto.h"
48
-
45
+#include "clamav.h"
49 46
 #include "others.h"
50 47
 #include "regex.h"
51 48
 
... ...
@@ -49,10 +49,7 @@
49 49
 #include <limits.h>
50 50
 #include <ctype.h>
51 51
 
52
-#include <openssl/ssl.h>
53
-#include <openssl/err.h>
54
-#include "libclamav/crypto.h"
55
-
52
+#include "clamav.h"
56 53
 #include "others.h"
57 54
 #include "regex.h"
58 55
 
... ...
@@ -39,10 +39,7 @@
39 39
 #include <stdio.h>
40 40
 #include <stdlib.h>
41 41
 
42
-#include <openssl/ssl.h>
43
-#include <openssl/err.h>
44
-#include "libclamav/crypto.h"
45
-
42
+#include "clamav.h"
46 43
 #include "others.h"
47 44
 #include "regex.h"
48 45
 
... ...
@@ -40,10 +40,6 @@
40 40
 #include <sys/types.h>
41 41
 #include <assert.h>
42 42
 
43
-#include <openssl/ssl.h>
44
-#include <openssl/err.h>
45
-#include "libclamav/crypto.h"
46
-
47 43
 #include "regex/regex.h"
48 44
 
49 45
 #include "clamav.h"
... ...
@@ -28,10 +28,7 @@
28 28
 #include <string.h>
29 29
 #include <assert.h>
30 30
 
31
-#include <openssl/ssl.h>
32
-#include <openssl/err.h>
33
-#include "libclamav/crypto.h"
34
-
31
+#include "clamav.h"
35 32
 #include "others.h"
36 33
 #include "jsparse/textbuf.h"
37 34
 #include "regex_suffix.h"
... ...
@@ -33,10 +33,6 @@
33 33
 #include <unistd.h>
34 34
 #endif
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
40 36
 #include "others.h"
41 37
 #include "rtf.h"
42 38
 #include "clamav.h"
... ...
@@ -44,10 +44,6 @@
44 44
 #include <sys/times.h>
45 45
 #endif
46 46
 
47
-#include <openssl/ssl.h>
48
-#include <openssl/err.h>
49
-#include "libclamav/crypto.h"
50
-
51 47
 #define DCONF_ARCH  ctx->dconf->archive
52 48
 #define DCONF_DOC   ctx->dconf->doc
53 49
 #define DCONF_MAIL  ctx->dconf->mail
... ...
@@ -38,10 +38,6 @@
38 38
 #include <fcntl.h>
39 39
 #include <zlib.h>
40 40
 
41
-#include <openssl/ssl.h>
42
-#include <openssl/err.h>
43
-#include "libclamav/crypto.h"
44
-
45 41
 #include "others.h"
46 42
 #include "clamav.h"
47 43
 #include "scanners.h"
... ...
@@ -34,10 +34,6 @@
34 34
 #include <netinet/in.h>
35 35
 #endif
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
41 37
 #include "clamav.h"
42 38
 #include "others.h"
43 39
 #include "cltypes.h"
... ...
@@ -55,10 +55,7 @@
55 55
 #include <stdlib.h>
56 56
 #include <string.h>
57 57
 
58
-#include <openssl/ssl.h>
59
-#include <openssl/err.h>
60
-#include "libclamav/crypto.h"
61
-
58
+#include "clamav.h"
62 59
 #include "cltypes.h"
63 60
 #include "pe.h"
64 61
 #include "rebuildpe.h"
... ...
@@ -53,10 +53,6 @@
53 53
 
54 54
 #include <errno.h>
55 55
 
56
-#include <openssl/ssl.h>
57
-#include <openssl/err.h>
58
-#include "libclamav/crypto.h"
59
-
60 56
 #include "libclamav/others.h"
61 57
 #include "libclamav/clamav.h"
62 58
 #include "libclamav/dconf.h"
... ...
@@ -34,10 +34,6 @@
34 34
 #include <Windows.h>
35 35
 #endif
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
41 37
 #include "libclamav/others.h"
42 38
 #include "libclamav/clamav.h"
43 39
 
... ...
@@ -33,10 +33,6 @@
33 33
 #include <ctype.h>
34 34
 #include <sys/types.h>
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
40 36
 #include "clamav.h"
41 37
 #include "others.h"
42 38
 #include "matcher.h"
... ...
@@ -45,10 +45,6 @@
45 45
 #include <time.h>
46 46
 #include <zlib.h>
47 47
 
48
-#include <openssl/ssl.h>
49
-#include <openssl/err.h>
50
-#include "libclamav/crypto.h"
51
-
52 48
 #include "cltypes.h"
53 49
 #include "swf.h"
54 50
 #include "clamav.h"
... ...
@@ -33,10 +33,7 @@
33 33
 #endif
34 34
 #include <assert.h>
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
36
+#include "clamav.h"
40 37
 #include "table.h"
41 38
 #include "others.h"
42 39
 
... ...
@@ -108,10 +108,7 @@ static	char	const	rcsid[] = "$Id: text.c,v 1.25 2007/02/12 20:46:09 njh Exp $";
108 108
 #include <assert.h>
109 109
 #include <stdio.h>
110 110
 
111
-#include <openssl/ssl.h>
112
-#include <openssl/err.h>
113
-#include "libclamav/crypto.h"
114
-
111
+#include "clamav.h"
115 112
 #include "others.h"
116 113
 
117 114
 #include "mbox.h"
... ...
@@ -43,10 +43,7 @@
43 43
 #include <unistd.h>
44 44
 #endif
45 45
 
46
-#include <openssl/ssl.h>
47
-#include <openssl/err.h>
48
-#include "libclamav/crypto.h"
49
-
46
+#include "clamav.h"
50 47
 #include "filetypes.h"
51 48
 #include "textdet.h"
52 49
 #include "others.h"
... ...
@@ -31,10 +31,6 @@ static	char	const	rcsid[] = "$Id: tnef.c,v 1.41 2007/02/12 22:22:27 njh Exp $";
31 31
 #include <unistd.h>
32 32
 #endif
33 33
 
34
-#include <openssl/ssl.h>
35
-#include <openssl/err.h>
36
-#include "libclamav/crypto.h"
37
-
38 34
 #include "cltypes.h"
39 35
 #include "clamav.h"
40 36
 #include "others.h"
... ...
@@ -36,10 +36,6 @@
36 36
 #include <clamav.h>
37 37
 #include <ctype.h>
38 38
 
39
-#include <openssl/ssl.h>
40
-#include <openssl/err.h>
41
-#include "libclamav/crypto.h"
42
-
43 39
 #include "clamav.h"
44 40
 #include "cltypes.h"
45 41
 #include "others.h"
... ...
@@ -29,10 +29,7 @@
29 29
 #include <string.h>
30 30
 #endif
31 31
 
32
-#include <openssl/ssl.h>
33
-#include <openssl/err.h>
34
-#include "libclamav/crypto.h"
35
-
32
+#include "clamav.h"
36 33
 #include "uniq.h"
37 34
 #include "others.h"
38 35
 
... ...
@@ -111,10 +111,6 @@ nsp1:00435A5A                 push    8000h
111 111
 
112 112
 #include <stdlib.h>
113 113
 
114
-#include <openssl/ssl.h>
115
-#include <openssl/err.h>
116
-#include "libclamav/crypto.h"
117
-
118 114
 #include "cltypes.h"
119 115
 #include "clamav.h"
120 116
 #include "others.h"
... ...
@@ -36,10 +36,6 @@ static	char	const	rcsid[] = "$Id: untar.c,v 1.35 2007/02/12 20:46:09 njh Exp $";
36 36
 #include <sys/param.h>	/* for NAME_MAX */
37 37
 #endif
38 38
 
39
-#include <openssl/ssl.h>
40
-#include <openssl/err.h>
41
-#include "libclamav/crypto.h"
42
-
43 39
 #include "clamav.h"
44 40
 #include "others.h"
45 41
 #include "untar.h"
... ...
@@ -36,10 +36,6 @@
36 36
 #include <stdlib.h>
37 37
 #include <stdio.h>
38 38
 
39
-#include <openssl/ssl.h>
40
-#include <openssl/err.h>
41
-#include "libclamav/crypto.h"
42
-
43 39
 #include <zlib.h>
44 40
 #include "inflate64.h"
45 41
 #if HAVE_BZLIB_H
... ...
@@ -39,10 +39,7 @@
39 39
 #include <string.h>
40 40
 #endif
41 41
 
42
-#include <openssl/ssl.h>
43
-#include <openssl/err.h>
44
-#include "libclamav/crypto.h"
45
-
42
+#include "clamav.h"
46 43
 #include "cltypes.h"
47 44
 #include "pe.h"
48 45
 #include "rebuildpe.h"
... ...
@@ -52,10 +52,7 @@
52 52
 #include <stdlib.h>
53 53
 #include <string.h>
54 54
 
55
-#include <openssl/ssl.h>
56
-#include <openssl/err.h>
57
-#include "libclamav/crypto.h"
58
-
55
+#include "clamav.h"
59 56
 #include "cltypes.h"
60 57
 #include "others.h"
61 58
 #include "upx.h"
... ...
@@ -37,10 +37,6 @@ static	char	const	rcsid[] = "$Id: uuencode.c,v 1.8 2006/12/11 11:55:11 njh Exp $
37 37
 #include <strings.h>
38 38
 #endif
39 39
 
40
-#include <openssl/ssl.h>
41
-#include <openssl/err.h>
42
-#include "libclamav/crypto.h"
43
-
44 40
 #include "others.h"
45 41
 #include "str.h"
46 42
 
... ...
@@ -34,10 +34,6 @@
34 34
 #include <ctype.h>
35 35
 #include <zlib.h>
36 36
 
37
-#include <openssl/ssl.h>
38
-#include <openssl/err.h>
39
-#include "libclamav/crypto.h"
40
-
41 37
 #include "clamav.h"
42 38
 
43 39
 #include "others.h"
... ...
@@ -22,10 +22,7 @@
22 22
 #include "clamav-config.h"
23 23
 #endif
24 24
 
25
-#include <openssl/ssl.h>
26
-#include <openssl/err.h>
27
-#include "libclamav/crypto.h"
28
-
25
+#include "clamav.h"
29 26
 #include "cltypes.h"
30 27
 #include "others.h"
31 28
 #include "execs.h"
... ...
@@ -46,10 +46,6 @@
46 46
 
47 47
 #include "platform.h"
48 48
 
49
-#include <openssl/ssl.h>
50
-#include <openssl/err.h>
51
-#include "libclamav/crypto.h"
52
-
53 49
 #include "libclamav/others.h"
54 50
 #include "libclamav/clamav.h"
55 51
 #include "libclamav/www.h"
... ...
@@ -22,10 +22,6 @@
22 22
 #include "clamav-config.h"
23 23
 #endif
24 24
 
25
-#include <openssl/ssl.h>
26
-#include <openssl/err.h>
27
-#include "libclamav/crypto.h"
28
-
29 25
 #include <errno.h>
30 26
 #include "xar.h"
31 27
 #include "fmap.h"
... ...
@@ -36,6 +32,7 @@
36 36
 #endif
37 37
 #endif
38 38
 #include <libxml/xmlreader.h>
39
+#include "clamav.h"
39 40
 #include "str.h"
40 41
 #include "scanners.h"
41 42
 #include "inflate64.h"
... ...
@@ -22,10 +22,7 @@
22 22
 #include "clamav-config.h"
23 23
 #endif
24 24
 
25
-#include <openssl/ssl.h>
26
-#include <openssl/err.h>
27
-#include "libclamav/crypto.h"
28
-
25
+#include "clamav.h"
29 26
 #include "7z/XzCrc64.h"
30 27
 #include "xz_iface.h"
31 28
 
... ...
@@ -31,10 +31,7 @@
31 31
 #include "clamav-config.h"
32 32
 #endif
33 33
 
34
-#include <openssl/ssl.h>
35
-#include <openssl/err.h>
36
-#include "libclamav/crypto.h"
37
-
34
+#include "clamav.h"
38 35
 #include "cltypes.h"
39 36
 #include "pe.h"
40 37
 #include "others.h"
... ...
@@ -32,10 +32,7 @@
32 32
 #include <unistd.h>
33 33
 #endif
34 34
 
35
-#include <openssl/ssl.h>
36
-#include <openssl/err.h>
37
-#include "libclamav/crypto.h"
38
-
35
+#include "clamav.h"
39 36
 #include "shared/misc.h"
40 37
 #include "shared/output.h"
41 38
 #include "shared/cdiff.h"
... ...
@@ -39,10 +39,6 @@
39 39
 #include <ctype.h>
40 40
 #include <errno.h>
41 41
 
42
-#include <openssl/ssl.h>
43
-#include <openssl/err.h>
44
-#include "libclamav/crypto.h"
45
-
46 42
 #include "shared/optparser.h"
47 43
 #include "shared/output.h"
48 44
 
... ...
@@ -38,10 +38,7 @@
38 38
 #endif
39 39
 #include <ctype.h>
40 40
 
41
-#include <openssl/ssl.h>
42
-#include <openssl/err.h>
43
-#include "libclamav/crypto.h"
44
-
41
+#include "libclamav/clamav.h"
45 42
 #include "shared/optparser.h"
46 43
 #include "shared/misc.h"
47 44
 
... ...
@@ -50,10 +50,6 @@
50 50
 #include <syslog.h>
51 51
 #endif
52 52
 
53
-#include <openssl/ssl.h>
54
-#include <openssl/err.h>
55
-#include "libclamav/crypto.h"
56
-
57 53
 #include "output.h"
58 54
 #include "libclamav/clamav.h"
59 55
 #include "libclamav/others.h"
... ...
@@ -52,10 +52,6 @@
52 52
 #include <termios.h>
53 53
 #endif
54 54
 
55
-#include <openssl/ssl.h>
56
-#include <openssl/err.h>
57
-#include "libclamav/crypto.h"
58
-
59 55
 #include "vba.h"
60 56
 
61 57
 #include "shared/output.h"
... ...
@@ -33,10 +33,6 @@
33 33
 #include <dirent.h>
34 34
 #include <ctype.h>
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
40 36
 #include "libclamav/clamav.h"
41 37
 #include "libclamav/vba_extract.h"
42 38
 #include "libclamav/cltypes.h"
... ...
@@ -32,10 +32,6 @@
32 32
 #include <fcntl.h>
33 33
 #include <errno.h>
34 34
 
35
-#include <openssl/ssl.h>
36
-#include <openssl/err.h>
37
-#include "libclamav/crypto.h"
38
-
39 35
 #include "../libclamav/clamav.h"
40 36
 #include "../libclamav/others.h"
41 37
 #include "../libclamav/bytecode.h"
... ...
@@ -13,10 +13,6 @@
13 13
 #include <dirent.h>
14 14
 #include <sys/mman.h>
15 15
 
16
-#include <openssl/ssl.h>
17
-#include <openssl/err.h>
18
-#include "libclamav/crypto.h"
19
-
20 16
 #if HAVE_LIBXML2
21 17
 #include <libxml/parser.h>
22 18
 #endif
... ...
@@ -32,10 +32,6 @@
32 32
 #include <string.h>
33 33
 #include <sys/stat.h>
34 34
 
35
-#include <openssl/ssl.h>
36
-#include <openssl/err.h>
37
-#include "libclamav/crypto.h"
38
-
39 35
 #include "../libclamav/clamav.h"
40 36
 #include "../libclamav/others.h"
41 37
 #include "../libclamav/disasm.h"
... ...
@@ -23,11 +23,8 @@
23 23
 #include <fcntl.h>
24 24
 #include <string.h>
25 25
 
26
-#include <openssl/ssl.h>
27
-#include <openssl/err.h>
28
-#include "libclamav/crypto.h"
29
-
30 26
 #include "checks.h"
27
+#include "../libclamav/clamav.h"
31 28
 #include "../libclamav/fmap.h"
32 29
 #include "../libclamav/dconf.h"
33 30
 #include "../libclamav/htmlnorm.h"
... ...
@@ -33,10 +33,6 @@
33 33
 #include <ctype.h>
34 34
 #include <errno.h>
35 35
 
36
-#include <openssl/ssl.h>
37
-#include <openssl/err.h>
38
-#include "libclamav/crypto.h"
39
-
40 36
 #include "../libclamav/clamav.h"
41 37
 #include "../libclamav/others.h"
42 38
 #include "../libclamav/dconf.h"
... ...
@@ -25,10 +25,6 @@
25 25
 #include <stdio.h>
26 26
 #include <string.h>
27 27
 
28
-#include <openssl/ssl.h>
29
-#include <openssl/err.h>
30
-#include "libclamav/crypto.h"
31
-
32 28
 #include "../libclamav/clamav.h"
33 29
 #include "../libclamav/readdb.h"
34 30
 #include "../libclamav/matcher.h"
... ...
@@ -29,10 +29,6 @@
29 29
 #include <string.h>
30 30
 #include <check.h>
31 31
 
32
-#include <openssl/ssl.h>
33
-#include <openssl/err.h>
34
-#include "libclamav/crypto.h"
35
-
36 32
 #include "../libclamav/clamav.h"
37 33
 #include "../libclamav/others.h"
38 34
 #include "../libclamav/mbox.h"
... ...
@@ -30,10 +30,6 @@
30 30
 #include <string.h>
31 31
 #include <check.h>
32 32
 
33
-#include <openssl/ssl.h>
34
-#include <openssl/err.h>
35
-#include "libclamav/crypto.h"
36
-
37 33
 #include "../libclamav/clamav.h"
38 34
 #include "../libclamav/others.h"
39 35
 #include "../libclamav/str.h"
... ...
@@ -21,10 +21,6 @@
21 21
 #include "clamav-config.h"
22 22
 #endif
23 23
 
24
-#include <openssl/ssl.h>
25
-#include <openssl/err.h>
26
-#include "libclamav/crypto.h"
27
-
28 24
 #include "clamav.h"
29 25
 #include "clscanapi.h"
30 26
 #include "iface_errors.h"
... ...
@@ -21,10 +21,6 @@
21 21
 #include "clamav-config.h"
22 22
 #endif
23 23
 
24
-#include <openssl/ssl.h>
25
-#include <openssl/err.h>
26
-#include "libclamav/crypto.h"
27
-
28 24
 #include "clamav.h"
29 25
 #include "others.h"
30 26
 #include "shared/output.h"
... ...
@@ -21,10 +21,6 @@
21 21
 #include "clamav-config.h"
22 22
 #endif
23 23
 
24
-#include <openssl/ssl.h>
25
-#include <openssl/err.h>
26
-#include "libclamav/crypto.h"
27
-
28 24
 #include "clamav.h"
29 25
 #include "shared/output.h"
30 26
 #include "interface.h"
... ...
@@ -21,10 +21,7 @@
21 21
 #include <stdio.h>
22 22
 #include <io.h>
23 23
 
24
-#include <openssl/ssl.h>
25
-#include <openssl/err.h>
26
-#include "libclamav/crypto.h"
27
-
24
+#include "libclamav/clamav.h"
28 25
 #include "flog.h"
29 26
 
30 27
 static HANDLE logh = INVALID_HANDLE_VALUE;
... ...
@@ -22,10 +22,7 @@
22 22
 #include <stdio.h>
23 23
 #include <stdlib.h>
24 24
 
25
-#include <openssl/ssl.h>
26
-#include <openssl/err.h>
27
-#include "libclamav/crypto.h"
28
-
25
+#include "libclamav/clamav.h"
29 26
 #include "clupdate.h"
30 27
 #include "flog.h"
31 28
 
... ...
@@ -20,10 +20,7 @@
20 20
 
21 21
 #include <errno.h>
22 22
 
23
-#include <openssl/ssl.h>
24
-#include <openssl/err.h>
25
-#include "libclamav/crypto.h"
26
-
23
+#include "clamav.h"
27 24
 #include "others.h"
28 25
 #include "dirent.h"
29 26
 #include "w32_stat.h"
... ...
@@ -24,10 +24,7 @@
24 24
 #include <fcntl.h>
25 25
 #include <io.h>
26 26
 
27
-#include <openssl/ssl.h>
28
-#include <openssl/err.h>
29
-#include "libclamav/crypto.h"
30
-
27
+#include "clamav.h"
31 28
 #include "others.h"
32 29
 #include "shared/misc.h"
33 30
 
... ...
@@ -506,7 +506,6 @@
506 506
   </ItemGroup>
507 507
   <ItemGroup>
508 508
     <ClInclude Include="..\libclamav\conv.h" />
509
-    <ClInclude Include="..\libclamav\crypto.h" />
510 509
     <ClInclude Include="..\libclamav\hostid.h" />
511 510
     <ClInclude Include="..\libclamav\stats_json.h" />
512 511
     <ClInclude Include="..\libclamav\stats.h" />
... ...
@@ -519,4 +518,4 @@
519 519
     <Library Include="libeay32.lib" />
520 520
     <Library Include="ssleay32.lib" />
521 521
   </ItemGroup>
522
-</Project>
523 522
\ No newline at end of file
523
+</Project>
... ...
@@ -926,12 +926,9 @@
926 926
     <ClInclude Include="..\libclamav\conv.h">
927 927
       <Filter>Source Files</Filter>
928 928
     </ClInclude>
929
-    <ClInclude Include="..\libclamav\crypto.h">
930
-      <Filter>Source Files</Filter>
931
-    </ClInclude>
932 929
   </ItemGroup>
933 930
   <ItemGroup>
934 931
     <Library Include="libeay32.lib" />
935 932
     <Library Include="ssleay32.lib" />
936 933
   </ItemGroup>
937
-</Project>
938 934
\ No newline at end of file
935
+</Project>