aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-03-30 14:05:41 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-03-30 14:05:41 +0200
commit3259015486ecc8e246b1b69b36235d24e9d9c2ea (patch)
tree73b5122caf18a9ee6b6c43115bf2040632eb8bee
parentca208671cc79bbc05c574df788035878e5d39382 (diff)
naming: globally unic identifier
Change-Id: I0da5ca620a08dd5a4508c59861e009e953b580d4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-websock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/afb-websock.c b/src/afb-websock.c
index b6056adc..1c087e25 100644
--- a/src/afb-websock.c
+++ b/src/afb-websock.c
@@ -39,7 +39,7 @@ static const char sec_websocket_key_s[] = "Sec-WebSocket-Key";
static const char sec_websocket_version_s[] = "Sec-WebSocket-Version";
static const char sec_websocket_accept_s[] = "Sec-WebSocket-Accept";
static const char sec_websocket_protocol_s[] = "Sec-WebSocket-Protocol";
-static const char websocket_uuid[] = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
+static const char websocket_guid[] = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
struct afb_websock
@@ -108,10 +108,10 @@ static void make_accept_value(const char *key, char result[29])
{
unsigned char md[SHA_DIGEST_LENGTH+1];
size_t len = strlen(key);
- char *buffer = alloca(len + sizeof websocket_uuid - 1);
+ char *buffer = alloca(len + sizeof websocket_guid - 1);
memcpy(buffer, key, len);
- memcpy(buffer + len, websocket_uuid, sizeof websocket_uuid - 1);
- SHA1((const unsigned char *)buffer, (unsigned long)(len + sizeof websocket_uuid - 1), md);
+ memcpy(buffer + len, websocket_guid, sizeof websocket_guid - 1);
+ SHA1((const unsigned char *)buffer, (unsigned long)(len + sizeof websocket_guid - 1), md);
assert(SHA_DIGEST_LENGTH == 20);
md[20] = 0;
enc64(&md[0], &result[0]);