Commit Graph

31 Commits

Author SHA1 Message Date
Markus Beth
53ba87dc17 use correct modulus and exponent in rdssl_rkey_get_exp_mod 2019-12-02 11:22:13 +01: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
df94870c91 Remove unused variables and functions 2019-04-12 14:37:24 +02:00
Markus Beth
b02996136b Fix memory leak
Variables of type mpz_t must be cleared with mpz_clear().
2019-02-05 22:48:48 +01:00
Markus Beth
35d8c932ab Fix memory leaks on certificate handling
Certificates initialized with gnutls_x509_crt_init() must be freed with
gnutls_x509_crt_deinit().
Memory allocated with malloc() should be freed with free() not
gnutls_free().
2019-02-05 22:34:10 +01:00
Henrik Andersson
bc3a5789e4 Cleanup unused leftovers from commit 3191c341b9 2019-01-29 10:38:14 +01:00
Henrik Andersson
78a9dcff68 Refactor of public key cert check
Reafctored public key check from libtasn_read_cert_pk_parameters()
into its own function libtasn_cert_pk_oid(). The make use of it
instead of gnutls_x509_crt_get_pk_oid().
2019-01-29 10:38:14 +01:00
Alexander Zakharov
90fd660803 Parse X.509 certificate, get RSA public key, RSA encrypt
Also add support older (< 3.5.0) GnuTLS versions
2019-01-29 10:38:13 +01:00
Alexander Zakharov
00d9e0c4c8 Replace HMAC_MD5, SHA1, RC4, MD5 with Nettle's counterparts 2019-01-29 10:38:13 +01:00
René Genz
9e99dd52d6 Fix minor spelling mistakes 2017-11-02 01:01:44 +01:00
Henrik Andersson
896a923f55 Markup unused parameters 2017-10-20 11:05:52 +02:00
Henrik Andersson
267db2ceff Fix compile warnings about unused variables 2017-10-17 10:32:40 +02:00
Henrik Andersson
b25f93c0e6 Run indentation script 2017-08-15 10:50:08 +02:00
Alexander Zakharov
a3dfceefc2 Workaround for key caching in OpenSSL > 1.1.0
Since v.1.1.0 the key caching has been added to OpenSSL.
After X.509 had been parsed there is no point in changing of key
algorithm as the key had already been decoded and cached result will
be returned anyway. (check crypto/x509/x_pubkey.c: X509_PUBKEY_get0())
2017-06-21 15:38:58 +03:00
Henrik Andersson
5b7b955487 Fix typo in log 2017-05-15 06:13:13 +02:00
Henrik Andersson
908ad64d84 Add additional logging for SSL errors
This was added to provide more information when things fails
as in  issue #118.
2017-05-12 13:15:45 +02:00
Henrik Andersson
87d8d123b8 Rework the logging system
This commit will add a logging system to solve the problem that
one actually need to recompile rdesktop from source to enable
different debug logging.

- Same logging api  for all kind of logging and messages to
   end user.

- Adding -v for verbose output when running rdesktop.

- All messages are logged into a subject and with a type, eg:

     logger(Keyboard, Notice, "Autos-electing %s based on locale.", locale);

- Debug logging is enabled trough a environment variable RDEKSTOP_DEBUG,
  which specifies subjects of interest, comma separated. There is a special
  subject named All which includes all subject for debug loggin. There is also
  a simple logic opeartor '!' = NOT which can be used in combination like:

    RDESKTOP_DEBUG=All,!Graphics,!Sound

  Which would give debug log output for All subject except Graphics and Sound.
2017-01-26 14:19:40 +01:00
Henrik Andersson
71bf45a5d7 Ran indent-all script 2017-01-25 00:34:37 +01:00
Henrik Andersson
c6e8e1074b Fix crash in rdssl_cert_to_rkey.
This crash was introduced by merging OpenSSL 1.1 PR done on
commit 50b39d11. Where algor was overwritten with return value
of X509_PUBKEY_get0_param(). I also added additional error
handling for X509_get_X509_PUBKEY.

Thanks to TingPing that found this error in PR.
2016-10-24 10:24:35 +02:00
Jani Hakala
bd6aa6acdd Fix OpenSSL 1.1 compability issues
Some data types have been made opaque in OpenSSL version 1.1 so
stack allocation and accessing struct fields directly does not work.
2016-06-16 15:11:28 +03:00
Peter Åstrand
5cb7910413 Indented with indent-all.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1670 423420c4-83ab-492f-b58f-81f9feb106b5
2012-10-23 11:38:27 +00:00
Henrik Andersson
0f5824d414 Rename of internal ssl_ wrapper functions/defines to
rdssl_ to prevent nameclashing with openssl library now
when we link against ssl library.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1665 423420c4-83ab-492f-b58f-81f9feb106b5
2012-07-02 11:36:39 +00:00
Peter Åstrand
b638882347 Include emails in copyright statements.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1615 423420c4-83ab-492f-b58f-81f9feb106b5
2011-04-13 11:13:04 +00:00
Michael Gernoth
1f07b252ad newer openssl versions use EVP_PKEY_get1_RSA for accessing the public
key and do not like direct access to epk->pkey.ptr


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1601 423420c4-83ab-492f-b58f-81f9feb106b5
2010-11-12 16:05:59 +00:00
Peter Åstrand
1b4c36a45f Implemented support for "Client Auto-Reconnect". This means that the
client can re-connect using a cookie, instead of going through the
normal authentication. This patch saves those cookies, and uses them
during logon. 

Note that this feature is currently unused. It remains to add support
for, say, detecting when the TCP connection has gone done and restart
a new one. 



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1539 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-12 10:34:38 +00:00
Peter Åstrand
281d7c9f06 Changed license to GPLv3
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1534 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-12 08:31:06 +00:00
Jay Sorg
88855ddcbf update the copyright year
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1474 423420c4-83ab-492f-b58f-81f9feb106b5
2008-07-11 03:51:23 +00:00
Matt Chapman
71e90d1f56 Fix for Windows 2008 Server (see Patch #1744033)
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1467 423420c4-83ab-492f-b58f-81f9feb106b5
2008-04-05 07:37:02 +00:00
Jay Sorg
d9ddd1af1a remove g++ warnings
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1392 423420c4-83ab-492f-b58f-81f9feb106b5
2007-02-10 07:08:23 +00:00
Jay Sorg
3067b9fc6a ran indent-all.sh
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1376 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-11 03:30:18 +00:00
Jay Sorg
e486d11511 moved all openssl calls to one file
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1373 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-09 07:24:44 +00:00