Commit Graph

193 Commits (d4cfc260fe7eb164f9e53dd4fb524b9fedd35c04)

Author SHA1 Message Date
Gernot Tenchio d4cfc260fe rfbcrypto_polarssl: it was way to late last night... 14 years ago
Gernot Tenchio bd9cae3d12 Add support for different crypto implementations 14 years ago
Christian Beier cb0340ccc5 Autotools: Fix OpenSSL and GnuTLS advertisement. 14 years ago
Christian Beier 2046cc9abd Fix libvncserver GnuTLS init.
gnutls_certificate_set_x509_trust_file() returns the number of processed
certs and _not_ GNUTLS_E_SUCCESS (0) on success!
14 years ago
Christian Beier 98a9d49c05 Update AUTHORS regarding the websocket guys. 14 years ago
Gernot Tenchio 2c45d08dd8 websocket: Use a single buffer for both, encoding and decoding 14 years ago
Gernot Tenchio 3eec976558 Merge branch 'kanaka/websockets' into websockets
Conflicts:
	libvncserver/websockets.c
14 years ago
Gernot Tenchio 7d1c1033c5 rfbssl_gnutls: Merge rfbssl_peek/rfbssl_read into one function 14 years ago
Gernot Tenchio b1671e6de9 websockets: fix webSocketCheckDisconnect()
Do not consume the peeked data if no close frame was detected.
14 years ago
Gernot Tenchio 0f2ac00f6e websockets: use 32bit Xor in webSocketsDecodeHybi() 14 years ago
Gernot Tenchio fd73186769 websockets: nothing to worry about 14 years ago
Gernot Tenchio 7b80ff5b3a websockets: added gcrypt based sha1 digest funtion 14 years ago
Joel Martin d8b7f7a7d6 Add sha1.*. Remove UTF-8 encode. Protocol handling.
Add common/sha1.h and common/sha1.c so that we have the SHA routines
even if openssl is not available. From the IETF SHA RFC example code.

Remove the UTF-8 encoding hack. This was really just an experiment.

If the protocol passed in the handshake has "binary" then don't base64
encode for the HyBi protocol. This will allow noVNC to request the
binary data be passed raw and not base64 encoded. Unfortunately, the
client doesn't speak first in VNC protocol (bad original design). If
it did then we could determine whether to base64 encode or not based
on the first HyBi frame from the client and whether the binary bit is
set or not. Oh well.

Misc Cleanup:

- Always free response and buf in handshake routine.

- Remove some unused variables.
14 years ago
Gernot Tenchio e22b7acbc8 websockets: remove warning on 64bit platforms 14 years ago
Gernot Tenchio 099e5c8251 websockets: Removed debugging left over 14 years ago
Gernot Tenchio 72b18fdfb7 websockets: Use callback functions for encode/decode 14 years ago
Gernot Tenchio 55234a37fd websockets: Move Hixie disconnect hack to websockets.c
Move the hixie disconnect hack to websockets.c. Removed
the remaining websockets vars from rfbClientPtr, so all
websockets stuff is hidden behind an opaque pointer.
14 years ago
Gernot Tenchio 1408866c86 websockets: Initial HyBi support 14 years ago
Gernot Tenchio 297072a691 websockets: Add wspath member to rfbClientRec
Added wspath member to rfbClientRec which holds the
path component of the initial websocket request.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Gernot Tenchio b543d48677 Move libvncserver/md5* to common
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Joel Martin 9afe4e1faa websockets: Add SSL cert command line options.
- Add --sslcertfile and --sslkeyfile. These should really be combined
  with the existing x11vnc command line options for SSL support.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Gernot Tenchio a2a6e25699 websockets: add GnuTLS and OpenSSL support
For now, only OpenSSL support is activated through configure, since GnuTLS
is only used in LibVNCClient.

[jes: separated this out from the commit adding encryption support, added
autoconf support.]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Gernot Tenchio 4aa3586367 websockets: Add encryption support
[jes: moved out GnuTLS and OpenSSL support, added a dummy support, to
separate changes better, and to keep things compiling]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Joel Martin 7a77cc32b2 websockets: Properly parse Hixie-76 handshake.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Joel Martin 430b8f2449 websockets: Add UTF-8 encoding support.
This is not completely standard UTF-8 encoding. Only code points 0-255
are encoded and never encoded to more than two octets. Since '\x00' is
a WebSockets framing character, it's easier for all parties to encode
zero as '\xc4\x80', i.e. 194+128, i.e. UTF-8 256.

