aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/SConnection.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Capitalize first letter in log, exception & errorMadeleine Nilsson2024-11-211-4/+4
| | | | The reason for this is to keep a consistency through out the project.
* Remove ConnFailedExceptionPierre Ossman2024-09-021-9/+9
| | | | | | | | There were more unclear usage of this exception class, and since nothing catches it it is very unclear what the purpose is. Go ahead and just remove it. Follow-up to bcaaea7.
* Remove auth exception prefixPierre Ossman2024-08-071-2/+2
| | | | | | | | This prefix often just added noise, and could sometimes be added multiple times. It's better that user interface catch the specific exception type and give a more descriptive presentation to the user. This is partially a revert of 1922550.
* Avoid shadowing variablesPierre Ossman2024-06-241-4/+4
| | | | | It's a source of confusion and possibly bugs to reuse the same variable name for multiple things.
* Prefer std::find() over manual searchPierre Ossman2024-06-241-4/+5
| | | | | Let's avoid reimplementing something basic that's available in the standard library. It also makes the code easier to read.
* Use nullptr in all C++ codePierre Ossman2024-06-241-5/+5
| | | | | It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
* Merge branch 'present' of github.com:CendioOssman/tigervncPierre Ossman2024-06-191-5/+3
|\
| * Explicitly request timer repetitionPierre Ossman2024-06-191-5/+3
| | | | | | | | | | | | One-shot timers are more common, so let's change the API a bit to make that use case simpler. This API also makes it more clear what is happening.
* | vncconfig: add option to force view-only remote client connectionsCarlos Santos2024-04-261-3/+3
| | | | | | | | | | | | | | | | Specifies that the server must ignore all keyboard or mouse events sent by the client. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2180903 Signed-off-by: Carlos Santos <casantos@redhat.com>
* | Move the AccessRights type and constants to the rfb namespaceCarlos Santos2024-04-231-13/+1
|/ | | | | | | | | They must belong to the rfb namespace, not to the SConnection class. Also add an AccessNone constant, since it's better to use a mnemonic symbol rather than zero to initialize the accessRights members. Signed-off-by: Carlos Santos <casantos@redhat.com>
* Clean up string encoding handlingPierre Ossman2023-06-301-4/+8
| | | | | | We should handle this in the low-level protocol code as much as possible to avoid mistakes. This way the rest of the code can assume that strings are always UTF-8 with \n line endings.
* Consistently use uint8_t for data buffersPierre Ossman2023-03-181-7/+9
| | | | | These will always be byte streams at heart, so let's try to keep them with a proper type. Should make it clearer how they will be used.
* Merge branch 'types' of https://github.com/CendioOssman/tigervncPierre Ossman2023-03-021-36/+30
|\
| * Remove unused rfb/util.h includesPierre Ossman2023-02-041-0/+1
| | | | | | | | | | | | | | | | These files don't use anything from this header, so remove the include. This exposes some missing includes in other places, though. So add an explicit include in the files that were relying on an indirect inclusion.
| * Use std::string for string memory managementPierre Ossman2023-02-041-17/+10
| | | | | | | | | | Avoids a bit of complexity by delegating that handling to a string object.
| * Use std::string instead of CharArrayPierre Ossman2023-02-041-5/+4
| | | | | | | | | | Let's use a more common type instead of something homegrown. Should be more familiar to new developers.
| * Return std::string instead of dynamic allocationsPierre Ossman2023-02-041-7/+8
| | | | | | | | | | | | We mostly use classical C strings, but the memory management around them can get confusing and error prone. Let's use std::string for the cases where we need to return a newly allocated string.
| * Use stdint typesPierre Ossman2023-02-011-13/+13
| | | | | | | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
* | Throw exception instead on bad access checkPierre Ossman2023-02-281-2/+2
|/ | | | | | An assert will kill the entire server, which is overly harsh when there is a problem with a single connection. Instead, throw an exception which will just disconnect that specific client.
* Explicitly mark unused parametersPierre Ossman2023-01-041-9/+11
| | | | | This allows us to separate accidentally unused, from explicitly unused parameters, which allows us to turn on such checks in the compiler.
* Stop supplying flags to clipboard peek handlerPierre Ossman2023-01-041-1/+1
| | | | The flags should always be empty anyway.
* Assert that accessCheck isn't called too earlySamuel Mannehed2022-04-291-0/+3
| | | | | These checks depend on accessRights being set up, this has only happened if we have done the QUERYING steps.
* Initialize SConnection's accessRightsSamuel Mannehed2022-04-291-1/+1
| | | | | Properties should be initialized in order to avoid random values in case they are used earlier than expected.
* Be consistent in including config.hPierre Ossman2021-12-301-0/+5
| | | | | | The generally recommended way is to include it from source files, not headers. We had a mix of both. Let's try to be consistent and follow the recommended way.
* Merge branch 'autoclip' of https://github.com/CendioOssman/tigervncPierre Ossman2021-02-031-14/+48
|\
| * Add debug logging for ignored clipboard eventsPierre Ossman2021-01-051-3/+9
| |
| * 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-051-3/+1
| | | | | | | | | | 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-041-6/+31
| | | | | | | | | | | | 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.
* | Change streams to be asynchronousPierre Ossman2020-05-211-22/+42
| | | | | | | | | | | | | | | | | | | | 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-211-8/+13
| | | | | | | | | | These are not universal in the protocol so having functions for them only obfuscates things.
* | Make sure TLS is allowed to terminate gracefullyPierre Ossman2020-05-211-7/+14
| | | | | | | | | | | | 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.
* | Move auth failure delay to SConnectionPierre Ossman2020-05-191-17/+41
|/ | | | | It's a generic feature that is better handled as part of SConnection's state machine.
* Support extended clipboard transfersPierre Ossman2019-07-011-5/+78
| | | | | | | Implements support in both client and server for the extended clipboard format first seen in UltraVNC. Currently only implements text handling, but that is still an improvement as it extends the clipboard from ISO 8859-1 to full Unicode.
* Use UTF-8 in clipboard APIPierre Ossman2019-07-011-2/+4
| | | | | In prepartion for better clipboard extensions that can send Unicode data between the client and server.
* Improved clipboard APIPierre Ossman2019-07-011-2/+45
| | | | | Change the internal clipboard API to use a request based model in order to be prepared for more advanced clipboard transfers.
* Add delay on authentication failuresPierre Ossman2019-04-011-5/+15
| | | | | | | This provides some basic rate limiting that will make it difficult for an attacker to brute force passwords. Only relevant when the blacklist is disabled as otherwise the attacker only gets a very limited number of attempts.
* Merge branch 'connparams' of https://github.com/CendioOssman/tigervncPierre Ossman2018-12-101-26/+44
|\
| * Make arguments explicit in all message writer methodsPierre Ossman2018-11-011-1/+2
| | | | | | | | | | | | Make sure all methods only write what is given as arguments, and avoid side effects by getting data from parameter objects. This keeps things readable in the calling code.
| * Rename ConnParams to ClientParamsPierre Ossman2018-11-011-22/+22
| | | | | | | | | | | | Now that we've split out server state to ServerParams, ConnParams only contains state for a client. Rename the class and variables to reflect this.
| * Move version reading/writing out of ConnParamsPierre Ossman2018-10-261-4/+21
| | | | | | | | | | That object is just a container for the current state. Move the I/O to the classes already doing such stuff.
* | Remove writeConnFailedFromScratch()Pierre Ossman2018-11-091-9/+0
| | | | | | | | It is static and only used from a single place, so let's inline it.
* | Move access rights and closing to SConnection objectPierre Ossman2018-10-101-0/+15
|/ | | | | This makes it generally useful and other code doesn't have to know of the specific sub-class.
* Strongly bind security objects to connection objectPierre Ossman2018-09-211-3/+3
| | | | | There is already an implicit connection between them, so let's make it explicit. This allows easy lookup outside of the processMsg() function.
* Remove destroy functionsPierre Ossman2018-09-211-1/+2
| | | | | These are just confusing and obfuscating. Do a normal delete of these objects instead.
* Make exception classes have clearer messagesPierre Ossman2017-10-121-20/+30
| | | | | Include the type of exception in the string generated by each subclass. Also simplify the constructs to what is needed.
* Basic support for QEMU Extended Key EventsPierre Ossman2017-08-281-0/+5
| | | | | | This adds the basic infrastructure and handshake for the QEMU Extended Key Events extension. No viewer or server makes use of the extra functionality yet though.
* Prevent leak of SecurityServer and ClientServer.Michal Srb2017-03-271-7/+5
| | | | | | They are created in SConnection's and CConnection's constructors but never destroyed. There is no reason for the indirection, so lets make them direct members.
* Early propagate of access rights to connection.Henrik Andersson2016-01-271-1/+1
|