]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: fix TLS handshake failure with TLS 1.3
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 18 Jul 2018 18:21:06 +0000 (19:21 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 23 Jul 2018 10:36:09 +0000 (11:36 +0100)
When gnutls negotiates TLS 1.3 instead of 1.2, the order of messages
sent by the handshake changes. This exposed a logic bug in the test
suite which caused us to wait for the server to see handshake
completion, but not wait for the client to see completion. The result
was the client didn't receive the certificate for verification and the
test failed.

This is exposed in Fedora 29 rawhide which has just enabled TLS 1.3 in
its GNUTLS builds.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tests/virnettlssessiontest.c

index 7e856071817d8e9af93e7f71f826ee52cf7f16dd..375cc1bb0281ffa0758d77dc9a526d7696ed3710 100644 (file)
@@ -180,7 +180,7 @@ static int testTLSSessionInit(const void *opaque)
             if (rv == VIR_NET_TLS_HANDSHAKE_COMPLETE)
                 clientShake = true;
         }
-    } while (!clientShake && !serverShake);
+    } while (!clientShake || !serverShake);
 
 
     /* Finally make sure the server validation does what