aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/SSecurityPlain.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Use standard library naming for exceptionsPierre Ossman2024-11-061-3/+3
| | | | | This makes things more consistent since we mix with the standard library exceptions so often.
* Use standard exception classesPierre Ossman2024-11-061-1/+1
| | | | | Use the more specific already included exception classes for common errors to keep things more understandable.
* Don't abuse auth failure exceptionPierre Ossman2024-08-071-1/+1
| | | | | | | | This exception is for when the user fails to authenticate, not all possible errors that might occur during the authentication phase. Use more appropriate exception types for the various other problems that might occur, so that we can present things more accurately to the user.
* Remove auth exception prefixPierre Ossman2024-08-071-1/+1
| | | | | | | | 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-1/+1
| | | | | It's a source of confusion and possibly bugs to reuse the same variable name for multiple things.
* Use nullptr in all C++ codePierre Ossman2024-06-241-1/+1
| | | | | It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
* Support the "%u" username alias in PlainUsersCarlos Santos2023-10-031-0/+9
| | | | | | | | | | | This permits to enable PAM for the effective user of the Xvnc process by adding this to ~/.vnc/config or /etc/tigervnc/vncserver-config-defaults: SecurityTypes=TLSPlain PlainUsers=%u Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2233204 Signed-off-by: Carlos Santos <casantos@redhat.com>
* Consistently use uint8_t for data buffersPierre Ossman2023-03-181-2/+2
| | | | | 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.
* 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.
* Remove "str" prefix from string helpersPierre Ossman2023-02-041-1/+1
| | | | | This matches the naming in STL, which is what we are mostly mimicing now that we are using std::string for these functions.
* Make strSplit() simpler and saferPierre Ossman2023-02-041-15/+8
| | | | | | | 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-041-1/+2
| | | | | | 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 fixed size character bufferPierre Ossman2023-02-041-14/+8
| | | | | We know the needed space here, so let's keep it simple with a constant size string buffer.
* Add support for RSA-AES security typespdlan2022-09-011-1/+5
|
* Change streams to be asynchronousPierre Ossman2020-05-211-2/+2
| | | | | | | | | | 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).
* Make PAM mandatoryPierre Ossman2020-03-121-5/+5
| | | | | It is present on all UNIX systems anyway, so let's simplify things. We will need it for more proper session startup anyway.
* Fix memory leaksJan Grulich2018-11-201-1/+1
|
* Strongly bind security objects to connection objectPierre Ossman2018-09-211-2/+2
| | | | | There is already an implicit connection between them, so let's make it explicit. This allows easy lookup outside of the processMsg() function.
* Limit max username/password size in SSecurityPlain.Michal Srb2017-03-301-0/+7
| | | | | | | | | | | 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.
* [Development] Implement PasswordValidator class on Windows (Martin Koegler)Adam Tkac2010-11-021-0/+5
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4183 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Development] Implement *Plain security types on the server side and useAdam Tkac2010-09-021-27/+38
| | | | | | | PAM for credential validation on UNIX. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4128 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Cleanup] Ensure all files use LF as newline control character, not CR+LF.Adam Tkac2010-08-111-97/+97
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4119 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Development] Create VeNCrypt security types in Security class.Adam Tkac2010-07-201-4/+0
| | | | | | | Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4103 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Bugfix] Compile VeNCrypt extension only when gnutls is enabled and available.Adam Tkac2010-04-281-0/+8
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4049 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Development] Implement VeNCrypt security type on server side. Currently onlyAdam Tkac2010-04-231-0/+93
TLSNone and TLSVnc VeNCrypt subtypes are implemented. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4045 3789f03b-4d11-0410-bbf8-ca57d06f2519