diff --git a/include/znc/Utils.h b/include/znc/Utils.h index 2322a8aa..bbab8eef 100644 --- a/include/znc/Utils.h +++ b/include/znc/Utils.h @@ -224,16 +224,16 @@ public: ~CBlowfish(); //! output must be freed - static unsigned char *MD5(const unsigned char *input, u_int ilen); + static unsigned char *MD5(const unsigned char *input, unsigned int ilen); //! returns an md5 of the CString (not hex encoded) static CString MD5(const CString & sInput, bool bHexEncode = false); //! output must be the same size as input - void Crypt(unsigned char *input, unsigned char *output, u_int ibytes); + void Crypt(unsigned char *input, unsigned char *output, unsigned int ibytes); //! must free result - unsigned char * Crypt(unsigned char *input, u_int ibytes); + unsigned char * Crypt(unsigned char *input, unsigned int ibytes); CString Crypt(const CString & sData); private: diff --git a/src/Utils.cpp b/src/Utils.cpp index 963a4e4d..2584c50a 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -14,6 +14,11 @@ * limitations under the License. */ +#ifndef _XOPEN_SOURCE +// strptime() wants this +#define _XOPEN_SOURCE 600 +#endif + #include #include #include @@ -21,6 +26,7 @@ #include #endif /* HAVE_LIBSSL */ #include +#include #ifdef HAVE_ICU #include @@ -792,7 +798,7 @@ CBlowfish::~CBlowfish() { } //! output must be freed -unsigned char *CBlowfish::MD5(const unsigned char *input, u_int ilen) { +unsigned char *CBlowfish::MD5(const unsigned char *input, unsigned int ilen) { unsigned char *output = (unsigned char *)malloc(MD5_DIGEST_LENGTH); ::MD5(input, ilen, output); return output; @@ -817,12 +823,12 @@ CString CBlowfish::MD5(const CString & sInput, bool bHexEncode) { } //! output must be the same size as input -void CBlowfish::Crypt(unsigned char *input, unsigned char *output, u_int uBytes) { +void CBlowfish::Crypt(unsigned char *input, unsigned char *output, unsigned int uBytes) { BF_cfb64_encrypt(input, output, uBytes, &m_bkey, m_ivec, &m_num, m_iEncrypt); } //! must free result -unsigned char * CBlowfish::Crypt(unsigned char *input, u_int uBytes) { +unsigned char * CBlowfish::Crypt(unsigned char *input, unsigned int uBytes) { unsigned char *buff = (unsigned char *)malloc(uBytes); Crypt(input, buff, uBytes); return buff;