瀏覽代碼

[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
tags/v1.0.90
Adam Tkac 13 年之前
父節點
當前提交
44cdb1352a
共有 2 個檔案被更改,包括 6 行新增6 行删除
  1. 5
    5
      common/rfb/CSecurityTLS.cxx
  2. 1
    1
      common/rfb/CSecurityTLS.h

+ 5
- 5
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");
}


+ 1
- 1
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();

Loading…
取消
儲存