gnutls: handle another case of connection-closed-during-handshake
authorDan Winship <danw@gnome.org>
Tue, 5 Mar 2013 14:29:55 +0000 (09:29 -0500)
committerDan Winship <danw@gnome.org>
Tue, 5 Mar 2013 15:27:10 +0000 (10:27 -0500)
fixes one of the tests with gnutls 3.x

https://bugzilla.gnome.org/show_bug.cgi?id=694812

tls/gnutls/gtlsconnection-gnutls.c

index 7fc1695..a97031d 100644 (file)
@@ -749,7 +749,13 @@ end_gnutls_io (GTlsConnectionGnutls  *gnutls,
 #endif
           )
     {
-      if (gnutls->priv->require_close_notify)
+      if (gnutls->priv->handshaking && !gnutls->priv->ever_handshaked)
+       {
+         g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_NOT_TLS,
+                              _("Peer failed to perform TLS handshake"));
+         return GNUTLS_E_PULL_ERROR;
+       }
+      else if (gnutls->priv->require_close_notify)
        {
          g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_EOF,
                               _("TLS connection closed unexpectedly"));