aboutsummaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Keep alpha in cursor alpha conversionPierre Ossman2017-10-021-1/+0
| | | | | | | | | | | | | | | Don't touch the existing value or we might mess it up when we avoid division by zero.
* | | Make sure to start the frame timer after a buffer changePierre Ossman2017-09-221-0/+1
| | | | | | | | | | | | | | | The buffer is considered changed right away, so we might not get any add_changed() calls to trigger a start of the timer.
* | | Get rid of getFbSize()/getDesktopSize() in commonPierre Ossman2017-09-222-9/+0
| | | | | | | | | | | | It was only used by WinVNC, so push it there instead.
* | | Don't throw exceptions in destructorsPierre Ossman2017-09-151-10/+2
| | |
* | | Merge branch 'fix-warnings'Pierre Ossman2017-09-1520-21/+54
|\ \ \
| * | | rfb: Avoid unused argument warnings in headersSteve Kondik2017-09-154-7/+18
| | | | | | | | | | | | | | | | | | | | Don't force users of these headers to squash compiler warnings about unused arguments, annotate with __unused_attr.
| * | | rfb: vsnprintf returns an int, not size_tSteve Kondik2017-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: /home/shade/dev/tigervnc/common/rfb/util.cxx:55:13: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] if (len < 0) { ~~~ ^ ~ 1 error generated.
| * | | rfb: Silence nonliteral format string warning in LoggerSteve Kondik2017-07-102-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang complains loudly about this with Wformat=2, so add a __printf_attr to help out. Fixes: /home/shade/dev/tigervnc/common/rfb/Logger.cxx:48:35: error: format string is not a string literal [-Werror,-Wformat-nonliteral] vsnprintf(buf1, sizeof(buf1)-1, format, ap); ^~~~~~ 1 error generated.
| * | | rfb: Fix inheritance in CMsgWriterSteve Kondik2017-07-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InputHandler declares the second parameter of clientCutText as an int. Fixes: /home/shade/dev/tigervnc/common/rfb/CMsgWriter.h:60:18: error: 'rfb::CMsgWriter::clientCutText' hides overloaded virtual function [-Werror,-Woverloaded-virtual] virtual void clientCutText(const char* str, rdr::U32 len); ^ /home/shade/dev/tigervnc/common/rfb/InputHandler.h:36:18: note: hidden overloaded virtual function 'rfb::InputHandler::clientCutText' declared here: type mismatch at 2nd parameter ('int' vs 'rdr::U32' (aka 'unsigned int')) virtual void clientCutText(const char* str, int len) {} ^
| * | | rfb: Fix struct-vs-class warningsSteve Kondik2017-07-085-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang doesn't like when struct and class are used to refer to the same thing interchangeably. Fixes all instances of: In file included from /home/shade/dev/tigervnc/common/rfb/CConnection.cxx:29: In file included from /home/shade/dev/tigervnc/common/rfb/CConnection.h:28: /home/shade/dev/tigervnc/common/rfb/DecodeManager.h:35:3: error: class 'Exception' was previously declared as a struct [-Werror,-Wmismatched-tags] class Exception; ^ /home/shade/dev/tigervnc/common/rdr/Exception.h:32:10: note: previous use is here struct Exception { ^ /home/shade/dev/tigervnc/common/rfb/DecodeManager.h:35:3: note: did you mean struct here? class Exception; ^~~~~ struct /home/shade/dev/tigervnc/common/rfb/DecodeManager.h:43:3: error: class 'Rect' was previously declared as a struct [-Werror,-Wmismatched-tags] class Rect; ^ /home/shade/dev/tigervnc/common/rfb/Rect.h:68:10: note: previous use is here struct Rect { ^ /home/shade/dev/tigervnc/common/rfb/DecodeManager.h:43:3: note: did you mean struct here? class Rect; ^~~~~ struct
| * | | 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-086-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | rfb: Fix hidden function overload warningsSteve Kondik2017-07-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following warnings emitted by Clang: /home/shade/dev/tigervnc/common/rfb/Configuration.h:164:18: note: hidden overloaded virtual function 'rfb::VoidParameter::setParam' declared here: different number of parameters (0 vs 1) virtual bool setParam(); ^ /home/shade/dev/tigervnc/common/rfb/Configuration.h:256:18: error: 'rfb::BinaryParameter::setParam' hides overloaded virtual function [-Werror,-Woverloaded-virtual] virtual void setParam(const void* v, int l); ^ /home/shade/dev/tigervnc/common/rfb/Configuration.h:164:18: note: hidden overloaded virtual function 'rfb::VoidParameter::setParam' declared here: different number of parameters (0 vs 2) virtual bool setParam();
* | | | Fix shift state test in lock key heuristicsPierre Ossman2017-09-152-18/+18
| | | |
* | | | Merge branch 'securemsg' of https://github.com/CendioOssman/tigervncPierre Ossman2017-09-1511-4/+35
|\ \ \ \
| * | | | Use better security method description when using VeNCryptPierre Ossman2017-09-012-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | The sub-modules generally provide a better description than just the short security method name.
| * | | | Add better error message for insecure certificate algorithmsPierre Ossman2017-09-011-0/+3
| | | | |
| * | | | Display security state when asking for passwordPierre Ossman2017-09-0110-3/+24
| | |/ / | |/| | | | | | | | | | | | | | Indicate to the user how secure the transport channel is so they can avoid entering their password for untrusted sites.
* | | | Merge branch 'qemukbd-merge' of https://github.com/CendioOssman/tigervncPierre Ossman2017-09-1526-38/+471
|\ \ \ \
| * | | | Track keys based on client supplied key codesPierre Ossman2017-08-282-10/+44
| | | | | | | | | | | | | | | | | | | | | | | | | This makes it easier to provide more sane events to the backend code even with crazy clients.
| * | | | Remove unused needsLastRect state variablePierre Ossman2017-08-281-1/+0
| | | | |
| * | | | Fix wrong argument for CMsgWriter::clientCutText()Pierre Ossman2017-08-282-2/+2
| | | | | | | | | | | | | | | | | | | | As a result we weren't overloading properly.
| * | | | Basic support for QEMU Extended Key EventsPierre Ossman2017-08-2821-44/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | Send lock LED state from server to clientPierre Ossman2017-08-247-54/+161
| | | | |
| * | | | Add server side lock key sync heuristicPierre Ossman2017-08-244-1/+82
| | | | | | | | | | | | | | | | | | | | Based on QEMU's behaviour.
| * | | | Add client support for LED state syncPierre Ossman2017-08-249-3/+71
| |/ / /
* | | | Clear client cursor when switching to server sidePierre Ossman2017-09-151-1/+10
| | | | | | | | | | | | | | | | Otherwise the client can end up with two visible cursors.
* | | | Include server name in TLS handshake for SNIPierre Ossman2017-09-081-0/+5
|/ / / | | | | | | | | | | | | In case the server is a front-end to multiple systems and needs to know which system we're after.
* | | Support clients that only support alpha cursorsPierre Ossman2017-08-161-2/+4
| | |
* | | Send cursor pseudo-encodings in order of preferencePierre Ossman2017-08-161-2/+2
|/ / | | | | | | | | Some servers respect the ordering of pseudo-encodings as well, so make sure we list the best one first.
* / Limit size of cursor accepted by client.Michal Srb2017-04-062-0/+11
|/ | | | | | | | | Width and height of a cursor are received as U16 from network. Accepting full range of U16 values can cause integer overflows in multiple places. The worst is probably VLA in CMsgReader::readSetXCursor: rdr::U8 buf[width*height*4]; The width*height*4 can be too big to fit on stack or it can overflow into negative numbers. Both cases are undefined behaviour. Following writes to buf can overwrite other data on stack.
* Merge branches 'fix-vencrypt-leak' and 'fixes-ssecurityplain' of ↵Pierre Ossman2017-03-302-1/+11
|\ | | | | | | https://github.com/michalsrb/tigervnc
| * Limit max username/password size in SSecurityPlain.Michal Srb2017-03-302-0/+10
| | | | | | | | | | | | | | | | | | | | | | Setting the limit to 1024 which should be still more than enough. Unlimited ulen and plen can cause various security problems: * Overflow in `is->checkNoWait(ulen + plen)` causing it to contine when there is not enough data and then wait forever. * Overflow in `new char[plen + 1]` that would allocate zero sized array which succeeds but returns pointer that should not be written into. * Allocation failure in `new char[plen + 1]` from trying to allocate too much and crashing the whole server. All those issues can be triggered by a client before authentication.
| * Fix checkNoWait logic in SSecurityPlain.Michal Srb2017-03-301-1/+1
| | | | | | | | | | | | | | Currently it proceeds only if there aren't enough data in queue and then it blocks waiting. Also the required amount to receive from network is (ulen + plen), not (ulen + plen + 2). This allowed not authenticated clients to deny service to everyone.
* | Delete underlying ssecurity in SSecurityVeNCrypt.Michal Srb2017-03-291-0/+2
|/ | | | Otherwise it gets leaked which would allow even not authenticated clients to exhaust server memory.
*-. Merge branches 'fix' and 'fix-double-free-fences' of ↵Pierre Ossman2017-03-297-14/+17
|\ \ | | | | | | | | | https://github.com/michalsrb/tigervnc
| | * Prevent double free by crafted fences.Michal Srb2017-03-272-1/+4
| |/ |/| | | | | If client sent fence with some data, followed by fence with no data (length 0), the original fence data were freed, but the pointer kept pointing at them. Sending one more fence would attempt to free them again.
| * Prevent leak of SecurityServer and ClientServer.Michal Srb2017-03-274-13/+10
| | | | | | | | | | | | 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.
| * Fix crash from integer overflow in SMsgReader::readClientCutTextMichal Srb2017-03-271-0/+3
|/ | | | | | The length sent by client is U32, but is converted into int. If it was bigger than 0x7fffffff the resulting int is negative, it passes the check against maxCutText and later throws std::bad_alloc from CharArray which takes down the whole server. All the Streaming API deals with lengths in ints, so we can't tell it to skip that big amount of data. And it is not realistic to expect more than 2GB of clipboard data anyway. So lets just throw rdr::Exception that will disconnect this client and keep the server alive.
* Merge branch 'fps' of https://github.com/CendioOssman/tigervncPierre Ossman2017-02-247-160/+175
|\
| * Send updates with a fixed intervalPierre Ossman2017-02-245-84/+66
| | | | | | | | | | | | | | | | This redesigns the old "deferred updates" mechanism in to a frame clock that governs how often updates are sent out. The goal is still the same, to aggregate updates and avoid pointless updates, all in the name of efficiency. This model should however be more robust against delays that sometimes causes us to miss the desired rate.
| * Avoid flicker with a rendered cursorPierre Ossman2017-02-241-9/+4
| | | | | | | | | | This is not the code path commonly used in performance sensitive scenarios, so favour correctness over performance.
| * Only update rendered cursor when requestedPierre Ossman2017-02-243-28/+26
| |
| * Clean up VNCSConnectionST::needRenderedCursor()Pierre Ossman2017-02-241-3/+10
| | | | | | | | Make it a bit more readable.
| * Split up VNCSConnectionST::writeFramebufferUpdate()Pierre Ossman2017-02-242-38/+55
| | | | | | | | Make the control flow a bit clearer.
| * Better handling of slow timersPierre Ossman2017-02-241-7/+23
| | | | | | | | | | Make sure the code deals more gracefully with timers that take a long time to execute, and therefore might miss their deadlines.
* | Display performance statistics in viewerPierre Ossman2017-02-242-8/+10
| | | | | | | | | | | | Adds an optional graph to the viewer to display current frame rate, pixel rate and network bandwidth. Makes it easier to debug and test performance related issues.
* | Don't try to render cursors with no sizePierre Ossman2017-02-231-0/+5
| | | | | | | | | | Even if there are no pixels it will still trigger sanity checks when we start throwing bogus coordinates around.
* | Remove reallocation log message from ManagedPixelBufferPierre Ossman2017-02-221-1/+0
| | | | | | | | It adds a lot of noise to the debug output with little gain.
* | Server support for cursor with alphaPierre Ossman2017-02-225-6/+69
| |