aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr
Commit message (Collapse)AuthorAgeFilesLines
* Include error code in getaddrinfo() exceptionsPierre Ossman2020-03-261-1/+10
|
* Avoid using insecure variable length arraysPierre Ossman2020-03-261-1/+2
|
* Merge branch 'unicode_translation' of https://github.com/CendioAlex/tigervncPierre Ossman2020-03-172-28/+34
|\
| * Throw GAIException() for getaddrinfo errorsAlex Tanskanen2020-03-172-2/+25
| | | | | | | | | | | | | | | | Created a new subclass of Exception called GAIException() that will handle error messages from getaddrinfo() instead of letting Exception() handle it. GAIException() will make use of gai_strerror() to map the error code to text. On Windows, gai_strerrorW() must be used if the text is encoded with UTF-8.
| * Make system error messeges in Windows 10 use UTF-8Alex Tanskanen2020-03-121-26/+9
| | | | | | | | | | | | The previous error messages did not support Unicode characters. This commit will use UTF-8 encoding to be able to display error messages in every language.
* | Fix error check for zlib callsPierre Ossman2020-02-272-3/+3
|/ | | | | There are multiple "okay" return values, not just Z_OK. Make sure we don't bail out needlessly.
* Merge branch 'secfix' of https://github.com/CendioOssman/tigervncPierre Ossman2019-12-2025-250/+227
|\
| * Be defensive about overflows in stream objectsPierre Ossman2019-11-1513-48/+75
| | | | | | | | | | | | | | | | | | | | | | | | We use a lot of lengths given to us over the network, so be more paranoid about them causing an overflow as otherwise an attacker might trick us in to overwriting other memory. This primarily affects the client which often gets lengths from the server, but there are also some scenarios where the server might theoretically be vulnerable. Issue found by Pavel Cheremushkin from Kaspersky Lab.
| * Use size_t for lengths in stream objectsPierre Ossman2019-11-1524-155/+156
| | | | | | | | | | | | | | | | Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
| * Remove unused FixedMemOutStreamPierre Ossman2019-11-151-52/+0
| |
| * Make ZlibInStream more robust against failuresPierre Ossman2019-11-152-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | Move the checks around to avoid missing cases where we might access memory that is no longer valid. Also avoid touching the underlying stream implicitly (e.g. via the destructor) as it might also no longer be valid. A malicious server could theoretically use this for remote code execution in the client. Issue found by Pavel Cheremushkin from Kaspersky Lab
* | Handle pending data in TLS buffersPierre Ossman2019-12-091-3/+5
|/ | | | | | There might be more bytes left in the current TLS record, even if there is nothing on the underlying stream. Make sure we properly return this when we aren't being requested to block.
* Do proper logging rather than fprintf(stderr, ...)Pierre Ossman2019-04-292-11/+17
|
* Remove commented out loggingPierre Ossman2019-04-291-10/+0
|
* Remove Java web serverPierre Ossman2018-10-091-102/+0
| | | | | Applets don't work anymore so remove everything that has to do with serving them.
* Fix bad reference in TLSException initialiserPierre Ossman2018-05-291-1/+1
|
* Fully standardise on send()/recv()Pierre Ossman2017-11-082-7/+6
| | | | We already assume sockets here since we use select().
* Added my/Cendio copyright where relevantPeter Åstrand (astrand)2017-11-081-0/+1
|
* Use send() with MSG_DONTWAIT when possiblePeter Åstrand (astrand)2017-11-081-1/+9
|
* Make exception classes have clearer messagesPierre Ossman2017-10-121-6/+2
| | | | | Include the type of exception in the string generated by each subclass. Also simplify the constructs to what is needed.
* rdr: Fix incorrect error checking after fread()Steve Kondik2017-07-081-3/+3
| | | | | | | | | fread() returns size_t, which is unsigned. Don't check for negative values to avoid warnings from Clang. /home/shade/dev/tigervnc/common/rdr/FileInStream.cxx:74:13: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] if (n < 0 || ferror(file)) ~ ^ ~
* Add missing virtual destructorsSteve Kondik2017-07-081-0/+1
| | | | | | | | | | | | | | Fix warnings emitted by Clang: /home/shade/dev/tigervnc/common/rdr/FdInStream.h:30:9: error: 'rdr::FdInStreamBlockCallback' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor] class FdInStreamBlockCallback { ^ In file included from /home/shade/dev/tigervnc/common/network/TcpSocket.cxx:44: In file included from /home/shade/dev/tigervnc/common/network/TcpSocket.h:31: /home/shade/dev/tigervnc/common/network/Socket.h:82:9: error: 'network::ConnectionFilter' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor] class ConnectionFilter { ^ ..etc
* Fix busy loop in FdOutStream::flush()Pierre Ossman2016-10-101-1/+6
| | | | | | | This bug was introduced in c6df31db. A non-blocking socket that did not have any more space would busy loop until the write succeeded. Instead now it returns without any action, just as it did before the bug was introduced.
* Clean up FdOutStream::flush()Pierre Ossman2016-04-291-21/+3
| | | | The logic was a bit confusing and superfluous.
* Remove Windows 98 socket workaroundPierre Ossman2016-04-291-26/+22
| | | | We haven't supported such an old version of Windows for some time.
* Clear up ZlibInStream::reset() behaviourPierre Ossman2015-11-272-15/+43
| | | | | | | | | It previously only did a reset of the ZlibInStream object, not the underlying zlib stream. It also had the side effect of flushing the underlying stream and disassociating from it. Clear things up by changing the naming, and introducing a proper reset function (which is needed by the Tight decoder).
* Add efficient method to copy data between two streamsPierre Ossman2015-11-271-0/+12
|
* Remove unneeded virtual qualifiers on stream methodsPierre Ossman2015-11-272-2/+2
|
* Remove old Windows CE codePierre Ossman2015-11-091-9/+0
|
* Use mingw's gettimeofday()Pierre Ossman2015-11-091-33/+1
| | | | | mingw has a perfectly functional gettimeofday() so use that instead of having multiple copies of our own version.
* Avoid dropping const qualifier needlesslyPierre Ossman2015-09-291-1/+1
|
* Fix Winsock errno code overlapPierre Ossman2015-05-292-2/+2
| | | | | Some Winsock errno:s conflict with the standard ones. Try to restrict the redefines to things relevant for sockets.
* Merge branch 'upreqs' of https://github.com/CendioOssman/tigervncPierre Ossman2015-03-125-63/+15
|\ | | | | | | | | | | Conflicts: contrib/packages/rpm/el5/SPECS/tigervnc.spec vncviewer/Viewport.cxx
| * Raise GnuTLS requirements to 3.xPierre Ossman2015-01-295-63/+15
| | | | | | | | | | | | This allows us to simplify things by getting rid of some old compatibility code. People should really be using current versions of GnuTLS anyway to stay secure.
* | Fix bad signed/unsigned comparisonsPierre Ossman2015-03-033-3/+3
| | | | | | | | | | Either by casting, or switching to a more appropriate type for the variable.
* | Make sure Exceptions do not use unsafe format stringsPierre Ossman2015-03-033-12/+5
| |
* | Tag the Exception constructor as a printf functionPierre Ossman2015-03-031-1/+7
| | | | | | | | | | This allows the compiler to analyse the format strings and arguments for correctness.
* | Merge branch 'perf' of https://github.com/CendioOssman/tigervncPierre Ossman2015-02-133-0/+138
|\ \
| * | Add stream class to feed data from a filePierre Ossman2015-02-133-0/+138
| |/
* / Use a common header file for Windows errno names.Peter Åstrand (astrand)2015-02-052-5/+2
|/ | | | | | | | In earlier Visual Studio and MinGW editions, BSD socket errno:s were left undefined. This is no longer the case. This may cause build or runtime errors. To avoid this, we are using a common header file which corrects all definitions. This header will also be used with other projects such as sercd, unfs3, PulseAudio etc.
* Move ws2_32 dependency to the correct placePierre Ossman2014-10-171-2/+2
| | | | It is rdr and network that needs it, not vncviewer.
* Use printf constructor safelyPierre Ossman2014-07-211-1/+1
| | | | | The input string might contain formatting marks, so make sure those are ignored.
* Push encoding specific formats into the encoders and decodersPierre Ossman2014-07-072-48/+0
| | | | Keep the generic stream classes clean and general.
* Remove a lot of platform compatibilty stuffPierre Ossman2014-07-073-29/+5
| | | | It's either not used, or no longer relevant.
* GnuTLS 3.x has removed gnutls_transport_set_global_errno() in favour ofPierre Ossman2012-07-033-11/+51
| | | | | | | | gnutls_transport_set_errno(). Make sure we call the right errno function depending on which GnuTLS we're using. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4922 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Refactor the TLS code so that the push/pull functions are aware of theirPierre Ossman2012-07-034-10/+24
| | | | | | | containing stream object. This is in preparation for supporting GnuTLS 3.x. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4921 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Add method to query how long since we last wrote something to a fd.Pierre Ossman2011-11-152-0/+17
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4802 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Make socket writes non-blockable. This allows the system to more quicklyPierre Ossman2011-10-252-11/+75
| | | | | | | | return back to the Xorg main loop, meaning that things will be more responsive in the presence of slow VNC clients. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4735 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Another attempt at solving the compression level change problems. We were stillPierre Ossman2011-10-182-63/+75
| | | | | | | not detecting the correct approach properly, and hence still getting crashes. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4731 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Move setting of PIC code to a central locationDRC2011-08-231-8/+0
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4648 3789f03b-4d11-0410-bbf8-ca57d06f2519