This means that a random stream will be slightly more than 50% larger
using this encoding scheme. But it's easy CPU-wise for client and
server to decode/encode. This is especially important for clients
written in languages that have weak bitops, like Javascript (i.e. the
noVNC client).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Joel Martin 0860c4951f websockets: Better disconnect detection.
If the only thing we are waiting on is a WebSockets terminator, then
remove it from the stream early on in rfbProcessClientNormalMessage.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Joel Martin 6fac22a74b websockets: Initial WebSockets support.
Has a bug: WebSocket client disconnects are not detected.
rfbSendFramebufferUpdate is doing a MSG_PEEK recv to determine if
enough data is available which prevents a disconnect from being
detected.

Otherwise it's working pretty well.

[jes: moved added struct members to the end for binary compatibility with
previous LibVNCServer versions, removed an unused variable]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Joel Martin 353b35e86a tightPng: check even for SendGradientRect.
Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Joel Martin 896ca2036c tightPng: Add initial tightPng encoding support.
http://wiki.qemu.org/VNC_Tight_PNG

Signed-off-by: Joel Martin <github@martintribe.org>
Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Christian Beier 17ce0c5628 Remove some unused variables. 14 years ago
George Kiagiadakis ddd9b5ac7b Fix rfbProcessNewConnection to return some value instead of void.
BUG: 256891

Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
George Kiagiadakis 9f8d8d4ef3 Split two event-loop related functions out of the rfbProcessEvents() mechanism.
This is required to be able to do proper event loop integration with Qt.
Idea was taken from vino's libvncserver fork.

Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Cristian Rodríguez c8b8938106 Fix buffer overflow
Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Christian Beier 984706076c Revert "Fix memory corruption bug."
This reverts commit c1363fa958.

The proper fix was already in 804335f9d2.
14 years ago
George Kiagiadakis c1363fa958 Fix memory corruption bug.
This bug occured when a second telepathy tubes client was connected after
the first one had disconnected and the channel (thus, the screen too)
had been destroyed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
George Kiagiadakis 35246edddd Fix compilation in c89 mode.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Christian Beier 62b7acf480 Fix regression in Ultra encoding introduced by commit fe1ca16e9b.
My bad. There we see what the encodings test is good for ;-)
14 years ago
Christian Beier fe1ca16e9b Fix (most) MinGW32 compiler warnings. 14 years ago
Christian Beier 56234cd0b6 Fix remaining compiler warnings. 14 years ago
Christian Beier e832999a58 Set proper file permissions for source files. 14 years ago
Christian Beier cf72a0f7c3 Call WSAGetLastError() everywhere errno is read after a Winsock call.
Winsock does NOT update errno for us, we have fetch the last error
manually using WSAGetLastError().
14 years ago
Christian Beier f5b96e57bf Update minilzo library used for Ultra encoding to ver 2.04.
According to the minilzo README, this brings a significant
speedup on 64-bit architechtures.

Changes compared to old version 1.08 can be found here:
http://www.oberhumer.com/opensource/lzo/lzonews.php

Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Christian Beier 9f49600787 libvncserver: Make RRE, CoRRE and Ultra encodings thread-safe.
This adds generic before/after encoding buffers to the rfbClient
struct, so there is no need for thread local storage.

Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Christian Beier 558a58e039 Remove unneeded files concerning CVS.
We have a git repo nowadays and I guess we won't go back to CVS.

Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Christian Beier ffe30366d6 Put files used by both libs into a 'common' dir.
No functional changes. All files used by _both_ libvncserver and
libvncclient are put into a 'common' directory and references
from other files as well as Autotools and CMake build systems are
updated.

Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
ebola_rulez 5e1488beb3 Fix two errors found by cppcheck
Signed-off-by: Vic Lee <llyzs@163.com>
Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
runge 658bef5fde Remove never used protocol version name string. 14 years ago
Tobias Doerffel d4fabc217e libvncserver sockets: check cl->screen before accessing it
In commit 079394ca5b new code with
insufficient checks was introduced causing a segfault when doing a
HTTP server connection. Such connections have no screen set in the
client data structure.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
14 years ago
Christian Beier a5f8d3a310 libvncserver: fix endless loop when server closed client in threaded mode.
Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Christian Beier 079394ca5b libvncserver sockets: favor per-screen maxclientwait over global one when set.
Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago