]> git.ipfire.org Git - people/ms/dma.git/commitdiff
dma: unconditionally use openssl
authorSimon Schubert <corecode@dragonflybsd.org>
Thu, 16 Jul 2009 10:24:44 +0000 (12:24 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Thu, 16 Jul 2009 14:13:07 +0000 (16:13 +0200)
Drop HAVE_CRYPTO and unconditionally use openssl.  Dma is supposed to be
small and secure, so there is no way around openssl anyways.

Makefile
crypto.c
dma.c
dma.h
net.c

index d5adfeefc8553bf79c6e238b182a09828f9e149c..5d7f30fd0972f3b7ad3d9cb60518812bda12f02a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,6 @@
 # $DragonFly: src/libexec/dma/Makefile,v 1.5 2008/09/19 00:36:57 corecode Exp $
 #
 
-CFLAGS+= -DHAVE_CRYPTO
 CFLAGS+= -I${.CURDIR}
 
 DPADD=  ${LIBSSL} ${LIBCRYPTO}
index 7e5f29211785bc7aa8dd1cd01bef21f435579272..a75fc5b2f024ad3b1e00d4f23d81da936c2b51f4 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -35,8 +35,6 @@
  * $DragonFly: src/libexec/dma/crypto.c,v 1.4 2008/09/30 17:47:21 swildner Exp $
  */
 
-#ifdef HAVE_CRYPTO
-
 #include <openssl/x509.h>
 #include <openssl/md5.h>
 #include <openssl/ssl.h>
@@ -305,5 +303,3 @@ smtp_auth_md5(struct qitem *it, int fd, char *login, char *password)
 
        return (0);
 }
-
-#endif /* HAVE_CRYPTO */
diff --git a/dma.c b/dma.c
index ef0639aff8beac7f6b7a7bd87c79c2f4c26a23e0..2db8dcd549e86fabc32352cdeb95ec6eef68b67f 100644 (file)
--- a/dma.c
+++ b/dma.c
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#ifdef HAVE_CRYPTO
-#include <openssl/ssl.h>
-#endif /* HAVE_CRYPTO */
-
 #include <dirent.h>
 #include <err.h>
 #include <errno.h>
diff --git a/dma.h b/dma.h
index 9128f37650cce61045b526658d940be14aa23695..dc9a39b20f919020d835afc65861508beba817ca 100644 (file)
--- a/dma.h
+++ b/dma.h
@@ -38,9 +38,7 @@
 #ifndef DMA_H
 #define DMA_H
 
-#ifdef HAVE_CRYPTO
 #include <openssl/ssl.h>
-#endif /* HAVE_CRYPTO */
 
 #include <sys/queue.h>
 #include <stdint.h>
@@ -118,9 +116,7 @@ struct config {
        char *authpath;
        char *certfile;
        int features;
-#ifdef HAVE_CRYPTO
        SSL *ssl;
-#endif /* HAVE_CRYPTO */
        char *mailname;
        char *mailnamefile;
 };
@@ -156,11 +152,9 @@ extern int parse_virtuser(const char *);
 extern int parse_authfile(const char *);
 
 /* crypto.c */
-#ifdef HAVE_CRYPTO
 extern void hmac_md5(unsigned char *, int, unsigned char *, int, caddr_t);
 extern int smtp_auth_md5(struct qitem *, int, char *, char *);
 extern int smtp_init_crypto(struct qitem *, int, int);
-#endif /* HAVE_CRYPTO */
 
 /* net.c */
 extern int read_remote(int, int, char *);
diff --git a/net.c b/net.c
index 8dd09bf194417258f9ccfd7375da0734a8aebabe..bcd3ce5b51d49e4fc591a652e9848d71fabe3b3e 100644 (file)
--- a/net.c
+++ b/net.c
@@ -43,9 +43,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#ifdef HAVE_CRYPTO
 #include <openssl/ssl.h>
-#endif /* HAVE_CRYPTO */
 
 #include <err.h>
 #include <errno.h>
@@ -200,7 +198,6 @@ smtp_login(struct qitem *it, int fd, char *login, char* password)
        char *temp;
        int len, res = 0;
 
-#ifdef HAVE_CRYPTO
        res = smtp_auth_md5(it, fd, login, password);
        if (res == 0) {
                return (0);
@@ -211,7 +208,6 @@ smtp_login(struct qitem *it, int fd, char *login, char* password)
         */
                return (-1);
        }
-#endif /* HAVE_CRYPTO */
 
        if ((config->features & INSECURE) != 0) {
                /* Send AUTH command according to RFC 2554 */
@@ -355,7 +351,6 @@ deliver_remote(struct qitem *it, const char **errmsg)
        }
        config->features &= ~NOSSL;
 
-#ifdef HAVE_CRYPTO
        if ((config->features & SECURETRANS) != 0) {
                error = smtp_init_crypto(it, fd, config->features);
                if (error >= 0)
@@ -364,7 +359,6 @@ deliver_remote(struct qitem *it, const char **errmsg)
                else
                        goto out;
        }
-#endif /* HAVE_CRYPTO */
 
        send_remote_command(fd, "EHLO %s", hostname());
        if (read_remote(fd, 0, NULL) != 2) {