diff options
author | Adam Tkac <atkac@redhat.com> | 2011-02-09 14:09:10 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2011-02-09 14:09:10 +0000 |
commit | 44cdb1352a8f246f1898cf458dba6f75c3ba4d37 (patch) | |
tree | 5cb9fd530a9f8ef61b89c5fae174efa2437e0d9d /common | |
parent | 61b630a98cb1a21448f0db17dea3f02dcd669ad2 (diff) | |
download | tigervnc-44cdb1352a8f246f1898cf458dba6f75c3ba4d37.tar.gz tigervnc-44cdb1352a8f246f1898cf458dba6f75c3ba4d37.zip |
[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
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/CSecurityTLS.cxx | 10 | ||||
-rw-r--r-- | common/rfb/CSecurityTLS.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx index ed570ad4..c22fa2d9 100644 --- a/common/rfb/CSecurityTLS.cxx +++ b/common/rfb/CSecurityTLS.cxx @@ -116,11 +116,11 @@ void CSecurityTLS::setDefaults() x509crl.setDefaultStr(strdup(crlDefault.buf)); } -void CSecurityTLS::shutdown() +void CSecurityTLS::shutdown(bool needbye) { - if (session) + if (session && needbye) if (gnutls_bye(session, GNUTLS_SHUT_RDWR) != GNUTLS_E_SUCCESS) - throw Exception("gnutls_bye failed"); + vlog.error("gnutls_bye failed"); if (anon_cred) { gnutls_anon_free_client_credentials(anon_cred); @@ -143,7 +143,7 @@ void CSecurityTLS::shutdown() CSecurityTLS::~CSecurityTLS() { - shutdown(); + shutdown(true); if (fis) delete fis; @@ -191,7 +191,7 @@ bool CSecurityTLS::processMsg(CConnection* cc) if (err != GNUTLS_E_SUCCESS) { vlog.error("TLS Handshake failed: %s\n", gnutls_strerror (err)); - shutdown(); + shutdown(false); throw AuthFailureException("TLS Handshake failed"); } diff --git a/common/rfb/CSecurityTLS.h b/common/rfb/CSecurityTLS.h index bd6297d7..c19307e7 100644 --- a/common/rfb/CSecurityTLS.h +++ b/common/rfb/CSecurityTLS.h @@ -55,7 +55,7 @@ namespace rfb { static UserMsgBox *msg; protected: - void shutdown(); + void shutdown(bool needbye); void freeResources(); void setParam(); void checkSession(); |