Commit Graph

322 Commits (cedae6e6f97b14f5df3ea7c5f7efd59f2bc9ad82)

Author SHA1 Message Date
Quentin BUATHIER cedae6e6f9 Fix the concurrent issue hapenning between the freeing of the client and the clientOutput thread 7 years ago
Quentin BUATHIER 96e163bdae Fix use-after-free 7 years ago
Christian Beier 85fb69515c
crypto: move to common
As of now, only LibVNCServer makes uses of these digest functions _and_
they depend on sys/uio.h, but in the future LibVNCClient will need those
as well.
7 years ago
Eddie James dd873fce45 Tight: export SendCompressedData and SendTightHeader functions
These functions can be used to send already compressed jpegs to a
client, circumventing the usual rect/region update methods which
operate on a raw rgb framebuffer. Rename the functions with the usual
rfb prefix and add the prototypes in rfb.h.

Signed-off-by: Eddie James <eajames@us.ibm.com>
7 years ago
Christian Beier f23248a415
rfbserver: fix a typo 7 years ago
Christian Beier 449cbe9028
rfbserver: get rid of inttypes.h again 7 years ago
Petr Písař 28afb6c537 Limit client cut text length to 1 MB
This patch constrains a client cut text length to 1 MB. Otherwise
a client could make server allocate 2 GB of memory and that seems to
be to much to classify it as a denial of service.

The limit also prevents from an integer overflow followed by copying
an uninitilized memory when processing msg.cct.length value larger
than SIZE_MAX or INT_MAX - sz_rfbClientCutTextMsg.

This patch also corrects accepting length value of zero (malloc(0) is
interpreted on differnet systems differently).

CVE-2018-7225
<https://github.com/LibVNC/libvncserver/issues/218>
7 years ago
Wu Zongyong 2c2f103304 fix: the function should not return a value 8 years ago
Jocelyn Le Sage e8a1ca2035 Fixed compilation of websockets on system where there is no implementation of base64 functions. 8 years ago
Christian Beier ada4b4fc5a Merge pull request #158 from kempniu/gtk-vnc-0.7.0-compat
websockets: Ensure compatibility with gtk-vnc 0.7.0+
8 years ago
Christian Beier 051fe2a009
websockets: hide decode debug output per default 8 years ago
Christian Beier f48921becf
websockets: restore webSocketCheckDisconnect() to keep API compatibility 8 years ago
Andreas Weigel ef8d2852f5
remove potential 64 bit len overflow calculation 8 years ago
Andreas Weigel 5d9d6a8712
add decode support for continuation frames
use FIN bit and implement opcode 0x00

make consistent use of uint64_t for big frame sizes
8 years ago
Andreas Weigel a90a43cda5
remove Hixie-specific MD5 and check functions 8 years ago
Andreas Weigel 826e0f9e39
add generation wstest to cmake
add wstestdata.c, because the python data generation script has too many
dependencies

remove some redundance from jpeg test creation

add support for decoding close messages
8 years ago
Andreas Weigel f19d6ee225
add ws_decode tests
modify automake to include ws_decode test

add python frame generator for decode tests

modify configure to only include ws_decode test if preconditions are
fulfilled
8 years ago
Andreas Weigel a2322e7006
remove obsolete hixie protocol support 8 years ago
Andreas Weigel bcefa591cd
factor out hybi decode part to make it testable
remove direct dependency on rfbClientPtr structure in hybi decode
function(s)
8 years ago
Andreas Weigel aac95a9dcf
fix overflow and refactor websockets decode (Hybi)
fix critical heap-based buffer overflow which allowed easy modification
of a return address via an overwritten function pointer

fix bug causing connections to fail due a "one websocket frame = one
ws_read" assumption, which failed with LibVNCServer-0.9.11

