void rfbAuthTLSHandshake(rfbClientPtr cl)
{
  int ret;

  if ((ret = rfbssl_accept(cl)) < 0) {
    rfbCloseClient(cl);
    return;
  } else if (ret == 1)
    return;

  switch (cl->selectedAuthType) {
    case rfbAuthNone:
      rfbClientAuthSucceeded(cl, rfbAuthNone);
      break;
    case rfbAuthVNC:
      rfbVncAuthSendChallenge(cl);
      break;
#ifdef XVNC_AuthPAM
    case rfbAuthUnixLogin:
      AuthPAMUserPwdRspFunc(cl);
      break;
#endif
  }
}
void rfbAuthTLSHandshake(rfbClientPtr cl)
{
  int ret;

  if ((ret = rfbssl_accept(cl)) < 0) {
    rfbCloseClient(cl);
    return;
  } else if (ret == 1)
    return;

  switch (cl->selectedAuthType) {
    case rfbAuthNone:
      rfbClientAuthSucceeded(cl, rfbAuthNone);
      break;
    case rfbAuthVNC:
      rfbVncAuthSendChallenge(cl);
      break;
#ifdef XVNC_AuthPAM
    case rfbAuthUnixLogin:
      AuthPAMUserPwdRspFunc(cl);
      break;
#endif
  }
}