Commit Graph

2019 Commits

Author SHA1 Message Date
dbac3db7b7 Fourth Batch: Update files using ChatGPT 4o 2024-05-31 16:42:49 +02:00
867c553378 Third Batch: Update files using ChatGPT 4o 2024-05-31 16:19:45 +02:00
669e3a9e11 Second Batch: Update files using ChatGPT 4o 2024-05-31 15:52:13 +02:00
1fb029cde7 Initial push with a few changes 2024-05-31 15:27:02 +02:00
Bruno Moreira-Guedes
4716f1e016 Format changes in GH issue templates
Improved capitalization of template names
2021-12-30 05:23:18 -03:00
Bruno Moreira-Guedes
da36432c31 Asking for help template
A template to collect proper information about an issue requesting for help. It also suggests to the user to try reading the documentation first.
2021-12-30 05:20:26 -03:00
Bruno Moreira-Guedes
3986164464 Feature Suggestion Template
Added template to help the users to think deep about their feature requests
2021-12-30 05:10:26 -03:00
Bruno Moreira-Guedes
134262fc03 Bug report template
A template for an objective bug report with basic information and reproduction steps
2021-12-30 04:35:32 -03:00
wojciech.kepka
1620a263bf Fix typo in warning message in utils.c 2020-02-06 14:56:26 +01:00
Markus Beth
53ba87dc17 use correct modulus and exponent in rdssl_rkey_get_exp_mod 2019-12-02 11:22:13 +01:00
Pierre Ossman
50f607ee61 Update version to 1.9.0 2019-09-20 09:03:48 +02:00
Pierre Ossman
5ce283806c Restore leniance in certificate key usage violations
It was removed in 256d8e2 because the purpose was unclear. It turns
out that the automatically generated self signed certificates will
have Key Encipherment and Data Encipherment set as key usage, but
the required ones are Digital Signature and Key Encipherment. A
proper certificate generally doesn't have this issue, but connecting
to stand alone machines without a proper certificate is common.

Unfortunately the %COMPAT flag is the only thing that makes GnuTLS
tolerate this bug, but that flag also allows a lot of other protocol
violations.
2019-09-20 09:00:04 +02:00
Pierre Ossman
fdb2da450a Fix initial security handshake for old systems
The conversion from OpenSSL to GnuTLS (or GMP in this case) got
the endianness mixed up in the initial security handshake. It got
it wrong in two places though, which cancelled each other out when
X.509 certificates are used. But servers using the older system,
like Windows XP, would fail the handshake as different endianness
was then used when reading the RSA key and when using it.
2019-09-20 08:36:10 +02:00
Pierre Ossman
a646a5cce2 Be tolerant of cropped TS_SHARECONTROLHEADER
Old versions of Windows (e.g. XP) sends a cropped packet in some
cases. It still contains all the important parts, so let's be
tolerant of this misbehaviour.
2019-09-19 09:18:42 +02:00
Pierre Ossman
75215ad90b Update ChangeLog from 1.8.x branch 2019-09-18 10:44:18 +02:00
Pierre Ossman
256d8e2b3c Respect TLS version argument
The code handling it was lost in the switch from OpenSSL to GnuTLS.
Restore the functionality in the new code.
2019-09-16 09:24:49 +02:00
Pierre Ossman
9f14da3eb2 Revert "Always prompt for password if not provided via commandline."
This reverts commit 1aaafc80c0.

This change has caused a lot of issues, so we need to pause this for
now and figure out a way to make the transition smoother.
2019-09-03 16:07:58 +02:00
Pierre Ossman
1475092762 Avoid nesting stream macros
It only works by luck here, so avoid this style as bugs easily happen.
2019-06-13 14:23:02 +02:00
Markus Beth
5c900521f3 sec_decrypt() the correct amount of data
Save the correct amount of data to sec_decrypt() because after
inout_uint8p() the macro s_remaining(s) will find nothing left.
2019-06-13 14:12:25 +02:00
Pierre Ossman
6028c999ba Allow TLS to continue without system database
It will mean manual confirmation for users, but that is probably
better than outright refusal.
2019-06-04 16:53:13 +02:00
Pierre Ossman
e7bc37918c Don't use assert() for error handling
It is excessively harsh in its output, and it can be completely
compiled out which will give an incorrect behaviour.
2019-06-04 16:51:30 +02:00
Pierre Ossman
aa5164ede4 Fix protocol code handling new licenses
s_seek() is a macro, so it is dangerous to use complex expressions
in it as they may be evaluated multiple times and at incorrect times.
In this case we ended up trying to jump to an incorrect offset.
Work around this by having a dedicated variable for the target offset.
2019-05-21 12:58:47 +02:00
Pierre Ossman
a88cd226bb Merge branch 'secfix' of https://github.com/CendioOssman/rdesktop 2019-05-08 13:55:46 +02:00
Pierre Ossman
a33814c478 Add comments for STREAM macros
Add some short descriptions that should hopefully make it easier
to understand what all these macros do.
2019-05-06 14:33:38 +02:00
Pierre Ossman
77758c3c18 Handle empty unicode strings from server 2019-05-06 14:33:38 +02:00
Pierre Ossman
f19c21d7d1 Fix memory leak in disk redirection
We kept allocating a data buffer for this stream in each call,
but never freeing it.
2019-05-06 14:33:38 +02:00
Pierre Ossman
25b8412333 Avoid poking around in STREAM internals
It's easy to make mistakes this way, and bypassed the normal bounds
checking. So make sure we always use macros or functions.
2019-05-06 14:33:38 +02:00
Pierre Ossman
489c43f382 Return STREAM objects from data generating functions
Use a consistent style of returning a new STREAM object from functions
that output data, rather than requiring an existing structure to be
passed in. This generally makes the memory management more straight
forward and allows us to do more proper bounds checking of everything.