refactor websocket Hybi decode to use a simple state machine for
decoding of websocket frames
8 years ago
Lioncash c550e1ac69 font: Fix a small resource leak in a failure case in rfbLoadConsoleFont()
The file handle wouldn't be closed in this instance.
8 years ago
Christian Beier 6cb0522ecb rfbInitServer: only init Winsock once 8 years ago
Christian Beier 5935c1be4f Add an rfbLogPError that shows something on WIN32 8 years ago
Christian Beier 9ac695a4b9 Merge pull request #156 from The-42/drop-autotools
drop autotools
8 years ago
Christian Beier 425e24196b
Fix building in C89 mode
FIXME: this should probably be refactored into a common header.
8 years ago
Michał Kępień 75f04c14e4 Ensure compatibility with gtk-vnc 0.7.0+ 8 years ago
Bert van Hall fe94339587 drop autotools
Since autotools officially is no longer supported (see various github
issues), drop the related infrastructure to stop tempting people to use
it for building.

Signed-off-by: Bert van Hall <bert.vanhall@gmx.de>
8 years ago
Christian Beier c5297bd47d
Fix building websockets with GnuTLS. 8 years ago
Christian Beier 2300efd396 Fix typo 8 years ago
Christian Beier c36147390e Fix websockets building 8 years ago
Christian Beier 7368417239 Various #ifdef fixes to allow building with MSVC2014 8 years ago
Christian Beier 1d1d2090b7 Make websockets code build on OSX without SSL. 8 years ago
Christian Beier 16cf35b2bf
Use unprefixed b64_* functions in websockets code. 8 years ago
Christian Beier 78b101f09d
LibVNCServer: fix starting of an onHold-client in threaded mode.
Discovered by madscientist159 on 11 Jan 2015:

"noted in testing with the threaded server build, whereby
if newClientHook() returned RFB_CLIENT_ON_HOLD there was no
way to release the hold when the server became ready"
8 years ago
Kyle Russell aed23ae5c3 websockets: Don't supply Sec-WebSocket-Protocol if not in request 8 years ago
Samuel Mannehed 21f8a8d33d Write the correct length for end of header
Fix for commit 65106d3962
8 years ago
Christian Beier 65106d3962
httpd: rework mime type handling to recognise more types 8 years ago
Christian Beier 01698f5c5b Merge pull request #128 from zmedico/autoprobe-selective
Support autoPort with ipv4 or ipv6 disabled
8 years ago
Stefan Weil 63bc75f24b Fix some typos (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
8 years ago
Kyle Russell 21fd4d27bb Support systemd socket activation 9 years ago
Zac Medico cdd81bd479 Support autoPort with ipv4 or ipv6 disabled
Make it possible to get autoPort behavior with either ipv4 or ipv6
disabled, by setting rfbScreen->ipv6port or rfbScreen->port to a
negative number. This will make it possible for x11vnc to enforce
its -noipv6 option, as discussed in the following bug report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672449
9 years ago
Christian Beier 6f4f31fe93 Merge pull request #84 from plettix/master
fix for issue 81
9 years ago
George Fleury 1417cb1c3f Avoid calling SSL_pending when connection is already closed
Avoid calling SSL_pending when connection is already closed, calling SSL_pending with connection already closed is crashing. 
To reproduce, open a secure websocket binay protocol connection with libvncserver compiled with OpenSSL, and when libvncserver is waiting for rfbProcessClientProtocolVersion send any invalid char, it will fail and call rfbCloseClient whith destroy all SSL context, calling SSL_pending after that will generate a invalid access.
9 years ago
Christian Beier 785f0fa2d1 Merge pull request #103 from rdieter/master
use namespaced vnc_max macro (issue #102)
9 years ago
Rex Dieter 53cc1fa18a use namespaced rfbMax macro (issue #102)
Not using generic 'max', avoids conflicts with stl_algobase.h
9 years ago
Wen Shuguang dfa5e27579 Enable AF_UNIX socket: ignore setsockopt TCP_NODELAY failure. 9 years ago
Stefan Weil 9c7efb7633 Fix some typos (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
9 years ago
plettix 455ba61e4f fix for issue 81
use different buffers for decode and encode
10 years ago
Christian Beier 92f558482d Do away with rfbint.h generation and use stdint.h directly instead. 10 years ago
Christian Beier 107109492e Merge pull request #70 from maxnet/master
httpd: disallow directory traversal
10 years ago