aboutsummaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Gracefully shut down connectionsPierre Ossman12 days1-1/+1
| | | | | Allow everything to flush properly so that both ends see a clean close, rather than a reset connection. Avoids misleading error messages.
* Only configure valid hostnames for SNIPierre Ossman12 days1-4/+20
| | | | | The specification states that servers should reject invalid names (e.g. IP addresses), so try to make sure we only set something valid.
* Send TLS alerts to peer on errorsPierre Ossman12 days2-18/+75
| | | | Better inform the peer why we are terminating the connection.
* Show TLS alerts in log and to userPierre Ossman12 days3-10/+42
| | | | | | If the peer decides to terminte the connection, then the reason will be sent as an alert rather than seen through the normal error code. Make sure we show this so it's easier to determine what went wrong.
* Propagate exceptions during TLS handshakePierre Ossman12 days1-0/+3
| | | | Just like we do for regular TLS communication.
* Let TLSSocket handle TLS handshakePierre Ossman12 days4-20/+27
| | | | More avoiding duplication and increasing encapsulation.
* Let TLSSocket handle TLS terminationPierre Ossman12 days4-42/+28
| | | | Let's avoid duplication and also raise the encapsulation a bit.
* Avoid static methods for TLSSocketPierre Ossman12 days2-27/+23
| | | | We can use lambdas as glue and let them be normal methods instead.
* Merge TLS I/O in common classPierre Ossman12 days11-223/+316
| | | | | | Input and output do not happen independently in TLS streams, so we need to have a coordinating central object for all I/O. E.g. a TLS read can result in a low level write.
* Always include InStream::checkedBytesPierre Ossman12 days1-7/+1
| | | | | The ABI for the class needs to be stable across modules, so we cannot have conditional class members like this.
* core::Configuration: add a size() methodCarlos Santos2025-06-081-0/+2
| | | | | | | So it's not necessary to iterate over the internal list to obtain the number of parameters. Signed-off-by: Carlos Santos <casantos@redhat.com>
* Fix crash on x0vncserver startupCarlos Santos2025-06-011-1/+1
| | | | | | | | Test if the "parts" vector is not empty in TcpFilter::parsePattern() before attempting to access its first element. Fixes: https://github.com/TigerVNC/tigervnc/issues/1958 Signed-off-by: Carlos Santos <casantos@redhat.com>
* Treat whitespace list parameter as emptyPierre Ossman2025-05-281-0/+4
| | | | | Not as a single empty entry, which most parameters will not accept. The whitespace is likely not intententional by the user.
* Handle splitting empty stringPierre Ossman2025-05-281-0/+3
| | | | | This should result in an empty list, not a list with a single empty entry in it.
* Move colour map check to CConnectionPierre Ossman2025-03-302-0/+10
| | | | | This is a generic thing, not specific to the FLTK viewer. It belongs in the core code.
* Don't force everyone to implement setCursorPos()Pierre Ossman2025-03-302-0/+5
| | | | | You need to activate the feature by setting supportsCursorPosition, so there is no point in forcing everyone to implement the handler.
* Properly store cursor in ServerParams objectPierre Ossman2025-03-302-0/+12
| | | | | | We already had a field in the ServerParams structure, but we never actually stored anything in it. Let's fix that so the cursor behaves like other state we get from the server.
* Remove unused CConnection/SConnection callbacksPierre Ossman2025-03-294-19/+0
| | | | These have never been used for anything and just clutter up the API.
* Move global server checks to VNCServerSTPierre Ossman2025-03-292-10/+30
| | | | | These are not per-client settings, so let's move the enforcement to the common server object as much as possible.
* Move access checks to SConnectionPierre Ossman2025-03-292-6/+22
| | | | | | Access bits are part of SConnection, so let it handle all the basic checks as well. This allows us to reduce the complexity of VNCSConnectionST a bit.
* Make CMsgHandler/SMsgHandler pure interfacesPierre Ossman2025-03-299-465/+227
| | | | | | It's a bit confusing that some handling is done in CMsgHandler/SMsgHandler, and some handling is done in CConnection/SConnection.
* Mark internal connection callbacks as protectedPierre Ossman2025-03-292-139/+138
| | | | | | These are just for interactions internally within the connection objects and their sub classes. Mark them as protected to make the API more clear, and to avoid accidental use.
* Don't modify user settings in auto modePierre Ossman2025-03-292-0/+12
| | | | | Only override the actively used values, not the user values that are stored and displayed in the options dialog.
* Log invalid screen layoutPierre Ossman2025-03-282-3/+21
| | | | | | | To be able to debug exactly what is wrong with the layout. Unfortunately we don't know what log level is used for actual "invalid layout" message, or if it is even logged as all, since that happens elsewhere. So let's be cautious and use a debug log level here.
* Refresh screen on pixel format changePierre Ossman2025-03-203-0/+10
| | | | | | | | | | Make sure everything on screen has a consistent look when the client switches between different pixel formats. Use the lossless refresh mechanism to make sure this doesn't interfere with more important updates. Based on a suggestion by Piotr Henryk Dabrowski.
* Don't wrap exceptions from readRect()Pierre Ossman2025-03-131-6/+2
| | | | | | | | This is a revert of 0ce9fef. The object slicing is causing issues, e.g. when we get a completely expected end_of_stream exception. It's unclear what exceptions we needed this wrapping for. We'll just have to remove it and see what problems we encounter.
* Use std::exception_ptr to store exceptionsPierre Ossman2025-03-136-52/+36
| | | | This is much more robust and flexible than what we came up with.
* Handle very early connection errorsPierre Ossman2025-03-131-3/+9
| | | | | | It's rare, but there are some things that can go wrong in the constructor for a new client object. Make sure we handle these and properly close the socket, rather than leave it dangling.
* Fix bad logic in security types handlingPierre Ossman2025-03-131-1/+1
| | | | Broken in 4ff02ae.
* Merge branch 'config_types' of https://github.com/CendioOssman/tigervncPierre Ossman2025-03-1319-124/+668
|\
| * Also split help output lines on commaPierre Ossman2025-03-131-6/+17
| | | | | | | | | | | | | | This is needed when we have very long defaults for list parameters. Note that the logic gets a bit more convoluted as we want to keep the comma with the word, unlike the whitespace.
| * Wrap description and default value the samePierre Ossman2025-03-131-9/+5
| |
| * Handle all whitespace when wrapping help outputPierre Ossman2025-03-131-5/+3
| |
| * Handle whitespace in list parametersPierre Ossman2025-03-131-0/+7
| |
| * Convert SecurityTypes to EnumListParameterPierre Ossman2025-03-136-29/+42
| |
| * Enable unencrypted "Plain" authentiction by defaultPierre Ossman2025-03-131-1/+1
| | | | | | | | | | The client should support all server security types by default. Unsure why this was overlooked.
| * Add enumeration list parameterPierre Ossman2025-03-132-1/+155
| | | | | | | | Same as IntListParameter and StringListParamter, but for enumerations.
| * Convert PlainUsers to StringListParameterPierre Ossman2025-03-132-11/+11
| |
| * Convert RemapKeys to StringListParameterPierre Ossman2025-03-132-31/+37
| |
| * Remove KeyRemapper mutexPierre Ossman2025-03-132-11/+0
| | | | | | | | We don't do multiple threads on the server, so this is not needed.
| * Convert Log parameter to StringListParameterPierre Ossman2025-03-132-9/+11
| |
| * Add string list parameter typePierre Ossman2025-03-122-0/+59
| | | | | | | | | | Same as for IntListParameter, consolidate the list handling code to a single place.
| * Add integer list parameter typePierre Ossman2025-03-122-2/+194
| | | | | | | | Consolidate handling of a list of values in a single piece of code.
| * Add enumeration parameter typePierre Ossman2025-03-122-0/+96
| | | | | | | | | | Consolidate validation of enumeration in a central place since this is now a popular type of paramater.
| * Make use of IntParameter range validationPierre Ossman2025-03-065-11/+19
| |
| * Validate integer parameter valuesPierre Ossman2025-03-061-3/+16
| | | | | | | | | | Complain so that the user/developer sees the issue rather than just silently ignoring the problem.
| * Avoid std::string(nullptr) for StringParameterPierre Ossman2025-03-061-1/+1
| | | | | | | | This is undefined and crashes on macOS.
* | Merge branch 'msvc' of https://github.com/KangLin/tigervncPierre Ossman2025-03-111-2/+1
|\ \ | |/ |/|
| * MSVC: fix compile error in Socket.cxxKang Lin2025-02-281-2/+1
| |
* | Fix bad forward declarations of StringParameterPierre Ossman2025-03-032-4/+0
| | | | | | | | This should have been done as part of cf1bc66.