Skip to content

Commit

Permalink
fix #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kraynyukhov committed Aug 28, 2018
1 parent 0ca3064 commit 4a63f48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 6 additions & 3 deletions include/ClientWebSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@
namespace LAppS
{

static thread_local CryptoPP::AutoSeededRandomPool RNG;
static thread_local CryptoPP::AutoSeededRandomPool RNG(true);
static thread_local CryptoPP::Base64Encoder BASE64;
static thread_local CryptoPP::SHA1 SHA1;
static thread_local itc::sys::Nap NAP;

static thread_local std::vector<uint8_t> recvBuffer(8192,0);

Expand Down Expand Up @@ -103,7 +104,7 @@ namespace LAppS

tls_config_set_protocols(TLSConfig,TLS_PROTOCOL_TLSv1_2);

tls_config_prefer_ciphers_client(TLSConfig);
tls_config_prefer_ciphers_server(TLSConfig);

if(noverifycert)
{
Expand Down Expand Up @@ -641,8 +642,10 @@ namespace LAppS
uint8_t byte_mask[8];
} double_mask;

uint32_t single_mask;
uint32_t single_mask=0;

RNG.GenerateBlock((byte*)(&single_mask),sizeof(single_mask));

double_mask.mask=(static_cast<uint64_t>(single_mask)<<32)|single_mask;

std::vector<uint8_t> out;
Expand Down
2 changes: 0 additions & 2 deletions include/modules/cws.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,7 @@ extern "C" {
lua_pushvalue(L,3);
lua_setfield(L,-2,std::to_string(*udptr).c_str());
lua_setmetatable(L, -2);

return 1;

}
catch(const std::exception& e)
{
Expand Down

0 comments on commit 4a63f48

Please # to comment.