]> source.dussan.org Git - tigervnc.git/commitdiff
Fix saving of bad server certificates
authorPierre Ossman <ossman@cendio.se>
Mon, 30 Dec 2019 09:24:11 +0000 (10:24 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 30 Dec 2019 09:24:11 +0000 (10:24 +0100)
This check is completely backwards and it is currently unknown how
this ever worked.

common/rfb/CSecurityTLS.cxx

index aa19109095ceebc4c40493a3df035dba6853971d..c1a00212a3dfeb29e4931dd2be55cb5b2081c72d 100644 (file)
@@ -416,8 +416,9 @@ void CSecurityTLS::checkSession()
   delete [] certinfo;
 
   if (gnutls_x509_crt_export(crt, GNUTLS_X509_FMT_PEM, NULL, &out_size)
-      == GNUTLS_E_SHORT_MEMORY_BUFFER)
-    throw AuthFailureException("Out of memory");
+      != GNUTLS_E_SHORT_MEMORY_BUFFER)
+    throw AuthFailureException("certificate issuer unknown, and certificate "
+                               "export failed");
 
   // Save cert
   out_buf =  new char[out_size];