File U_include-vencrypt-only-if-any-subtype-present.patch of Package tigervnc.openSUSE_Leap_42.1_Update

Index: common/rfb/Security.cxx
===================================================================
--- common/rfb/Security.cxx	(revision 5186)
+++ common/rfb/Security.cxx	(working copy)
@@ -71,10 +71,15 @@
   list<rdr::U8> result;
   list<U32>::iterator i;
 
-  result.push_back(secTypeVeNCrypt);
+  bool VeNCryptPresent = false;
   for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++)
-    if (*i < 0x100)
+    if (*i < 0x100) {
       result.push_back(*i);
+    } else {
+      if(!VeNCryptPresent)
+        result.push_back(secTypeVeNCrypt);
+      VeNCryptPresent = true;
+    }
 
   return result;
 }
openSUSE Build Service is sponsored by