Loading extra/yassl/examples/echoserver/echoserver.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,8 @@ THREAD_RETURN YASSL_API echoserver_test(void* args) while (!shutdown) { sockaddr_in client; socklen_t client_len = sizeof(client); int clientfd = accept(sockfd, (sockaddr*)&client, &client_len); int clientfd = accept(sockfd, (sockaddr*)&client, (ACCEPT_THIRD_T)&client_len); if (clientfd == -1) err_sys("tcp accept failed"); SSL* ssl = SSL_new(ctx); Loading extra/yassl/include/openssl/ssl.h +2 −1 Original line number Diff line number Diff line Loading @@ -273,6 +273,7 @@ int SSL_pending(SSL*); enum { /* ssl Constants */ SSL_WOULD_BLOCK = -8, SSL_BAD_STAT = -7, SSL_BAD_PATH = -6, SSL_BAD_FILETYPE = -5, Loading Loading @@ -494,7 +495,7 @@ ASN1_TIME* X509_get_notAfter(X509* x); typedef struct MD4_CTX { void* ptr; int buffer[32]; /* big enough to hold, check size in Init */ } MD4_CTX; void MD4_Init(MD4_CTX*); Loading extra/yassl/include/socket_wrapper.hpp +4 −2 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ typedef unsigned char byte; // Wraps Windows Sockets and BSD Sockets class Socket { socket_t socket_; // underlying socket descriptor bool wouldBlock_; // for non-blocking data public: explicit Socket(socket_t s = INVALID_SOCKET); ~Socket(); Loading @@ -75,9 +76,10 @@ public: socket_t get_fd() const; uint send(const byte* buf, unsigned int len, int flags = 0) const; uint receive(byte* buf, unsigned int len, int flags = 0) const; uint receive(byte* buf, unsigned int len, int flags = 0); bool wait() const; bool wait(); bool WouldBlock() const; void closeSocket(); void shutDown(int how = SD_SEND); Loading extra/yassl/mySTL/stdexcept.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -46,8 +46,10 @@ public: // for compiler generated call, never used static void operator delete(void*) { assert(0); } private: #if defined(__hpux) // don't allow dynamic creation of exceptions static void* operator new(size_t); #endif }; Loading extra/yassl/src/handshake.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -656,7 +656,7 @@ mySTL::auto_ptr<input_buffer> DoProcessReply(SSL& ssl, mySTL::auto_ptr<input_buffer> buffered) { // wait for input if blocking if (!ssl.getSocket().wait()) { if (!ssl.useSocket().wait()) { ssl.SetError(receive_error); buffered.reset(0); return buffered; Loading @@ -673,7 +673,7 @@ DoProcessReply(SSL& ssl, mySTL::auto_ptr<input_buffer> buffered) } // add new data uint read = ssl.getSocket().receive(buffer.get_buffer() + buffSz, ready); uint read = ssl.useSocket().receive(buffer.get_buffer() + buffSz, ready); buffer.add_size(read); uint offset = 0; const MessageFactory& mf = ssl.getFactory().getMessage(); Loading Loading @@ -858,6 +858,9 @@ void sendFinished(SSL& ssl, ConnectionEnd side, BufferOutput buffer) // send data int sendData(SSL& ssl, const void* buffer, int sz) { if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) ssl.SetError(no_error); ssl.verfiyHandShakeComplete(); if (ssl.GetError()) return 0; int sent = 0; Loading Loading @@ -893,6 +896,9 @@ int sendAlert(SSL& ssl, const Alert& alert) // process input data int receiveData(SSL& ssl, Data& data) { if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) ssl.SetError(no_error); ssl.verfiyHandShakeComplete(); if (ssl.GetError()) return 0; Loading @@ -902,6 +908,11 @@ int receiveData(SSL& ssl, Data& data) ssl.useLog().ShowData(data.get_length()); if (ssl.GetError()) return 0; if (data.get_length() == 0 && ssl.getSocket().WouldBlock()) { ssl.SetError(YasslError(SSL_ERROR_WANT_READ)); return SSL_WOULD_BLOCK; } return data.get_length(); } Loading Loading
extra/yassl/examples/echoserver/echoserver.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,8 @@ THREAD_RETURN YASSL_API echoserver_test(void* args) while (!shutdown) { sockaddr_in client; socklen_t client_len = sizeof(client); int clientfd = accept(sockfd, (sockaddr*)&client, &client_len); int clientfd = accept(sockfd, (sockaddr*)&client, (ACCEPT_THIRD_T)&client_len); if (clientfd == -1) err_sys("tcp accept failed"); SSL* ssl = SSL_new(ctx); Loading
extra/yassl/include/openssl/ssl.h +2 −1 Original line number Diff line number Diff line Loading @@ -273,6 +273,7 @@ int SSL_pending(SSL*); enum { /* ssl Constants */ SSL_WOULD_BLOCK = -8, SSL_BAD_STAT = -7, SSL_BAD_PATH = -6, SSL_BAD_FILETYPE = -5, Loading Loading @@ -494,7 +495,7 @@ ASN1_TIME* X509_get_notAfter(X509* x); typedef struct MD4_CTX { void* ptr; int buffer[32]; /* big enough to hold, check size in Init */ } MD4_CTX; void MD4_Init(MD4_CTX*); Loading
extra/yassl/include/socket_wrapper.hpp +4 −2 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ typedef unsigned char byte; // Wraps Windows Sockets and BSD Sockets class Socket { socket_t socket_; // underlying socket descriptor bool wouldBlock_; // for non-blocking data public: explicit Socket(socket_t s = INVALID_SOCKET); ~Socket(); Loading @@ -75,9 +76,10 @@ public: socket_t get_fd() const; uint send(const byte* buf, unsigned int len, int flags = 0) const; uint receive(byte* buf, unsigned int len, int flags = 0) const; uint receive(byte* buf, unsigned int len, int flags = 0); bool wait() const; bool wait(); bool WouldBlock() const; void closeSocket(); void shutDown(int how = SD_SEND); Loading
extra/yassl/mySTL/stdexcept.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -46,8 +46,10 @@ public: // for compiler generated call, never used static void operator delete(void*) { assert(0); } private: #if defined(__hpux) // don't allow dynamic creation of exceptions static void* operator new(size_t); #endif }; Loading
extra/yassl/src/handshake.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -656,7 +656,7 @@ mySTL::auto_ptr<input_buffer> DoProcessReply(SSL& ssl, mySTL::auto_ptr<input_buffer> buffered) { // wait for input if blocking if (!ssl.getSocket().wait()) { if (!ssl.useSocket().wait()) { ssl.SetError(receive_error); buffered.reset(0); return buffered; Loading @@ -673,7 +673,7 @@ DoProcessReply(SSL& ssl, mySTL::auto_ptr<input_buffer> buffered) } // add new data uint read = ssl.getSocket().receive(buffer.get_buffer() + buffSz, ready); uint read = ssl.useSocket().receive(buffer.get_buffer() + buffSz, ready); buffer.add_size(read); uint offset = 0; const MessageFactory& mf = ssl.getFactory().getMessage(); Loading Loading @@ -858,6 +858,9 @@ void sendFinished(SSL& ssl, ConnectionEnd side, BufferOutput buffer) // send data int sendData(SSL& ssl, const void* buffer, int sz) { if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) ssl.SetError(no_error); ssl.verfiyHandShakeComplete(); if (ssl.GetError()) return 0; int sent = 0; Loading Loading @@ -893,6 +896,9 @@ int sendAlert(SSL& ssl, const Alert& alert) // process input data int receiveData(SSL& ssl, Data& data) { if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) ssl.SetError(no_error); ssl.verfiyHandShakeComplete(); if (ssl.GetError()) return 0; Loading @@ -902,6 +908,11 @@ int receiveData(SSL& ssl, Data& data) ssl.useLog().ShowData(data.get_length()); if (ssl.GetError()) return 0; if (data.get_length() == 0 && ssl.getSocket().WouldBlock()) { ssl.SetError(YasslError(SSL_ERROR_WANT_READ)); return SSL_WOULD_BLOCK; } return data.get_length(); } Loading