[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: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v4 09/24] ui/vnc: Use gcrypto_random_bytes for start_auth_vnc |
Date: |
Tue, 7 May 2019 17:32:51 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
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);
r~
- [Qemu-devel] [PATCH v4 01/24] configure: Link test before auto-enabling gnutls, (continued)
- [Qemu-devel] [PATCH v4 01/24] configure: Link test before auto-enabling gnutls, Richard Henderson, 2019/05/06
- [Qemu-devel] [PATCH v4 03/24] crypto: Reverse code blocks in random-platform.c, Richard Henderson, 2019/05/06
- [Qemu-devel] [PATCH v4 05/24] crypto: Use O_CLOEXEC in qcrypto_random_init, Richard Henderson, 2019/05/06
- [Qemu-devel] [PATCH v4 04/24] crypto: Do not fail for EINTR during qcrypto_random_bytes, Richard Henderson, 2019/05/06
- [Qemu-devel] [PATCH v4 09/24] ui/vnc: Use gcrypto_random_bytes for start_auth_vnc, Richard Henderson, 2019/05/06
- [Qemu-devel] [PATCH v4 07/24] crypto: Change the qcrypto_random_bytes buffer type to void*, Richard Henderson, 2019/05/06
- [Qemu-devel] [PATCH v4 02/24] crypto: Merge crypto-obj-y into libqemuutil.a, Richard Henderson, 2019/05/06
[Qemu-devel] [PATCH v4 06/24] crypto: Use getrandom for qcrypto_random_bytes, Richard Henderson, 2019/05/06
[Qemu-devel] [PATCH v4 08/24] ui/vnc: Split out authentication_failed, Richard Henderson, 2019/05/06