Fix cygwin build

(cherry picked from commit f1ef8c79db)
This commit is contained in:
Alexey Sokolov
2016-07-19 22:24:27 +01:00
parent dd58e369f8
commit aff7e25043
2 changed files with 12 additions and 6 deletions
+9 -3
View File
@@ -14,6 +14,11 @@
* limitations under the License.
*/
#ifndef _XOPEN_SOURCE
// strptime() wants this
#define _XOPEN_SOURCE 600
#endif
#include <znc/Utils.h>
#include <znc/ZNCDebug.h>
#include <znc/FileUtils.h>
@@ -21,6 +26,7 @@
#include <openssl/ssl.h>
#endif /* HAVE_LIBSSL */
#include <unistd.h>
#include <time.h>
#ifdef HAVE_ICU
#include <unicode/ucnv.h>
@@ -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;