summaryrefslogtreecommitdiffstats
path: root/libvncserver
diff options
context:
space:
mode:
authorJocelyn Le Sage <jocelyn@le-sage.com>2017-02-21 06:36:15 -0500
committerJocelyn Le Sage <jocelyn.lesage@hpe.com>2017-06-13 06:24:10 -0400
commite8a1ca20352f14bf3b527bb1f148610fc1fb5247 (patch)
tree40a87d260b041f2d8f7ed12e5b1bf2f4b9ecc62e /libvncserver
parentada4b4fc5a27eb733c1eaad9d5bce42930e0f4ed (diff)
downloadlibtdevnc-e8a1ca20352f14bf3b527bb1f148610fc1fb5247.tar.gz
libtdevnc-e8a1ca20352f14bf3b527bb1f148610fc1fb5247.zip
Fixed compilation of websockets on system where there is no implementation of base64 functions.
Diffstat (limited to 'libvncserver')
-rw-r--r--libvncserver/websockets.c8
-rw-r--r--libvncserver/ws_decode.c3
-rw-r--r--libvncserver/ws_decode.h3
3 files changed, 6 insertions, 8 deletions
diff --git a/libvncserver/websockets.c b/libvncserver/websockets.c
index b9947c4..4ebff72 100644
--- a/libvncserver/websockets.c
+++ b/libvncserver/websockets.c
@@ -52,7 +52,7 @@
#include "rfbssl.h"
#include "rfbcrypto.h"
#include "ws_decode.h"
-
+#include "base64.h"
#if 0
#include <sys/syscall.h>
@@ -117,8 +117,8 @@ static void webSocketsGenSha1Key(char *target, int size, char *key)
iov[1].iov_base = GUID;
iov[1].iov_len = sizeof(GUID) - 1;
digestsha1(iov, 2, hash);
- if (-1 == b64_ntop(hash, sizeof(hash), target, size))
- rfbErr("b64_ntop failed\n");
+ if (-1 == rfbBase64NtoP(hash, sizeof(hash), target, size))
+ rfbErr("rfbBase64NtoP failed\n");
}
/*
@@ -412,7 +412,7 @@ webSocketsEncodeHybi(rfbClientPtr cl, const char *src, int len, char **dst)
}
if (wsctx->base64) {
- if (-1 == (ret = b64_ntop((unsigned char *)src, len, wsctx->codeBufEncode + sz, sizeof(wsctx->codeBufEncode) - sz))) {
+ if (-1 == (ret = rfbBase64NtoP((unsigned char *)src, len, wsctx->codeBufEncode + sz, sizeof(wsctx->codeBufEncode) - sz))) {
rfbErr("%s: Base 64 encode failed\n", __func__);
} else {
if (ret != blen)
diff --git a/libvncserver/ws_decode.c b/libvncserver/ws_decode.c
index 513fd4b..441ebc7 100644
--- a/libvncserver/ws_decode.c
+++ b/libvncserver/ws_decode.c
@@ -1,4 +1,5 @@
#include "ws_decode.h"
+#include "base64.h"
#include <string.h>
#include <errno.h>
@@ -432,7 +433,7 @@ hybiReadAndDecode(ws_ctx_t *wsctx, char *dst, int len, int *sockRet, int nInBuf)
case WS_OPCODE_TEXT_FRAME:
data[toReturn] = '\0';
ws_dbg("Initiate Base64 decoding in %p with max size %d and '\\0' at %p\n", data, bufsize, data + toReturn);
- if (-1 == (wsctx->readlen = b64_pton((char *)data, data, bufsize))) {
+ if (-1 == (wsctx->readlen = rfbBase64PtoN((char *)data, data, bufsize))) {
rfbErr("%s: Base64 decode error; %s\n", __func__, strerror(errno));
}
wsctx->writePos = hybiPayloadStart(wsctx);
diff --git a/libvncserver/ws_decode.h b/libvncserver/ws_decode.h
index 2923e3d..709477a 100644
--- a/libvncserver/ws_decode.h
+++ b/libvncserver/ws_decode.h
@@ -3,9 +3,6 @@
#include <stdint.h>
#include <rfb/rfb.h>
-#ifndef _MSC_VER
-#include <resolv.h> /* __b64_ntop */
-#endif
#if defined(__APPLE__)