aboutsummaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* More graceful handling of disabled listenersPierre Ossman2023-09-081-4/+0
| | | | | | Don't assume a lack of TCP listeners means the server will be unreachable. There might be other methods of access, so let the higher levels do that sanity check instead.
* Avoid legacy C function definitionsPierre Ossman2023-08-151-19/+11
| | | | These aren't supported in C2x, and clang will already now complain.
* More logging for server cert exceptionsPierre Ossman2023-07-051-6/+8
| | | | | Let's log a bit more details when we need to deal with certificate exceptions to make it easier to debug things.
* Allow exception for cert hostname mismatchPierre Ossman2023-07-051-9/+43
| | | | | The browsers let you add an exception for this case, so we should as well.
* Improve reporting of certificate errorsPierre Ossman2023-07-051-32/+44
| | | | | GnuTLS can help use translate certificate issues in to user presentable strings, so let's clean up that reporting.
* Allow exception for weak certificate algorithmsPierre Ossman2023-07-051-3/+43
| | | | | The browsers let you add an exception for this case, so we should as well.
* Remove double expired certificate promptsPierre Ossman2023-07-051-8/+0
| | | | This should have been done in 5f46d55.
* Allow exception for not yet activated certificatesPierre Ossman2023-07-051-3/+43
| | | | | The browsers let you add an exception for this case, so we should as well.
* Make sure we handle all certificate issuesPierre Ossman2023-07-051-0/+22
| | | | | | We don't want to proceed unless we've made sure the user has approved the issues with the certificate. So add an extra check that all status flags have been dealt with.
* Handle GNUTLS_CERT_INVALID in TOFU codePierre Ossman2023-07-051-2/+4
| | | | | GnuTLS should hopefully never set just this flag, but let's be fully prepared for all scenarios.
* Remove old GnuTLS compatibility codePierre Ossman2023-07-051-17/+1
| | | | | We've required GnuTLS 3.x for a long time, so this code has been dead for a while.
* Merge branch 'types2' of https://github.com/CendioOssman/tigervncPierre Ossman2023-06-3052-118/+196
|\
| * Don't allow surrugate code points in UTF-8Pierre Ossman2023-06-301-0/+6
| | | | | | | | | | | | These are not valid outside of UTF-16 so seeing them in a UTF-8 sequence means that something is wrong with that sequence. Best to filter them out rather than letting them propagate and have unknown effects.
| * Clean up string encoding handlingPierre Ossman2023-06-308-23/+86
| | | | | | | | | | | | 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-1850-97/+106
| | | | | | | | | | 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.
* | Emulate corking when TCP_CORK is missingPierre Ossman2023-06-281-1/+6
| | | | | | | | | | If we can't rely on the OS to handle corking for us, then we need to enable our own handling of it.
* | Prefer target_include_directories()Pierre Ossman2023-03-314-17/+14
| | | | | | | | | | It is more specific, and it properly sets up propagation when include directories also need to be used further down a dependency chain.
* | Add all common inter-dependenciesPierre Ossman2023-03-314-2/+6
|/ | | | | This is important in case there are build flags that need to propagate between libraries for things to build correctly.
* Merge branch 'types' of https://github.com/CendioOssman/tigervncPierre Ossman2023-03-02173-4210/+3505
|\
| * Merge "Pixel" type in to PixelFormat headerPierre Ossman2023-02-184-29/+3
| | | | | | | | | | It's a type specific to that class, so let's keep them close for clarity.
| * Use operator overloading for comparisonPierre Ossman2023-02-0416-25/+38
| | | | | | | | | | It is much more natural than custom methods for this very common operation.
| * Warn if Point/Rect/Region methods are used wrongPierre Ossman2023-02-042-9/+24
| | | | | | | | | | | | It is easy to get confused if these methods modify the existing object, or return a new one. So let's mark the return value as critical so the compiler can help out if someone gets it wrong.
| * Avoid redefining errnoPierre Ossman2023-02-042-12/+12
| | | | | | | | | | | | This can have unexpected consequences as some code may rely on it being a simple variable. Instead to what we do in Socket, which is to define a unique name for getting socket error numbers.
| * Remove unneeded header from SDesktop.hPierre Ossman2023-02-043-3/+2
| | | | | | | | It doesn't use any exceptions, so stop including the header for it.
| * Remove unused rfb/util.h includesPierre Ossman2023-02-0421-10/+13
| | | | | | | | | | | | | | | | 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.
| * Remove "str" prefix from string helpersPierre Ossman2023-02-048-58/+57
| | | | | | | | | | This matches the naming in STL, which is what we are mostly mimicing now that we are using std::string for these functions.
| * Use standard C string functionsPierre Ossman2023-02-042-34/+0
| | | | | | | | It's just confusing that we have our own variety that isn't compatible.
| * Remove custom CharArray typePierre Ossman2023-02-044-47/+4
| | | | | | | | | | It has now been replaced, mostly by std::string, so remove the actual type definition.
| * Use std::string for string memory managementPierre Ossman2023-02-0413-77/+50
| | | | | | | | | | Avoids a bit of complexity by delegating that handling to a string object.
| * Use std::string instead of CharArrayPierre Ossman2023-02-0423-170/+196
| | | | | | | | | | Let's use a more common type instead of something homegrown. Should be more familiar to new developers.
| * Use std::vector for temporary char arraysPierre Ossman2023-02-043-20/+18
| | | | | | | | | | | | | | | | It's more standard and familiar than our custom CharArray type, and it still gives us automatic freeing of the buffer. We could probably have used std::unique_ptr instead, but we are currently targeting older compilers where C++11 isn't standard yet.
| * Make strSplit() simpler and saferPierre Ossman2023-02-046-92/+70
| | | | | | | | | | | | | | Get rid of all the magical re-allocation and shuffling and instead just return a new set of strings that is fully splitted. Will consume a bit more memory, but is a lot safer to use as there is less confusion about ownership of memory.
| * Return std::string instead of dynamic allocationsPierre Ossman2023-02-0424-290/+242
| | | | | | | | | | | | 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.
| * Specify expected array size in argumentsPierre Ossman2023-02-042-4/+4
| | | | | | | | | | The compiler doesn't enforce this, but it at least documents the expected array size.
| * Use fixed size character bufferPierre Ossman2023-02-046-52/+43
| | | | | | | | | | We know the needed space here, so let's keep it simple with a constant size string buffer.
| * Remove trailing slash from getvnchomedir()Pierre Ossman2023-02-042-6/+6
| | | | | | | | | | It should return a path to the directory itself, just like its sister function getuserhomedir().
| * Namespace directory functionsPierre Ossman2023-02-043-20/+24
| | | | | | | | All library functions should be in a proper namespace.
| * Better fallback for missing peer addressPierre Ossman2023-02-041-3/+3
| | | | | | | | | | | | A blank string might be very confusing, depending on where this will be used. Let's give something more visible back in the cases where we cannot get the proper name for the peer.
| * Return static char buffer from some methodsPierre Ossman2023-02-0410-92/+75
| | | | | | | | | | | | | | | | | | This mimics how some system functions (like inet_ntop()) work, and avoids complexity around ownership of the returned string buffer. The downside is that the string must be consumed directly as it will be overwritten on the next call, but that is not an issue with the current usage.
| * Replace tabs with spacesPierre Ossman2023-02-041-45/+45
| | | | | | | | Use the same indentation we use in all other files.
| * Remove unneded string duplicationPierre Ossman2023-02-041-8/+1
| | | | | | | | | | It's unclear why this was initially added. The function takes string constants, so it is not going to modify these.
| * Remove unneeded CharArray:sPierre Ossman2023-02-041-12/+9
| | | | | | | | | | Avoid complicating things by moving things in to a second buffer here as there is no need for it.
| * Use StringParameters directlyPierre Ossman2023-02-0410-34/+11
| | | | | | | | | | We don't need to make extra copies of the string in most cases, so let's simplify the code and access the string directly when we can.
| * Get rid of TCHAR magicPierre Ossman2023-02-044-14/+6
| | | | | | | | | | 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-047-83/+102
| | | | | | | | | | 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-0110-182/+119
| | | | | | | | | | Avoid our own custom types in favour of what's already included with C++.