static void start_auth_vencrypt_subauth(VncState *vs)

{

    switch (vs->subauth) {

    case VNC_AUTH_VENCRYPT_TLSNONE:

    case VNC_AUTH_VENCRYPT_X509NONE:

       VNC_DEBUG("Accept TLS auth none\n");

       vnc_write_u32(vs, 0); /* Accept auth completion */

       start_client_init(vs);

       break;



    case VNC_AUTH_VENCRYPT_TLSVNC:

    case VNC_AUTH_VENCRYPT_X509VNC:

       VNC_DEBUG("Start TLS auth VNC\n");

       start_auth_vnc(vs);

       break;



#ifdef CONFIG_VNC_SASL

    case VNC_AUTH_VENCRYPT_TLSSASL:

    case VNC_AUTH_VENCRYPT_X509SASL:

      VNC_DEBUG("Start TLS auth SASL\n");

      start_auth_sasl(vs);

      break;

#endif /* CONFIG_VNC_SASL */



    default: /* Should not be possible, but just in case */

       VNC_DEBUG("Reject subauth %d server bug\n", vs->auth);

       vnc_write_u8(vs, 1);

       if (vs->minor >= 8) {

           static const char err[] = "Unsupported authentication type";

           vnc_write_u32(vs, sizeof(err));

           vnc_write(vs, err, sizeof(err));

       }

       vnc_client_error(vs);

    }

}

static void start_auth_vencrypt_subauth(VncState *vs)

{

    switch (vs->subauth) {

    case VNC_AUTH_VENCRYPT_TLSNONE:

    case VNC_AUTH_VENCRYPT_X509NONE:

       VNC_DEBUG("Accept TLS auth none\n");

       vnc_write_u32(vs, 0); 

       start_client_init(vs);

       break;



    case VNC_AUTH_VENCRYPT_TLSVNC:

    case VNC_AUTH_VENCRYPT_X509VNC:

       VNC_DEBUG("Start TLS auth VNC\n");

       start_auth_vnc(vs);

       break;



#ifdef CONFIG_VNC_SASL

    case VNC_AUTH_VENCRYPT_TLSSASL:

    case VNC_AUTH_VENCRYPT_X509SASL:

      VNC_DEBUG("Start TLS auth SASL\n");

      start_auth_sasl(vs);

      break;

#endif 



    default: 

       VNC_DEBUG("Reject subauth %d server bug\n", vs->auth);

       vnc_write_u8(vs, 1);

       if (vs->minor >= 8) {

           static const char err[] = "Unsupported authentication type";

           vnc_write_u32(vs, sizeof(err));

           vnc_write(vs, err, sizeof(err));

       }

       vnc_client_error(vs);

    }

}

       VNC_DEBUG("Accept TLS auth none\n");        VNC_DEBUG("Start TLS auth VNC\n");       VNC_DEBUG("Start TLS auth SASL\n");        VNC_DEBUG("Reject subauth %d server bug\n", vs->auth);
static void FUNC_0(VncState *VAR_0)

{

    switch (VAR_0->subauth) {

    case VNC_AUTH_VENCRYPT_TLSNONE:

    case VNC_AUTH_VENCRYPT_X509NONE:

       VNC_DEBUG("Accept TLS auth none\n");

       vnc_write_u32(VAR_0, 0); 

       start_client_init(VAR_0);

       break;



    case VNC_AUTH_VENCRYPT_TLSVNC:

    case VNC_AUTH_VENCRYPT_X509VNC:

       VNC_DEBUG("Start TLS auth VNC\n");

       start_auth_vnc(VAR_0);

       break;



#ifdef CONFIG_VNC_SASL

    case VNC_AUTH_VENCRYPT_TLSSASL:

    case VNC_AUTH_VENCRYPT_X509SASL:

      VNC_DEBUG("Start TLS auth SASL\n");

      start_auth_sasl(VAR_0);

      break;

#endif 



    default: 

       VNC_DEBUG("Reject subauth %d server bug\n", VAR_0->auth);

       vnc_write_u8(VAR_0, 1);

       if (VAR_0->minor >= 8) {

           static const char VAR_1[] = "Unsupported authentication type";

           vnc_write_u32(VAR_0, sizeof(VAR_1));

           vnc_write(VAR_0, VAR_1, sizeof(VAR_1));

       }

       vnc_client_error(VAR_0);

    }

}

static void FUNC_0(VncState *VAR_0)
{ switch (VAR_0->subauth) { case VNC_AUTH_VENCRYPT_TLSNONE:
case VNC_AUTH_VENCRYPT_X509NONE:
VNC_DEBUG("Accept TLS auth none\n"); vnc_write_u32(VAR_0, 0); start_client_init(VAR_0); break; case VNC_AUTH_VENCRYPT_TLSVNC:
case VNC_AUTH_VENCRYPT_X509VNC:
VNC_DEBUG("Start TLS auth VNC\n"); start_auth_vnc(VAR_0); break; #ifdef CONFIG_VNC_SASL
case VNC_AUTH_VENCRYPT_TLSSASL:
case VNC_AUTH_VENCRYPT_X509SASL:
VNC_DEBUG("Start TLS auth SASL\n"); start_auth_sasl(VAR_0); break; #endif
default:
VNC_DEBUG("Reject subauth %d server bug\n", VAR_0->auth); vnc_write_u8(VAR_0, 1); if (VAR_0->minor >= 8) { static const char VAR_1[] = "Unsupported authentication type"; vnc_write_u32(VAR_0, sizeof(VAR_1)); vnc_write(VAR_0, VAR_1, sizeof(VAR_1)); } vnc_client_error(VAR_0); } }