[Qemu-devel] [PATCH] io: fix check for handshake completion in TLS test

Daniel P. Berrange posted 1 patch 8 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170829164017.14178-1-berrange@redhat.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
tests/test-io-channel-tls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] io: fix check for handshake completion in TLS test
Posted by Daniel P. Berrange 8 years, 2 months ago
The TLS I/O channel test had mistakenly used && instead
of || when checking for handshake completion. As a
result it could terminate the handshake process before
it had actually completed. This was harmless before but
changes in GNUTLS 3.6.0 exposed this bug and caused the
test suite to fail.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 tests/test-io-channel-tls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test-io-channel-tls.c b/tests/test-io-channel-tls.c
index 8eaa208e1b..e7c80f46cf 100644
--- a/tests/test-io-channel-tls.c
+++ b/tests/test-io-channel-tls.c
@@ -218,7 +218,7 @@ static void test_io_channel_tls(const void *opaque)
     mainloop = g_main_context_default();
     do {
         g_main_context_iteration(mainloop, TRUE);
-    } while (!clientHandshake.finished &&
+    } while (!clientHandshake.finished ||
              !serverHandshake.finished);
 
     g_assert(clientHandshake.failed == data->expectClientFail);
-- 
2.13.5


Re: [Qemu-devel] [PATCH] io: fix check for handshake completion in TLS test
Posted by Eric Blake 8 years, 2 months ago
On 08/29/2017 11:40 AM, Daniel P. Berrange wrote:
> The TLS I/O channel test had mistakenly used && instead
> of || when checking for handshake completion. As a
> result it could terminate the handshake process before
> it had actually completed. This was harmless before but
> changes in GNUTLS 3.6.0 exposed this bug and caused the
> test suite to fail.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  tests/test-io-channel-tls.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

> diff --git a/tests/test-io-channel-tls.c b/tests/test-io-channel-tls.c
> index 8eaa208e1b..e7c80f46cf 100644
> --- a/tests/test-io-channel-tls.c
> +++ b/tests/test-io-channel-tls.c
> @@ -218,7 +218,7 @@ static void test_io_channel_tls(const void *opaque)
>      mainloop = g_main_context_default();
>      do {
>          g_main_context_iteration(mainloop, TRUE);
> -    } while (!clientHandshake.finished &&
> +    } while (!clientHandshake.finished ||
>               !serverHandshake.finished);
>  
>      g_assert(clientHandshake.failed == data->expectClientFail);
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org