summaryrefslogtreecommitdiff
path: root/cpp/src/IceWS/Util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceWS/Util.cpp')
-rw-r--r--cpp/src/IceWS/Util.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/cpp/src/IceWS/Util.cpp b/cpp/src/IceWS/Util.cpp
index 16820ca0999..fc4388aff44 100644
--- a/cpp/src/IceWS/Util.cpp
+++ b/cpp/src/IceWS/Util.cpp
@@ -13,40 +13,12 @@
#include <Ice/LocalException.h>
#include <IceUtil/StringUtil.h>
-#ifndef ICE_OS_WINRT
-# include <openssl/err.h>
-# include <openssl/sha.h>
-#endif
-
#include <IceUtil/DisableWarnings.h>
using namespace std;
using namespace Ice;
using namespace IceWS;
-vector<unsigned char>
-IceWS::calcSHA1(const vector<unsigned char>& data)
-{
-#ifndef ICE_OS_WINRT
- vector<unsigned char> hash(SHA_DIGEST_LENGTH);
- ::SHA1(&data[0], static_cast<unsigned long>(data.size()), &hash[0]);
- return hash;
-#else
- auto dataA = ref new Platform::Array<unsigned char>(const_cast<unsigned char*>(&data[0]),
- static_cast<unsigned int>(data.size()));
- auto hasher = Windows::Security::Cryptography::Core::HashAlgorithmProvider::OpenAlgorithm("SHA1");
- auto hashed = hasher->HashData(Windows::Security::Cryptography::CryptographicBuffer::CreateFromByteArray(dataA));
- auto reader = ::Windows::Storage::Streams::DataReader::FromBuffer(hashed);
- std::vector<unsigned char> result(reader->UnconsumedBufferLength);
- if(!result.empty())
- {
- reader->ReadBytes(::Platform::ArrayReference<unsigned char>(&result[0],
- static_cast<unsigned int>(result.size())));
- }
- return result;
-#endif
-}
-
WebSocketException::WebSocketException(const string& r) :
reason(r)
{