summaryrefslogtreecommitdiffstats
path: root/common/rfb
Commit message (Collapse)AuthorAgeFilesLines
* Keep ownership of second selection when first is lostPierre Ossman2021-07-201-4/+3
| | | | | | | | | | | | | | This fixes regression introduced by the extended clipboard extension. Previously it was possible for the server to hold on to the CLIPBOARD selection even if another application took ownership of PRIMARY. This is important to handle the common use case of selecting something in order to paste over it. The new request based model doesn't readily support this as we assume the client has lost its data once we push the new PRIMARY selection to it. So to handle this we have the maintain a cache of the client's data, and make sure to fill that cache before we do anything that might cause the client to lose the data.
* Fix priority string when using newer GnuTLSJan Grulich2021-07-162-2/+6
| | | | | The call of gnutls_set_default_priority_append() expects a normal priority string, which means it must not start with ':'.
* Merge branch 'utilize-system-wide-crypto' of https://github.com/grulja/tigervncPierre Ossman2021-07-143-29/+105
|\
| * Utilize system-wide crypto policiesJan Grulich2021-07-143-29/+105
| |
* | Merge branch 'master' of https://github.com/jasonsikes/tigervncPierre Ossman2021-06-162-4/+41
|\ \
| * | Use RFC7919-2048 group in GnuTLS for FIPS compliance.JASON SIKES2021-06-122-4/+41
| | |
* | | Avoid some variable aliasingPierre Ossman2021-06-142-2/+2
| | |
* | | Remove unnecessary header includePierre Ossman2021-06-131-1/+0
| | |
* | | Clean up default value for X509 parametersPierre Ossman2021-06-136-42/+23
| | | | | | | | | | | | | | | Let's avoid making this too complex and force every user to know about magical functions.
* | | Keep own memory for duplicate config valuePierre Ossman2021-06-112-6/+11
| | | | | | | | | | | | | | | Allows the default value to be dynamically generated in a buffer that is reused.
* | | Remove unused LogParameter::setDefault()Pierre Ossman2021-06-112-14/+0
|/ /
* | Don't wait for TLS close responsePierre Ossman2021-06-112-2/+6
| | | | | | | | | | Our current architecture doesn't support waiting for a response here, so don't even try or we'll just get an error.
* | Handle GnuTLS shutdown on dead sessionPierre Ossman2021-06-113-11/+16
| | | | | | | | | | The session might have died, or failed to initialise properly, so be prepared for gnutls_bye() to be unable to do its job.
* | Properly clean up client VeNCrypt handlingPierre Ossman2021-06-111-0/+1
| | | | | | | | | | | | We would leak the security module below the top client VeNCrypt module, meaning that those modules would not get a chance to shut down gracefully.
* | Remove unneeded NULL checksPierre Ossman2021-06-114-15/+6
| | | | | | | | | | It's perfectly safe to delete NULL pointers, so simplify things by removing these checks.
* | CharArray: pre-fill empty array with zeroesJan Grulich2021-06-071-0/+1
|/ | | | | | | | CharArray should always be null-terminated. There is a potential scenario where this all might lead to crash. In Password we call memset(), passing length of the array we get with strlen(), but this won't return correct value when the array is not properly null-terminated.
*-. Merge branches 'vmware-cursor-position' and ↵Pierre Ossman2021-03-1114-9/+115
|\ \ | | | | | | | | | 'vmware-cursor-position-vncviewer' of https://github.com/lhchavez/tigervnc
| | * Support the VMware Cursor Position extension on vncviewerlhchavez2021-03-117-3/+30
| |/ |/| | | | | | | | | | | | | This change makes it possible for re-synchronizing the remote cursor on the vncviewer when in fullscreen mode. This is done by locally moving the cursor position to what the server thinks it should be. Now SDL games should work!
| * Add support for notifying clients about pointer movementslhchavez2021-03-0210-7/+104
|/ | | | | | | | | | | | | | | | | | | | | | | This change adds support for the VMware Mouse Position pseudo-encoding[1], which is used to notify VNC clients when X11 clients call `XWarpPointer()`[2]. This function is called by SDL (and other similar libraries) when they detect that the server does not support native relative motion, like some RFB clients. With this, RFB clients can choose to adjust the local cursor position under certain circumstances to match what the server has set. For instance, if pointer lock has been enabled on the client's machine and the cursor is not being drawn locally, the local position of the cursor is irrelevant, so the RFB client can use what the server sends as the canonical absolute position of the cursor. This ultimately enables the possibility of games (especially FPS games) to behave how users expect (if the clients implement the corresponding change). Part of: #619 1: https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#vmware-cursor-position-pseudo-encoding 2: https://tronche.com/gui/x/xlib/input/XWarpPointer.html 3: https://hg.libsdl.org/SDL/file/28e3b60e2131/src/events/SDL_mouse.c#l804
* Fix some incorrect data waitsPierre Ossman2021-03-022-17/+17
| | | | | | | | Some of these were incorrectly calculated so the server or client would wait too long before proceeding with decoding. Change all of these to be a more explicit calculation to avoid such issues in the future.
* Merge branch 'autoclip' of https://github.com/CendioOssman/tigervncPierre Ossman2021-02-0311-26/+202
|\
| * Update desktop if clipboard client goes awayPierre Ossman2021-01-051-1/+1
| | | | | | | | | | So the current clipboard state is properly reflected in the desktop session.
| * Add debug logging for ignored clipboard eventsPierre Ossman2021-01-053-7/+21
| |
| * Fix clipboard state tracking in serverPierre Ossman2021-01-051-2/+7
| | | | | | | | This was out of sync with the client handling for no good reason.
| * Handle clipboard peek with missing dataPierre Ossman2021-01-052-6/+2
| | | | | | | | | | The peer expects a response, so we should also be able to respond that there is no clipboard data currently available.
| * Handle unsolicited clipboard transfersPierre Ossman2021-01-048-10/+86
| | | | | | | | | | | | The extended clipboard protocol has the ability for the peer to request things to be sent automatically, without a request message. Make sure we honor such settings.
| * Log client/server clipboard capabilitiesPierre Ossman2021-01-042-0/+85
| |
* | Merge branch 'noblock' of https://github.com/CendioOssman/tigervncPierre Ossman2021-01-1945-425/+1021
|\ \
| * | Change streams to be asynchronousPierre Ossman2020-05-2137-318/+844
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Major restructuring of how streams work. Neither input nor output streams are now blocking. This avoids stalling the rest of the client or server when a peer is slow or unresponsive. Note that this puts an extra burden on users of streams to make sure they are allowed to do their work once the underlying transports are ready (e.g. monitoring fds).
| * | Remove readString()/writeString()Pierre Ossman2020-05-215-19/+37
| | | | | | | | | | | | | | | These are not universal in the protocol so having functions for them only obfuscates things.
| * | Don't read invalid TLS auth reasonPierre Ossman2020-05-211-9/+2
| | | | | | | | | | | | | | | The specification only states a single result byte and not any reason after a TLS authentication failure.
| * | Make direct stream API a bit saferPierre Ossman2020-05-211-7/+7
| | | | | | | | | | | | | | | Provide some safety checks when directly accessing the underlying pointer of streams.
| * | Make sure TLS is allowed to terminate gracefullyPierre Ossman2020-05-215-17/+39
| | | | | | | | | | | | | | | | | | Some systems (like TLS) need to send some final data before closing a connection. Make sure this is properly handled by cleaning up the security object before closing the underlying network socket.
| * | Separate query and authentication handlingPierre Ossman2020-05-211-6/+6
| | | | | | | | | | | | Otherwise we might send duplicate result codes and other weird things.
| * | Check buffer usage with a simply booleanPierre Ossman2020-05-211-4/+4
| | | | | | | | | | | | | | | External callers don't need to know the exact details, only if there is data that needs to be flushed or not.
| * | Generalise corking to all output streamsPierre Ossman2020-05-212-6/+8
| | | | | | | | | | | | | | | The principle can be used in a more general fashion than just TCP streams.
| * | Remove unused bufSize argument from streamsPierre Ossman2020-05-211-1/+1
| | |
| * | Remove special functions from JPEG compressorPierre Ossman2020-05-212-7/+1
| | | | | | | | | | | | We can do what we want with the standard methods.
| * | Simplify stream availability handlingPierre Ossman2020-05-212-3/+3
| | | | | | | | | | | | | | | Just have a simply number of bytes argument to avoid a lot of complexity.
| * | Add stream avail() methodsPierre Ossman2020-05-211-2/+2
| | | | | | | | | | | | | | | Makes it more readable to write code that needs to know how much data/space is available in a stream.
| * | Remove OutStream::skip()Pierre Ossman2020-05-211-1/+1
| | | | | | | | | | | | | | | It might leak data depending on what's in the buffer. Use pad() instead where blank space is needed.
| * | Throw more descriptive error on decode errorPierre Ossman2020-05-211-2/+7
| | | | | | | | | | | | We need to be able to tell this exception came from a decoder.
| * | Flush data on closePierre Ossman2020-05-211-0/+11
| | | | | | | | | | | | | | | There might be some final handshake data that is still stuck in the buffers, so make a best effort attempt at getting it to the client.
| * | Fix connection close logPierre Ossman2020-05-192-2/+4
| | | | | | | | | | | | | | | The socket is closed at this point so we have to rely on a cached value for the logging.
| * | Move auth failure delay to SConnectionPierre Ossman2020-05-194-46/+54
| | | | | | | | | | | | | | | It's a generic feature that is better handled as part of SConnection's state machine.
| * | Support calling methods from timersPierre Ossman2020-05-191-0/+15
| | | | | | | | | | | | | | | | | | We can't safely use the normal timers in base classes as we cannot guarantee that subclasses will call the base class' handleTimeout() properly if the subclass overrides it.
* | | Fix handling of bad update requestsPierre Ossman2021-01-141-1/+1
| |/ |/| | | | | | | | | We computed a safe area if a client gave us a bogus one, but we didn't actually use it. Fix this properly and make sure we don't pass on bad coordinates further.
* | Correctly clear out output UTF-16 bufferPierre Ossman2020-10-051-1/+1
| | | | | | | | | | Each character is more than one byte, so adjust the clearing of the buffer to reflect that.
* | Correctly handle invalid UTF-16 code pointsPierre Ossman2020-10-051-1/+1
| | | | | | | | | | Some code points are reserved for the UTF-16 coding itself and must not appear as input data to the algorithm.
* | Fix conversion of latin-1 to UTF-8Pierre Ossman2020-10-051-2/+2
| | | | | | | | Signed bug prevented anything not ASCII from being coded correctly.