Ejemplo n.º 1
0
void RfbInitializer::doTightAuth()
{
  m_output->writeUInt32(0);
  if (Configurator::getInstance()->getServerConfig()->isUsingAuthentication()
      && m_authAllowed) {
    CapContainer authInfo;
    authInfo.addCap(AuthDefs::VNC, VendorDefs::STANDARD, AuthDefs::SIG_VNC);
    m_output->writeUInt32(authInfo.getCapCount());
    authInfo.sendCaps(m_output);
    UINT32 clientAuthValue = m_input->readUInt32();
    if (!authInfo.includes(clientAuthValue)) {
      throw Exception(_T(""));
    }
    doAuth(clientAuthValue);
  } else {
    m_output->writeUInt32(0);
    doAuth(AuthDefs::NONE);
  }
}
Ejemplo n.º 2
0
void RfbInitializer::doTightAuth()
{
  // Negotiate tunneling.
  m_output->writeUInt32(0);
  // Negotiate authentication.
  // FIXME: Recognize authentication types.
  if (Configurator::getInstance()->getServerConfig()->isUsingAuthentication()
      && m_authAllowed) {
    CapContainer authInfo;
    authInfo.addCap(AuthDefs::VNC, VendorDefs::STANDARD, AuthDefs::SIG_VNC);
    m_output->writeUInt32(authInfo.getCapCount());
    authInfo.sendCaps(m_output);
    // Read the security type selected by the client.
    UINT32 clientAuthValue = m_input->readUInt32();
    if (!authInfo.includes(clientAuthValue)) {
      throw Exception(_T(""));
    }
    doAuth(clientAuthValue);
  } else {
    m_output->writeUInt32(0);
    doAuth(AuthDefs::NONE);
  }
}