Feature/ws windows (#86)
* try to build ws on window on travis 📮 * cmake invocation fixed on windows 🐝 * Can use mbedtls to calculate hmac + no openssl config option * build only windows on travis 🕢 * run msbuild 💷 * proper command to build 🕛 * some build fixes * change weird sizeof call 🐙 * warning and missing includes fixes 💮 * ifdef out statsd code on windows 🐍 * logic invertion in ifdef 👄 * bring back makefile 📜 * command line tool is built with mbedtls 🏥
This commit is contained in:
committed by
GitHub
parent
17eaa323ed
commit
fa84ade6be
@ -3,10 +3,14 @@
|
||||
* Author: Benjamin Sergeant
|
||||
* Copyright (c) 2018 Machine Zone. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "IXHMac.h"
|
||||
#include "IXBase64.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#if defined(IXWEBSOCKET_USE_MBED_TLS)
|
||||
# include <mbedtls/md.h>
|
||||
#elif defined(__APPLE__)
|
||||
# include <ixwebsocket/IXSocketMbedTLS.h>
|
||||
# include <CommonCrypto/CommonHMAC.h>
|
||||
#else
|
||||
# include <openssl/hmac.h>
|
||||
@ -19,7 +23,12 @@ namespace ix
|
||||
constexpr size_t hashSize = 16;
|
||||
unsigned char hash[hashSize];
|
||||
|
||||
#ifdef __APPLE__
|
||||
#if defined(IXWEBSOCKET_USE_MBED_TLS)
|
||||
mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_MD5),
|
||||
(unsigned char *) key.c_str(), key.size(),
|
||||
(unsigned char *) data.c_str(), data.size(),
|
||||
(unsigned char *) &hash);
|
||||
#elif defined(__APPLE__)
|
||||
CCHmac(kCCHmacAlgMD5,
|
||||
key.c_str(), key.size(),
|
||||
data.c_str(), data.size(),
|
||||
|
Reference in New Issue
Block a user