qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 09/24] ui/vnc: Use gcrypto_random_bytes for s


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH v4 09/24] ui/vnc: Use gcrypto_random_bytes for start_auth_vnc
Date: Wed, 8 May 2019 09:11:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 08/05/2019 02:32, Richard Henderson wrote:
On 5/7/19 3:49 AM, Laurent Vivier wrote:
     void start_auth_vnc(VncState *vs)
   {
-    make_challenge(vs);
+    Error *err = NULL;
+
+    if (qcrypto_random_bytes(vs->challenge, sizeof(vs->challenge), &err)) {
+        trace_vnc_auth_fail(vs, vs->auth, "cannot get random bytes",
+                            error_get_pretty(err));
+        error_free(err);
+        authentication_failed(vs);
+        return;
+    }
+

This part is weird for me: if auth fails we send "vnc_write_u32(vs, 1)" but if
it succeeds we send the challenge. There is no success value to send (like
"vnc_write_u32(vs, 0)") ?

There is, but this code is a mess of callbacks.  In this case it happens toward
the end of protocol_client_auth_vnc:

    2604         trace_vnc_auth_pass(vs, vs->auth);
    2605         vnc_write_u32(vs, 0); /* Accept auth */
    2606         vnc_flush(vs);


ok, thanks.

Reviewed-by: Laurent Vivier <address@hidden>




reply via email to

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