diff -ur vnc-4_1_1/common/rfb/SConnection.cxx vnc_4_1_2/common/rfb/SConnection.cxx --- vnc-4_1_1/common/rfb/SConnection.cxx Fri Mar 11 23:31:50 2005 +++ vnc_4_1_2/common/rfb/SConnection.cxx Tue May 16 02:04:58 2006 @@ -178,6 +178,16 @@ { vlog.debug("processing security type message"); int secType = is->readU8(); + + // Verify that the requested security type should be offered + std::list secTypes; + std::list::iterator i; + securityFactory->getSecTypes(&secTypes, reverseConnection); + for (i=secTypes.begin(); i!=secTypes.end(); i++) + if (*i == secType) break; + if (i == secTypes.end()) + throw Exception("Requested security type not available"); + vlog.info("Client requests security type %s(%d)", secTypeName(secType),secType);