From: Christian Hofstaedtler Date: Sat, 2 Jan 2016 21:25:44 +0000 (+0100) Subject: Port md5.hh to OpenSSL X-Git-Tag: dnsdist-1.0.0-alpha2~61^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a8f0861dcc93019bbf9a5a51be942d976803dc8;p=thirdparty%2Fpdns.git Port md5.hh to OpenSSL --- diff --git a/pdns/md5.hh b/pdns/md5.hh index a193a2a3f3..9a90937685 100644 --- a/pdns/md5.hh +++ b/pdns/md5.hh @@ -5,15 +5,23 @@ #include #ifdef HAVE_MBEDTLS2 #include -#else +#elif defined(HAVE_MBEDTLS) #include #include "mbedtlscompat.hh" +#elif HAVE_OPENSSL +#include #endif inline std::string pdns_md5sum(const std::string& input) { unsigned char result[16] = {0}; +#ifdef HAVE_MBEDTLS mbedtls_md5(reinterpret_cast(input.c_str()), input.length(), result); +#elif defined(HAVE_OPENSSL) + MD5(reinterpret_cast(input.c_str()), input.length(), result); +#else +#error "No md5 implementation found" +#endif return std::string(result, result + sizeof result); }