Commit Graph

156 Commits

Author SHA1 Message Date
93d3bf052d Removed old line 2021-03-22 11:36:33 +00:00
7b3f6876b4 Fixed syntax error 2021-03-22 11:23:49 +00:00
46e03289be Manually merged region changes 2021-03-22 10:36:39 +00:00
c3e30dcea1 Add support for DLP_Region 2021-03-15 13:48:56 +02:00
fed991d697 Return 401 unauth for non-owner trying /api/ 2021-03-04 13:59:29 +02:00
1269fddadf Add a more specific error for a nonexistent screenshot 2021-03-04 13:43:05 +02:00
688e749fda Tentative build fix for newer gccs 2021-03-03 15:33:58 +02:00
980eedd33b Add HTTP GET APIs for creating, removing users and giving control 2021-03-03 14:55:14 +02:00
3f6524ee30 Add support for owner screenshot HTTP GET API 2021-03-02 15:23:32 +02:00
101695970b Reapply "Use crypt_r in threaded code" 2021-02-28 22:53:06 +13:00
9084409a20 Merge branch 'users' into packages_and_multiuser_passwd 2021-02-25 22:10:40 +13:00
fbe05cee86 Fix random 401 Forbidden on Ubuntu 20 and other newer releases 2021-02-25 21:23:21 +13:00
90101a7e91 Rpm: CentOS dfart. Rpm building isn't automated yet. 2021-02-05 23:49:47 +13:00
c32137fa17 Merge branch 'master' into create_ubuntu20_package 2021-01-20 23:39:29 +13:00
0d47d4890a Enable TLS 1.1 and 1.2 2021-01-20 22:49:32 +13:00
a4e70ff56b Remove less-than-256-colors indexed limit for small rects 2021-01-15 13:08:20 +02:00
83c83f43ef Add a parameter for separate SSL key 2021-01-15 13:07:53 +02:00
481b063eb7 Fix missing init for DLP timestamps 2020-12-03 12:29:38 +02:00
531705c05c Remove set-desktop-size perms from read-only clients 2020-10-14 15:50:28 +03:00
1f69d1584a Prevent read-only clients from changing kasm settings 2020-10-14 15:44:48 +03:00
a27744bca6 Enable TLS 1.1 and 1.2 2020-10-14 14:39:33 +03:00
36deba3a75 Correct non-basicauth and command-line user:pass being read-only 2020-10-14 14:27:08 +03:00
0c83a86bc8 Dynamically apply permissions 2020-10-13 13:38:18 +03:00
263d05a296 Apply read-only perms upon connecting 2020-10-12 15:11:49 +03:00
9a5afc5a62 Handle the new, multi-user kasmpasswd format auth 2020-10-12 14:58:11 +03:00
80513c8616 Change "recent" to be 10s from 60s, and in its own variable 2020-10-02 14:44:33 +03:00
1db77ee6bd Add some basicauth logging (most debug/verbose only) 2020-10-02 14:43:19 +03:00
279c41fc32 Add option to pass the password in an encrypted file, kasmvncpasswd utility 2020-10-01 14:37:51 +03:00
ae07707e66 Don't log BasicAuth 2020-10-01 13:07:32 +03:00
bb71cd4ec4 Have stats react faster to big cpu lag spikes 2020-10-01 13:00:34 +03:00
99fe70bbd6 Add a debug-level print on the last ~second's maximum encoding time 2020-09-28 14:37:19 +03:00
b30318a68f Change stats format to JSON array style 2020-09-28 14:26:38 +03:00
d5bdef121a Add support for bottleneck stats 2020-09-21 15:51:56 +03:00
3528e358cc Free memory from getaddrinfo()
We handled this in the failure scenario, but not in the vastly more
common successful case.
2020-09-21 13:52:01 +03:00
c312417d81 Correction to socket error connection message 2020-09-21 13:47:04 +03:00
80a637c793 Fix division by zero exception in SSecurityPlain.
If using SSecurityPlain and the user specifies an empty username
and password, it will invoke InStream::checkNoWait(0) which will
cause a division by zero when calculating the number of available
items.

Enhance InStream::check() to behave properly when asked for
zero items, or zero sized items.

Add comments to InStream::check(), InStream::checkNoWait(),
and InStream::readBytes() to document expected behaviour
when requested to check or read zero items, or an item with
zero size.
2020-09-21 13:46:38 +03:00
47bba8a1e6 Fix JpegCompressor::overrun() type change
The method it overloads got tweaked some time ago, so we need to make
sure this method follows suit.
2020-09-21 13:42:29 +03:00
da406d0cac Include error code in getaddrinfo() exceptions 2020-09-21 13:26:51 +03:00
9240f0b85c Avoid using insecure variable length arrays 2020-09-21 13:26:39 +03:00
03639406dc Throw GAIException() for getaddrinfo errors
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.
2020-09-21 13:26:15 +03:00
209712b18f Fix typo in SocketException message 2020-09-21 13:25:51 +03:00
57427d5d33 Make system error messeges in Windows 10 use UTF-8
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.
2020-09-21 13:25:38 +03:00
f38e474993 Fix error check for zlib calls
There are multiple "okay" return values, not just Z_OK. Make sure we
don't bail out needlessly.
2020-09-21 13:18:11 +03:00
49f9ce8e5b Remove remnants of the old HTTP server 2020-09-21 13:17:11 +03:00
06fd7ac061 Use sys/time.h on Windows as well
Modern MinGW seems to provide this, so simplify things a bit. This also
side steps some of the issue of the windows.h/winsock2.h include
ordering.
2020-09-21 13:05:50 +03:00
b7dc4a16fe Handle pending data in TLS buffers
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.
2020-09-21 13:00:41 +03:00
ed73ac2aa7 Handle pixel formats with odd shift values
Our fast paths assume that each channel fits in to a separate byte.
That means the shift needs to be a multiple of 8. Start actually
checking this so that a client cannot trip us up and possibly cause
incorrect code exection.

Issue found by Pavel Cheremushkin from Kaspersky Lab.
2020-09-21 12:56:53 +03:00
ae6cbd19e9 Be defensive about overflows in stream objects
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.
2020-09-21 12:56:23 +03:00
259f1055cb Use size_t for lengths in stream objects
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.
2020-09-21 12:55:59 +03:00
346fccb96c Remove unused FixedMemOutStream 2020-09-21 12:48:20 +03:00