[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
diff --git a/common/rfb/SSecurityTLS.cxx b/common/rfb/SSecurityTLS.cxx
index a268a51..e6202a8 100644
--- a/common/rfb/SSecurityTLS.cxx
+++ b/common/rfb/SSecurityTLS.cxx
@@ -183,7 +183,9 @@
static const int kx_priority[] = { GNUTLS_KX_DHE_DSS, GNUTLS_KX_RSA,
GNUTLS_KX_DHE_RSA, GNUTLS_KX_SRP, 0 };
- gnutls_kx_set_priority(session, anon ? kx_anon_priority : kx_priority);
+ if (gnutls_kx_set_priority(session, anon ? kx_anon_priority : kx_priority)
+ != GNUTLS_E_SUCCESS)
+ throw AuthFailureException("gnutls_kx_set_priority failed");
if (gnutls_dh_params_init(&dh_params) != GNUTLS_E_SUCCESS)
throw AuthFailureException("gnutls_dh_params_init failed");