aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of TCHAR magicPierre Ossman2023-02-041-4/+3
| | | | | We never use Windows' "UNICODE" mode anyway, so let's get rid of this complexity.
* Return std::vector instead of dynamic allocationPierre Ossman2023-02-045-21/+23
| | | | | This makes memory management more clear and robust when using these helper functions.
* Avoid duplicating configuration settingPierre Ossman2023-02-041-16/+7
| | | | | Let the string helpers call the more fancy setParam(). This makes sure we can avoid duplicating things.
* Make sure length is reset on assignmentPierre Ossman2023-02-041-1/+3
| | | | | Otherwise the old length is preserved, which will result in NULL pointer dereferencing if the parameter is ever accessed.
* Clean up BinaryParameter typingPierre Ossman2023-02-043-16/+21
| | | | | This is explicitly a byte sequence, so let's try to keep a consistent typing.
* Move hex conversion helpers to utilPierre Ossman2023-02-043-5/+94
| | | | | These are used here and there so let's make them more general rather than hiding them in the stream classes.
* Use std::vector for basic data arraysPierre Ossman2023-02-019-111/+119
| | | | | Avoid our own custom types in favour of what's already included with C++.
* Use stdint typesPierre Ossman2023-02-0193-839/+858
| | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
* Use templates for optimized codePierre Ossman2023-02-0131-2062/+1582
| | | | | Avoid preprocessor magic and instead rely on templating to generate optimized functions for performance critical code.
* Fix CRLF line endingsPierre Ossman2023-01-174-398/+398
| | | | Everything else uses LF line endings, so fix up the few stray ones.
* Use __attribute__:s directlyPierre Ossman2023-01-054-24/+15
| | | | | | These are supported by gcc and clang, and I don't think MSVC works well with our code anyway, so let's keep things simple and use these directly.
* Protect key variables from setjmp()Pierre Ossman2023-01-052-10/+13
| | | | | If we don't mark these as volatile then they might get reset on longjmp() and the code will misbehave.
* Remove useless const specifiersPierre Ossman2023-01-052-4/+4
| | | | | These are just values, so setting const on them has no effect as the caller will get a copy.
* Explicitly mark switch case fall throughPierre Ossman2023-01-053-0/+8
| | | | | This allows us to separate accidental fall through from explicit ones, which allows us to turn on such checks in the compiler.
* Fix RSA-AES state machinesPierre Ossman2023-01-052-48/+44
| | | | | | | | | | If there isn't enough data, then the client reading the hash will fall down and try to read the subtype instead, which isn't correct. Invert the logic so we get a more consistent way through where we only break out when there is insufficient data. Do the same for the server code, for consistency.
* Explicitly mark unused parametersPierre Ossman2023-01-0430-77/+94
| | | | | This allows us to separate accidentally unused, from explicitly unused parameters, which allows us to turn on such checks in the compiler.
* Don't include palette to full color methodsPierre Ossman2023-01-044-9/+7
| | | | They have no need for it, so let's simplify things.
* Remove unused flags to decoder contextsPierre Ossman2023-01-046-6/+13
| | | | Everything in flags is already handled at a higher level.
* Stop supplying flags to clipboard peek handlerPierre Ossman2023-01-0410-10/+10
| | | | The flags should always be empty anyway.
* Mark system include paths correctlyPierre Ossman2023-01-041-5/+5
| | | | | This makes sure the compiler doesn't complain about problems in those files.
* Add client-side support for the MSLogonII security type.Dinglan Peng2022-12-276-26/+232
|
* Add client-side support for the DH security type.Dinglan Peng2022-12-276-3/+210
|
* Flush decoder errors on close()Pierre Ossman2022-11-071-0/+10
| | | | | | We don't want any stray exceptions as we are cleaning up, so handle any still pending decoder errors by just logging them. We are already shutting down so there is no need to abort the connection here.
* Don't enable RSA-AES by default in serversPierre Ossman2022-10-141-3/+0
| | | | | | These require a key to have been set up on the server beforehand, so they do not give a good default experience as clients will be unable to connect.
* Ignore whitespace around components of host-and-port specificationCatherine Tower2022-09-011-2/+22
| | | | This is to make the code more tolerant of typos when entering a hostname
* Fix incorrect nettle library referencesPierre Ossman2022-09-011-1/+4
|
* Add support for RSA-AES security typespdlan2022-09-0112-13/+1316
|
* Move include_directories() to proper placesPierre Ossman2022-08-251-1/+5
| | | | We should scope these as narrowely as possible to avoid side effects.
* Remove unused CSecurity::description()Pierre Ossman2022-08-2510-25/+3
|
* Safely discard large (extended) clipboard contentsPierre Ossman2022-06-282-8/+40
| | | | | | | | | Avoid having to buffer everything we want to discard, and instead do it piece by piece. This is more efficient, and avoids hitting any limits on the buffering. Note that this is safe here because we already know we have all the compressed data. It would not be safe for a general input stream.
* Merge branch 'mft-crop-fix' of https://github.com/mmozeiko/tigervncPierre Ossman2022-06-132-8/+220
|\
| * Workaround for MFT cropping in H264 decodingMartins Mozeiko2022-06-072-8/+220
| | | | | | | | | | | | | | | | | | It seems MFT h264 decoder does not support frame cropping. Which means that if frame width or height is not multiple of 16 then decoded output can potentially be used with wrong offset. This code adds explicit parsing of SPS to extract cropping information to use, and will apply cropping if reported size differs from expected.
* | Find FFMPEG using pkg-configPierre Ossman2022-06-071-0/+1
| | | | | | | | | | | | This is the standard method of finding it on Unix systems, so make sure we use it. Still keep a fallback, though, for other systems, e.g. Windows.
* | Fix up ffmpeg header and library handlingPierre Ossman2022-06-071-1/+2
| | | | | | | | | | FFMPEG is needed by the RFB library, so all the details about it should only be applied there and not for other components.
* | Use pkg-config for pixmanPierre Ossman2022-06-071-2/+3
| | | | | | | | | | | | This is the standard method of finding it on Unix systems, so make sure we use it. Still keep a fallback, though, for other systems, e.g. Windows.
* | Avoid temporary cmake variablesPierre Ossman2022-06-071-24/+13
|/ | | | | Modern cmake has better support for adding source files and libraries incrementally, so let's use that to clean things up.
* 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.
* Print GnuTLS certificate status as hexPierre Ossman2022-03-241-1/+1
| | | | It's a bit field so it's easier to decode in hex.
* Allow exceptions for expired certificatesPierre Ossman2022-03-241-20/+55
| | | | | The browsers allow users to make an exception for expired certificates, so we should probably also.
* Make sure server name is always a valid stringPierre Ossman2022-03-242-2/+9
| | | | | Otherwise we can get crashes on NULL dereference. This should only happen on reverse connections where we don't have a server address.
* Fix compilation issue.Chris2022-02-281-1/+1
| | | | | | | | | | | | | | | | | Ubuntu 20.04 gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 libx264-dev:amd64 2:0.155.2917+git0a84d98-2 [ 11%] Building CXX object common/rfb/CMakeFiles/rfb.dir/H264LibavDecoderContext.cxx.o tigervnc/common/rfb/H264LibavDecoderContext.cxx: In member function ‘virtual bool rfb::H264LibavDecoderContext::initCodec()’: tigervnc/common/rfb/H264LibavDecoderContext.cxx:50:40: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive] 50 | AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_H264); | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ | | | const AVCodec* make[2]: *** [common/rfb/CMakeFiles/rfb.dir/build.make:895: common/rfb/CMakeFiles/rfb.dir/H264LibavDecoderContext.cxx.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:597: common/rfb/CMakeFiles/rfb.dir/all] Error 2 make: *** [Makefile:130: all] Error 2
* get rid of c++11 stuffVladimir Sukhonosov2022-01-252-3/+3
|
* Improve logging around screen resizingPierre Ossman2022-01-252-4/+17
| | | | | | Avoid duplication, and add logging for some more error conditions so it's possible to see in the logs why a resize has failed or produced unexpected results.
* support H264 decoding with MediaFoundation on WindowsMārtiņš Možeiko2022-01-213-0/+382
|
* H264 DecoderVladimir Sukhonosov2022-01-2110-0/+617
| | | | Linux implementation using ffmpeg
* Fix handling of VMware cursorsPierre Ossman2022-01-181-2/+2
| | | | | | This is a regression from ad0f061. If a VMware cursor rect was split up over multiple read()s then the stream would become corrupted as we set the restore point at the wrong place.
* Be consistent in including config.hPierre Ossman2021-12-3062-20/+250
| | | | | | 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.
* 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.
* Throw more descriptive error on rect read errorPierre Ossman2021-11-041-2/+6
| | | | Gives a bit more context where this error happened.