summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2012-09-14 13:00:43 +0000
committerdes <des@FreeBSD.org>2012-09-14 13:00:43 +0000
commitd123c9234ae289c7dbbfc08aa606b6210225894c (patch)
tree89d24b3ace757e720aa805edd70372169e23c164 /lib/libfetch
parentf1f9181f8f4d1c028699c9065064f1bf4f47b703 (diff)
downloadFreeBSD-src-d123c9234ae289c7dbbfc08aa606b6210225894c.zip
FreeBSD-src-d123c9234ae289c7dbbfc08aa606b6210225894c.tar.gz
Use libmd if and only if OpenSSL is not available.
PR: bin/171402 MFC after: 3 days
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/Makefile4
-rw-r--r--lib/libfetch/http.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/libfetch/Makefile b/lib/libfetch/Makefile
index 7b29aa2..085aba2 100644
--- a/lib/libfetch/Makefile
+++ b/lib/libfetch/Makefile
@@ -16,8 +16,8 @@ CFLAGS+= -DINET6
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DWITH_SSL
-DPADD= ${LIBSSL} ${LIBCRYPTO} ${LIBMD}
-LDADD= -lssl -lcrypto -lmd
+DPADD= ${LIBSSL} ${LIBCRYPTO}
+LDADD= -lssl -lcrypto
.else
DPADD= ${LIBMD}
LDADD= -lmd
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index f6e063a..97fe47c 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -76,7 +76,15 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <time.h>
#include <unistd.h>
+
+#ifdef WITH_SSL
+#include <openssl/md5.h>
+#define MD5Init(c) MD5_Init(c)
+#define MD5Update(c, data, len) MD5_Update(c, data, len)
+#define MD5Final(md, c) MD5_Final(md, c)
+#else
#include <md5.h>
+#endif
#include <netinet/in.h>
#include <netinet/tcp.h>
OpenPOWER on IntegriCloud