qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v3 10/10] ui: convert VNC to use generic cipher API
Date: Tue, 23 Jun 2015 09:48:28 +0100	[thread overview]
Message-ID: <20150623084827.GC30318@redhat.com> (raw)
In-Reply-To: <5588C3EA.6080408@huawei.com>

On Tue, Jun 23, 2015 at 10:26:50AM +0800, Gonglei wrote:
> 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?

In general, yes, the VNC code doesn't really handle error reporting very
well today.

> Anyway, it doesn't influence my R-b:
> 	Reviewed-by: Gonglei <arei.gonglei@huawei.com>

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

      reply	other threads:[~2015-06-23  8:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 17:02 [Qemu-devel] [PATCH v3 00/10] Consolidate crypto APIs & implementations Daniel P. Berrange
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 01/10] crypto: introduce new module for computing hash digests Daniel P. Berrange
2015-06-23  2:11   ` Gonglei
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 02/10] crypto: move built-in AES implementation into crypto/ Daniel P. Berrange
2015-06-23  2:11   ` Gonglei
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 03/10] crypto: move built-in D3DES " Daniel P. Berrange
2015-06-23  2:12   ` Gonglei
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 04/10] crypto: introduce generic cipher API & built-in implementation Daniel P. Berrange
2015-06-23  2:15   ` Gonglei
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 05/10] crypto: add a gcrypt cipher implementation Daniel P. Berrange
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 06/10] crypto: add a nettle " Daniel P. Berrange
2015-06-23  2:17   ` Gonglei
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 07/10] block: convert quorum blockdrv to use crypto APIs Daniel P. Berrange
2015-06-23  2:17   ` Gonglei
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 08/10] ui: convert VNC websockets " Daniel P. Berrange
2015-06-23  2:18   ` Gonglei
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 09/10] block: convert qcow/qcow2 to use generic cipher API Daniel P. Berrange
2015-06-23  2:18   ` Gonglei
2015-06-18 17:02 ` [Qemu-devel] [PATCH v3 10/10] ui: convert VNC " Daniel P. Berrange
2015-06-23  2:26   ` Gonglei
2015-06-23  8:48     ` Daniel P. Berrange [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150623084827.GC30318@redhat.com \
    --to=berrange@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).