]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
tls-socket: Don't fail reading if sending data failed
authorTobias Brunner <tobias@strongswan.org>
Wed, 26 Aug 2020 15:42:21 +0000 (17:42 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 12 Feb 2021 10:45:44 +0000 (11:45 +0100)
If data is processed that eventually includes a TLS close notify, build()
will fail after a close notify has been sent in turn.  However, propagating
that error immediately when reading prevented ever returning the data
already processed before the close notify was received.

src/libtls/tls_socket.c

index f29a369f14415c31845f465796b63fff0b481945..7745988fb6e909ad589e9090e00cdcdf03f1caad 100644 (file)
@@ -188,7 +188,11 @@ static bool exchange(private_tls_socket_t *this, bool wr, bool block)
                                case SUCCESS:
                                        return TRUE;
                                default:
-                                       return FALSE;
+                                       if (wr)
+                                       {
+                                               return FALSE;
+                                       }
+                                       break;
                        }
                        break;
                }