Use unprefixed b64_* functions in websockets code.

pull/3/head
Christian Beier 7 years ago
parent b7a7c4d120
commit 16cf35b2bf
No known key found for this signature in database
GPG Key ID: 421BB3B45C6067F8

@ -194,7 +194,7 @@ static void webSocketsGenSha1Key(char *target, int size, char *key)
iov[1].iov_base = GUID; iov[1].iov_base = GUID;
iov[1].iov_len = sizeof(GUID) - 1; iov[1].iov_len = sizeof(GUID) - 1;
digestsha1(iov, 2, hash); digestsha1(iov, 2, hash);
if (-1 == __b64_ntop(hash, sizeof(hash), target, size)) if (-1 == b64_ntop(hash, sizeof(hash), target, size))
rfbErr("b64_ntop failed\n"); rfbErr("b64_ntop failed\n");
} }
@ -501,7 +501,7 @@ webSocketsEncodeHixie(rfbClientPtr cl, const char *src, int len, char **dst)
ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx; ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx;
wsctx->codeBufEncode[sz++] = '\x00'; wsctx->codeBufEncode[sz++] = '\x00';
len = __b64_ntop((unsigned char *)src, len, wsctx->codeBufEncode+sz, sizeof(wsctx->codeBufEncode) - (sz + 1)); len = b64_ntop((unsigned char *)src, len, wsctx->codeBufEncode+sz, sizeof(wsctx->codeBufEncode) - (sz + 1));
if (len < 0) { if (len < 0) {
return len; return len;
} }
@ -612,7 +612,7 @@ webSocketsDecodeHixie(rfbClientPtr cl, char *dst, int len)
/* Decode the rest of what we need */ /* Decode the rest of what we need */
buf[needlen] = '\x00'; /* Replace end marker with end of string */ buf[needlen] = '\x00'; /* Replace end marker with end of string */
/* rfbLog("buf: %s\n", buf); */ /* rfbLog("buf: %s\n", buf); */
n = __b64_pton(buf, (unsigned char *)dst+retlen, 2+len); n = b64_pton(buf, (unsigned char *)dst+retlen, 2+len);
if (n < len) { if (n < len) {
rfbErr("Base64 decode error\n"); rfbErr("Base64 decode error\n");
errno = EIO; errno = EIO;
@ -752,7 +752,7 @@ webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len)
errno = ECONNRESET; errno = ECONNRESET;
break; break;
case WS_OPCODE_TEXT_FRAME: case WS_OPCODE_TEXT_FRAME:
if (-1 == (flength = __b64_pton(payload, (unsigned char *)wsctx->codeBufDecode, sizeof(wsctx->codeBufDecode)))) { if (-1 == (flength = b64_pton(payload, (unsigned char *)wsctx->codeBufDecode, sizeof(wsctx->codeBufDecode)))) {
rfbErr("%s: Base64 decode error; %m\n", __func__); rfbErr("%s: Base64 decode error; %m\n", __func__);
break; break;
} }
@ -826,7 +826,7 @@ webSocketsEncodeHybi(rfbClientPtr cl, const char *src, int len, char **dst)
} }
if (wsctx->base64) { if (wsctx->base64) {
if (-1 == (ret = __b64_ntop((unsigned char *)src, len, wsctx->codeBufEncode + sz, sizeof(wsctx->codeBufEncode) - sz))) { if (-1 == (ret = b64_ntop((unsigned char *)src, len, wsctx->codeBufEncode + sz, sizeof(wsctx->codeBufEncode) - sz))) {
rfbErr("%s: Base 64 encode failed\n", __func__); rfbErr("%s: Base 64 encode failed\n", __func__);
} else { } else {
if (ret != blen) if (ret != blen)

Loading…
Cancel
Save