Revision 7e7e2ebc ui/vnc-auth-vencrypt.c

b/ui/vnc-auth-vencrypt.c
29 29

  
30 30
static void start_auth_vencrypt_subauth(VncState *vs)
31 31
{
32
    switch (vs->vd->subauth) {
32
    switch (vs->subauth) {
33 33
    case VNC_AUTH_VENCRYPT_TLSNONE:
34 34
    case VNC_AUTH_VENCRYPT_X509NONE:
35 35
       VNC_DEBUG("Accept TLS auth none\n");
......
51 51
#endif /* CONFIG_VNC_SASL */
52 52

  
53 53
    default: /* Should not be possible, but just in case */
54
       VNC_DEBUG("Reject subauth %d server bug\n", vs->vd->auth);
54
       VNC_DEBUG("Reject subauth %d server bug\n", vs->auth);
55 55
       vnc_write_u8(vs, 1);
56 56
       if (vs->minor >= 8) {
57 57
           static const char err[] = "Unsupported authentication type";
......
110 110

  
111 111

  
112 112
#define NEED_X509_AUTH(vs)                              \
113
    ((vs)->vd->subauth == VNC_AUTH_VENCRYPT_X509NONE ||   \
114
     (vs)->vd->subauth == VNC_AUTH_VENCRYPT_X509VNC ||    \
115
     (vs)->vd->subauth == VNC_AUTH_VENCRYPT_X509PLAIN ||  \
116
     (vs)->vd->subauth == VNC_AUTH_VENCRYPT_X509SASL)
113
    ((vs)->subauth == VNC_AUTH_VENCRYPT_X509NONE ||   \
114
     (vs)->subauth == VNC_AUTH_VENCRYPT_X509VNC ||    \
115
     (vs)->subauth == VNC_AUTH_VENCRYPT_X509PLAIN ||  \
116
     (vs)->subauth == VNC_AUTH_VENCRYPT_X509SASL)
117 117

  
118 118

  
119 119
static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len)
120 120
{
121 121
    int auth = read_u32(data, 0);
122 122

  
123
    if (auth != vs->vd->subauth) {
123
    if (auth != vs->subauth) {
124 124
        VNC_DEBUG("Rejecting auth %d\n", auth);
125 125
        vnc_write_u8(vs, 0); /* Reject auth */
126 126
        vnc_flush(vs);
......
153 153
        vnc_flush(vs);
154 154
        vnc_client_error(vs);
155 155
    } else {
156
        VNC_DEBUG("Sending allowed auth %d\n", vs->vd->subauth);
156
        VNC_DEBUG("Sending allowed auth %d\n", vs->subauth);
157 157
        vnc_write_u8(vs, 0); /* Accept version */
158 158
        vnc_write_u8(vs, 1); /* Number of sub-auths */
159
        vnc_write_u32(vs, vs->vd->subauth); /* The supported auth */
159
        vnc_write_u32(vs, vs->subauth); /* The supported auth */
160 160
        vnc_flush(vs);
161 161
        vnc_read_when(vs, protocol_client_vencrypt_auth, 4);
162 162
    }

Also available in: Unified diff