Pierre Ossman
37f3a8b47f
Don't fail on user CA/CRL problems
The certificates might still be fine using the system trust store, or
the user can make an exception. So let's just log and continue on.
This got very common after 960c7d2
where we now always have a default
value for these settings.
před 2 roky
Tyson Whitehead
d32ff1c960
System certificate load returns number loaded not GNUTLS_E_SUCCESS
před 2 roky
Jan Grulich
7f1e1e370e
Fix priority string when using newer GnuTLS
The call of gnutls_set_default_priority_append() expects a normal priority
string, which means it must not start with ':'.
před 2 roky
Jan Grulich
9b96266830
Utilize system-wide crypto policies
před 2 roky
Pierre Ossman
960c7d2ff3
Clean up default value for X509 parameters
Let's avoid making this too complex and force every user to know about
magical functions.
před 3 roky
Pierre Ossman
e779322f05
Don't wait for TLS close response
Our current architecture doesn't support waiting for a response here, so
don't even try or we'll just get an error.
před 3 roky
Pierre Ossman
14d21d7b44
Handle GnuTLS shutdown on dead session
The session might have died, or failed to initialise properly, so be
prepared for gnutls_bye() to be unable to do its job.
před 3 roky
Pierre Ossman
b30f10c681
Properly store certificate exceptions
The previous method stored the certificates as authorities, meaning that
the owner of that certificate could impersonate any server it wanted
after a client had added an exception.
Handle this more properly by only storing exceptions for specific
hostname/certificate combinations, the same way browsers or SSH does
things.
před 4 roky
Pierre Ossman
ad0f0618fa
Change streams to be asynchronous
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).
před 4 roky
Pierre Ossman
5f09e7c662
Don't read invalid TLS auth reason
The specification only states a single result byte and not any reason
after a TLS authentication failure.
před 4 roky
Pierre Ossman
6208f47dcb
Remove unneeded memory checks
new throws an exception on allocation errors rather than return NULL.
před 4 roky
Pierre Ossman
dbad687182
Fix saving of bad server certificates
This check is completely backwards and it is currently unknown how
this ever worked.
před 4 roky
Pierre Ossman
78bdd1700c
Add missing throws for exception
It is not enough to create an exception object, you need to throw
it as well.
před 5 roky
Pierre Ossman
52a2e6520a
Remove unused include
We should not be including server headers from client code. It was
not even needed, so simply remove it.
před 6 roky
Pierre Ossman
83eee75c26
Log TLS handshake result
Makes it easier to debug TLS issues, and to see the effect of
altering the priority string.
před 5 roky
Jan Grulich
8105be9f31
Do not duplicate default string twice
před 5 roky
Pierre Ossman
06c1199c0a
Restore original streams when terminating TLS
In theory we could return to communicate without TLS after a
shutdown. It also makes sure the connection object isn't left
completely without streams.
před 5 roky
Pierre Ossman
1b7463478e
Delete TLS streams before deleting the session
The streams depend on the session and can crash the program if they
are removed in the wrong order. Do a general cleanup of the life time
management of the streams.
před 5 roky
Pierre Ossman
ad2b3c4aa3
Strongly bind security objects to connection object
There is already an implicit connection between them, so let's make
it explicit. This allows easy lookup outside of the processMsg() function.
před 5 roky
Pierre Ossman
50aaed49b6
Initialise CSecurityTLS::cert_cred properly
If we leave it at something random we'll get an invalid delete
if the handshake fails.
před 5 roky
Pierre Ossman
c04f756bd2
Use system certificate trust store
Makes it possible to use certificates from all popular CAs with
TigerVNC.
před 5 roky
Pierre Ossman
19225507cc
Make exception classes have clearer messages
Include the type of exception in the string generated by each
subclass. Also simplify the constructs to what is needed.
před 6 roky
Pierre Ossman
894f2c5197
Include server name in TLS handshake for SNI
In case the server is a front-end to multiple systems and needs to
know which system we're after.
před 6 roky
Pierre Ossman
e43e5e3051
Add better error message for insecure certificate algorithms
před 6 roky
Pierre Ossman
8aa4bc5320
Proper global init/deinit of GnuTLS
These are reference counted so it is important to retain symmetry
between the calls. Failure to do so will result in bad memory access
and crashes.
před 7 roky
Pierre Ossman
27eb55e197
Add parameter to override GnuTLS priority
před 9 roky
Pierre Ossman
88c24edd8f
Raise GnuTLS requirements to 3.x
This allows us to simplify things by getting rid of some old
compatibility code. People should really be using current versions
of GnuTLS anyway to stay secure.
před 9 roky
Pierre Ossman
800a35ccdd
Remove verbose TLS logging
We don't even log this much for RFB protocol stuff, and it makes
it very annoying to run with full debugging on.
před 9 roky
Pierre Ossman
3d2a84b9ea
Correct naming convention for some parameters
před 9 roky
Pierre Ossman
5ad4d06006
Remove a lot of platform compatibilty stuff
It's either not used, or no longer relevant.
před 10 roky
Pierre Ossman
fe48cd4d24
Refactor the TLS code so that the push/pull functions are aware of their
containing stream object. This is in preparation for supporting GnuTLS 3.x.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4921 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 12 roky
Pierre Ossman
ad8609a2ed
Fix unsafe usage of the logging functions.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4905 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 12 roky
Adam Tkac
ce6c8b097f
[Security] vncviewer can send password without proper validation of X.509 certs
(CVE-2011-1775).
Reference: http://www.mail-archive.com/tigervnc-devel@lists.sourceforge.net/msg01342.html
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4401 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
348269d30b
[Bugfix] Register GNUTLS debug routines only when we actually need them.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4295 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
b486423692
[Bugfix] Improve compatibility with ancient GNUTLS implementations even more.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4278 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
68481c19eb
[Development] os: add gnutls_x509_crt_print() implementation, older systems
don't have it and improve backward compatibility of TLS code.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4277 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
e32573a56b
[Bugfix] client: improve server certificate verification code.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4276 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
44cdb1352a
[Bugfix] Call gnutls_bye only when handshake is completed.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4275 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
DRC
32020bf720
Oops. Checked in some debugging code.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4272 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
DRC
b7ab54f0df
Oops. Need to wait until after gnutls.h is included before checking the value of GNUTLS_VERSION_NUMBER
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4266 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
DRC
ff1e1ff941
Attempt to restore compatibility with older GnuTLS versions
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4264 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
f16a421570
[Bugfix] Print empty string by default when paths for X.509 certs don't exist.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4256 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
437b0c2fc3
[Bugfix] Append ".pem" suffix to saved certificates.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4254 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
af0817220e
[Development] Rename function "gethomedir" to "getvnchomedir" and rewrite it in
platform-intependent manner.
Thanks to Guillaume Destuynder.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4252 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
179d2b14ec
[Bugfix] CSecurityTLS.cxx: include os/print.h to get correct snprintf definition.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4240 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
c4674db3bd
[Bugfix] Don't include unistd.h and don't call access() on Windows.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4239 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
5d4c6acf92
[Bugfix] Use free() instead of gnutls_free() on Windows.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4238 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
27b2f773be
[Development] client: Add dialog window to accept/save invalid X509
certificates. (Guillaume Destuynder)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4198 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 13 roky
Adam Tkac
6948ead152
[Bugfix] Check return codes from gnutls library every time.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4120 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 14 roky
Adam Tkac
3c5be39e92
[Development] Rename CSecurityTLSBase class to CSecurityTLS.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4110 3789f03b-4d11-0410-bbf8-ca57d06f2519
před 14 roky