Skip to content

Commit

Permalink
SHA1 -> ws_SHA1.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Chen committed May 30, 2013
1 parent f77b8b6 commit 167f0cf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context,
key_b64[39] = '\0'; /* enforce composed length below buf sizeof */
n = sprintf(buf, "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", key_b64);

SHA1((unsigned char *)buf, n, (unsigned char *)hash);
ws_SHA1((unsigned char *)buf, n, (unsigned char *)hash);

lws_b64_encode_string(hash, 20,
wsi->u.hdr.ah->initial_handshake_hash_base64,
Expand Down
4 changes: 2 additions & 2 deletions lib/private-libwebsockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
#include <cyassl/openssl/ssl.h>
#include <cyassl/error.h>
unsigned char *
SHA1(const unsigned char *d, size_t n, unsigned char *md);
ws_SHA1(const unsigned char *d, size_t n, unsigned char *md);
#else
#include <openssl/ssl.h>
#include <openssl/evp.h>
Expand Down Expand Up @@ -532,7 +532,7 @@ extern int interface_to_sa(const char *ifname,
#ifndef LWS_OPENSSL_SUPPORT

unsigned char *
SHA1(const unsigned char *d, size_t n, unsigned char *md);
ws_SHA1(const unsigned char *d, size_t n, unsigned char *md);

#else

Expand Down
2 changes: 1 addition & 1 deletion lib/server-handshake.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ handshake_0405(struct libwebsocket_context *context, struct libwebsocket *wsi)
"%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
lws_hdr_simple_ptr(wsi, WSI_TOKEN_KEY));

SHA1(context->service_buffer, n, hash);
ws_SHA1(context->service_buffer, n, hash);

accept_len = lws_b64_encode_string((char *)hash, 20,
(char *)context->service_buffer,
Expand Down
2 changes: 1 addition & 1 deletion lib/sha-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ sha1_result(struct sha1_ctxt *ctxt, void *digest0)
*/

unsigned char *
SHA1(const unsigned char *d, size_t n, unsigned char *md)
ws_SHA1(const unsigned char *d, size_t n, unsigned char *md)
{
struct sha1_ctxt ctx;

Expand Down
10 changes: 5 additions & 5 deletions test-server/test-ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ int main(int argc, char **argv)
char ip[30];
#ifndef WIN32
struct sigaction sa;
struct winsize w;
// struct winsize w;
#endif
struct timeval tv;
unsigned long oldus = 0;
Expand Down Expand Up @@ -420,10 +420,10 @@ int main(int argc, char **argv)
}

#ifndef WIN32
if (isatty(STDOUT_FILENO))
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1)
if (w.ws_col > 0)
screen_width = w.ws_col;
// if (isatty(STDOUT_FILENO))
// if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1)
// if (w.ws_col > 0)
// screen_width = w.ws_col;
#endif

info.port = CONTEXT_PORT_NO_LISTEN;
Expand Down

0 comments on commit 167f0cf

Please sign in to comment.