This also adds some new STREAM macros to make it easier to manage
them without poking around in the internal structure.
2019-05-06 14:33:11 +02:00
Pierre Ossman
655c3d56df Clean up channel chunk sending code
Make sure the buffer handling is a bit more sane so we can verify
offsets and boundaries. Also adds some more helper macros to shuffle
data between two different STREAM instead of trying to poke around
in the internals.
2019-05-06 14:33:05 +02:00
Pierre Ossman
c6d8b933c8 Avoid preallocated streams in tcp.c
We don't know when the caller might be done with a stream, so we
can end up with code overwriting things in a stream that is in use
elsewhere.

Solve the issue by returning a new stream each time and leave it
up to the callers to free it.
2019-05-06 14:33:05 +02:00
Pierre Ossman
75221eb3c5 Separate behaviour of out_uint8a and out_uint8p
Make them more match in_uint8a and in_uint8p in that one copies and
the other just gives you a pointer and it is up to the caller how
to fill it in. This can be useful when other APIs are used to
generate the data as it avoids a temporary buffer.
2019-05-06 14:33:05 +02:00
Pierre Ossman
6268b44f06 Add macro to check remaining length of STREAM
Avoids poking around in the internals, and also makes the code
easier to read.
2019-05-06 14:33:05 +02:00
Pierre Ossman
3e340f2f20 Add explicit STREAM allocation function
Avoids mistakes by making sure everyone allocates these the same
way.

The smart card code still has manual allocation because it has it's
own magical memory management.
2019-05-06 14:33:05 +02:00
Pierre Ossman
dd0217f372 Remove in_skip() in favour of in_uint8s()
It was barely used and it was confusing having two macros doing the
same thing. Standardise on the more common variant.
2019-05-06 14:33:05 +02:00
Pierre Ossman
90219aac41 Add bounds checks to stream handling
Protect against buffer overflow and overrun bugs in the protocol
handling.
2019-05-06 14:33:05 +02:00
Pierre Ossman
e099d79879 Remove dangerous s_check()
This macro checks if a pointer is valid _after_ we've already used
that pointer. So it will only trigger if we're already performed some
for of buffer overflow. As such, it provides little to no value and
can only server to encourage broken behaviour.

Let's remove it and replace it with proper bounds checking before
access instead.
2019-05-06 14:33:05 +02:00
Pierre Ossman
de59a100ea Mark rd_protocol_error() as "noreturn"
This allows the compiler to optimize things better and give better
warnings as it knows it will never return from this function.
2019-05-06 14:33:05 +02:00
Pierre Ossman
e1537061bf Fix packet debug output in rdp_protocol_error()
We're trying to print the entire packet, not just what's left.
2019-05-06 13:30:13 +02:00
Pierre Ossman
d8b0f3782a Give source code info in rdp_protocol_error()
Makes it easier to debug things by seeing exactly where the protocol
handling crashed.
2019-05-06 13:29:44 +02:00
Pierre Ossman
092fc20921 Use STRNCPY() macro in smart card code
The previous code did not do a proper bounds check and could result
in buffer overflows and unterminated strings if long names were
specified.
2019-05-06 13:28:31 +02:00
Pierre Ossman
f0cab337ea Merge branch 'set-version-to-1.8.99' of https://github.com/paulmenzel/rdesktop 2019-04-18 10:21:43 +02:00
Paul Menzel
8ea3fab052 Set master version to 1.8.99 to be greater than 1.8.x versions
Currently, the version number of releases made from the branch 1.8.x are
greater than the version in the master branch (1.8.3post).

That makes life a little harder for packages wanting to package the code
from the master branch.

So, set the version to 1.8.99, ensuring with a high probability, that
the version will be greater than all 1.8.x releases.

Fixes: https://github.com/rdesktop/rdesktop/issues/325
2019-04-12 16:52:48 +02:00
Pierre Ossman
48b184477e Fix bad call to strncat() 2019-04-12 14:37:24 +02:00
Pierre Ossman
cf95138c9b Don't use strncpy() when not needed
It upsets the compiler warnings when you do strncpy() with the
source buffer size as the limit. It is also unnecessary to use
strncpy() here as we just allocated a buffer guaranteed to be
large enough.
2019-04-12 14:37:24 +02:00
Pierre Ossman
df94870c91 Remove unused variables and functions 2019-04-12 14:37:24 +02:00
Pierre Ossman
836e008853 Fix fast path stream array
There are 16 possible codes, not 15.

(even if we currently don't know what to do with the last code)
2019-04-12 14:37:24 +02:00
Markus Beth
dc7ee56de4 support status flags of newer GnuTLS
Support status flags of newer GnuTLS in _utils_cert_get_status_report
with the appropriate GnuTLS version guards.

This code (without the version guards) was already part of the GnuTLS
branch and was removed in 9acb0cca. I think it is helpful to add it
again to get better error hints on certificate problems when using a
newer GnuTLS.
2019-04-07 22:45:32 +02:00
Pierre Ossman
a4bdfcfe76 Don't check certificate purpose on older GnuTLS
The feature was added in 3.6.0, so avoid compilation errors if
building with an older GnuTLS.
2019-03-01 11:17:40 +01:00
Alexander Zakharov
49caf6e7c3
Merge pull request #313 from markusbeth/fix_format_strings
fix "Too few arguments to formatting function"
2019-02-08 09:27:58 +03:00
Markus Beth
e7fb28f28e fix "Too few arguments to formatting function" 2019-02-07 23:52:24 +01:00