aboutsummaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Log decoding stats on disconnectPierre Ossman2021-11-042-0/+66
| | | | | Can be helpful to see what encodings were actually used during a connection, and how they performed.
* Increase maximum input bufferPierre Ossman2021-11-041-1/+1
| | | | | | macOS' built in VNC server unfortunately sends the entire monitor in a single rect, so we need to be prepared to buffer a lot of data in case the monitor has a large resolution.
* Throw more descriptive error on rect read errorPierre Ossman2021-11-041-2/+6
| | | | Gives a bit more context where this error happened.
* Remove single cpu decoder shortcutPierre Ossman2021-11-041-27/+1
| | | | | Single CPU machines are extremely rare now, so let's avoid the hassle of multiple code paths.
* Merge branch 'master' of https://github.com/twhitehead/tigervncPierre Ossman2021-10-141-1/+1
|\
| * System certificate load returns number loaded not GNUTLS_E_SUCCESSTyson Whitehead2021-10-071-1/+1
| |
* | Don't fail on user CA/CRL problemsPierre Ossman2021-10-141-2/+2
| | | | | | | | | | | | | | | | The certificates might still be fine using the system trust store, or the user can make an exception. So let's just log and continue on. This got very common after 960c7d2 where we now always have a default value for these settings.
* | Adjust default directory for configuration file save and loadJohannes2021-09-212-4/+39
|/
* 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-138-62/+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.
* | Propagate exceptions from GnuTLS push/pull functionsPierre Ossman2021-06-114-3/+28
| | | | | | | | | | Gives us a more meaningful error rather than just "Error in push/pull function".
* | Remove early data check for TLSInStreamPierre Ossman2021-06-111-5/+3
| | | | | | | | | | | | | | Having this early check means that we somewhat randomly get different exception behaviours on errors in deeper layers as some exceptions are allowed to propagate unhindered and some are not (since they are thrown in the pull function).
* | Propagate errno to GnuTLSPierre Ossman2021-06-112-0/+10
| | | | | | | | | | Give GnuTLS the correct errno from deeper layers, in the cases where we know it. In most cases GnuTLS doesn't care, but just in case...
* | 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
* Revert "Support TCP_NOPUSH as alternative to TCP_CORK"Pierre Ossman2021-03-021-4/+0
| | | | | This reverts commit d6e39658ae105fca2cfe37ba736dbf0e8d8356af. Apparently this is broken on macOS so it's not something we can make use of.
* 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.
* Support TCP_NOPUSH as alternative to TCP_CORKPierre Ossman2021-03-021-0/+4
| | | | TCP_CORK is a Linux thing and BSD has TCP_NOPUSH instead.
* Add missing headers for TCP_CORKPierre Ossman2021-03-021-0/+2
| | | | | We didn't include the proper headers to get the correct define, so corking was never enabled.
* 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
| |
* | Fix overloaded function signaturePierre Ossman2021-01-262-2/+2
| |
* | Remove unused attributesPierre Ossman2021-01-261-3/+0
| |
* | Merge branch 'noblock' of https://github.com/CendioOssman/tigervncPierre Ossman2021-01-1981-1259/+1808
|\ \
| * | Change streams to be asynchronousPierre Ossman2020-05-2158-516/+1037
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-219-76/+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.
| * | Improved bandwidth monitoringPierre Ossman2020-05-212-60/+2
| | | | | | | | | | | | | | | | | | Now measures over an entire update, which should hopefully give us more stable values. They are still small values for fast networks though so increase precision in the values we keep.
| * | Make direct stream API a bit saferPierre Ossman2020-05-217-38/+42
| | | | | | | | | | | | | | | 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.