peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 1017-io-fix-check-for-handshake-completion-in-TLS-test.patch

Daniel P. Berrange a8c600
From 689ed13e73bdb5a5ca3366524475e3065fae854a Mon Sep 17 00:00:00 2001
Daniel P. Berrange a8c600
From: "Daniel P. Berrange" <berrange@redhat.com>
Daniel P. Berrange a8c600
Date: Tue, 29 Aug 2017 17:04:52 +0100
Daniel P. Berrange a8c600
Subject: [PATCH] io: fix check for handshake completion in TLS test
Daniel P. Berrange a8c600
Daniel P. Berrange a8c600
The TLS I/O channel test had mistakenly used && instead
Daniel P. Berrange a8c600
of || when checking for handshake completion. As a
Daniel P. Berrange a8c600
result it could terminate the handshake process before
Daniel P. Berrange a8c600
it had actually completed. This was harmless before but
Daniel P. Berrange a8c600
changes in GNUTLS 3.6.0 exposed this bug and caused the
Daniel P. Berrange a8c600
test suite to fail.
Daniel P. Berrange a8c600
Daniel P. Berrange a8c600
Reviewed-by: Eric Blake <eblake@redhat.com>
Daniel P. Berrange a8c600
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Daniel P. Berrange a8c600
---
Daniel P. Berrange a8c600
 tests/test-io-channel-tls.c | 2 +-
Daniel P. Berrange a8c600
 1 file changed, 1 insertion(+), 1 deletion(-)
Daniel P. Berrange a8c600
Daniel P. Berrange a8c600
diff --git a/tests/test-io-channel-tls.c b/tests/test-io-channel-tls.c
Daniel P. Berrange a8c600
index ff96877323..a210d01ba5 100644
Daniel P. Berrange a8c600
--- a/tests/test-io-channel-tls.c
Daniel P. Berrange a8c600
+++ b/tests/test-io-channel-tls.c
Daniel P. Berrange a8c600
@@ -218,7 +218,7 @@ static void test_io_channel_tls(const void *opaque)
Daniel P. Berrange a8c600
     mainloop = g_main_context_default();
Daniel P. Berrange a8c600
     do {
Daniel P. Berrange a8c600
         g_main_context_iteration(mainloop, TRUE);
Daniel P. Berrange a8c600
-    } while (!clientHandshake.finished &&
Daniel P. Berrange a8c600
+    } while (!clientHandshake.finished ||
Daniel P. Berrange a8c600
              !serverHandshake.finished);
Daniel P. Berrange a8c600
 
Daniel P. Berrange a8c600
     g_assert(clientHandshake.failed == data->expectClientFail);
Daniel P. Berrange a8c600
-- 
Daniel P. Berrange a8c600
2.13.5
Daniel P. Berrange a8c600