... | ... |
@@ -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" |
... | ... |
@@ -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" |
... | ... |
@@ -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" |
... | ... |
@@ -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" |
... | ... |
@@ -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) |
... | ... |
@@ -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 \ |
... | ... |
@@ -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" |
... | ... |
@@ -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" |
... | ... |
@@ -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 |
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 |
... | ... |
@@ -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, |
... | ... |
@@ -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 */ |
... | ... |
@@ -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 |
|
... | ... |
@@ -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" |
... | ... |
@@ -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')) |
... | ... |
@@ -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" |
... | ... |
@@ -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" |
... | ... |
@@ -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 @@ 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" |
... | ... |
@@ -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 |
|
... | ... |
@@ -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" |
... | ... |
@@ -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" |
... | ... |
@@ -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> |