qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 10/10] ui: convert VNC to use generic cipher


From: Gonglei
Subject: Re: [Qemu-devel] [PATCH v3 10/10] ui: convert VNC to use generic cipher API
Date: Tue, 23 Jun 2015 10:26:50 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 2015/6/19 1:02, Daniel P. Berrange wrote:
>      if (!vs->vd->password) {
>          VNC_DEBUG("No password configured on server");
> @@ -2534,9 +2536,29 @@ static int protocol_client_auth_vnc(VncState *vs, 
> uint8_t *data, size_t len)
>      pwlen = strlen(vs->vd->password);
>      for (i=0; i<sizeof(key); i++)
>          key[i] = i<pwlen ? vs->vd->password[i] : 0;
> -    deskey(key, EN0);
> -    for (j = 0; j < VNC_AUTH_CHALLENGE_SIZE; j += 8)
> -        des(response+j, response+j);
> +
> +    cipher = qcrypto_cipher_new(
> +        QCRYPTO_CIPHER_ALG_DES_RFB,
> +        QCRYPTO_CIPHER_MODE_ECB,
> +        key, G_N_ELEMENTS(key),
> +        &err);
> +    if (!cipher) {
> +        VNC_DEBUG("Cannot initialize cipher %s",
> +                  error_get_pretty(err));
> +        error_free(err);
> +        goto reject;
> +    }
> +
> +    if (qcrypto_cipher_decrypt(cipher,
> +                               vs->challenge,
> +                               response,
> +                               VNC_AUTH_CHALLENGE_SIZE,
> +                               &err) < 0) {
> +        VNC_DEBUG("Cannot encrypt challenge %s",
> +                  error_get_pretty(err));
> +        error_free(err);
> +        goto reject;
> +    }

Do we need change above VNC_DEBUGs to error_report() or something like that?
Anyway, it doesn't influence my R-b:
        Reviewed-by: Gonglei <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]