summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2020-03-27 10:34:25 +1100
committerTim-Philipp Müller <tim@centricular.com>2020-09-25 00:45:19 +0100
commit597dccea8877b8cedbd42a413127c495d83dee3c (patch)
treeec38311f1dae7bbe517fb8636e33a7cf5c420cfe
parent0889213e082e2fa3b740de827f8ade6abcd69585 (diff)
dtls/connection: fix EOF handling with openssl 1.1.1e
openssl 1.1.1e does some stricker EOF handling and will throw an error if the EOF is unexpected (like in the middle of a record). As we are streaming data into openssl here, it is entirely possible that we push data from multiple buffers/packets into openssl separately. From the openssl changelog: Changes between 1.1.1d and 1.1.1e [17 Mar 2020] *) Properly detect EOF while reading in libssl. Previously if we hit an EOF while reading in libssl then we would report an error back to the application (SSL_ERROR_SYSCALL) but errno would be 0. We now add an error to the stack (which means we instead return SSL_ERROR_SSL) and therefore give a hint as to what went wrong. [Matt Caswell] We can relax the EOF signalling to only return TRUE when we have stopped for any reason (EOS, error). Will also remove a spurious EOF error from previous openssl version. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1598>
-rw-r--r--ext/dtls/gstdtlsconnection.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/dtls/gstdtlsconnection.c b/ext/dtls/gstdtlsconnection.c
index 244ec997c..ee0296aa5 100644
--- a/ext/dtls/gstdtlsconnection.c
+++ b/ext/dtls/gstdtlsconnection.c
@@ -989,7 +989,7 @@ bio_method_ctrl (BIO * bio, int cmd, long arg1, void *arg2)
GST_LOG_OBJECT (self, "BIO: EOF reset");
return 1;
case BIO_CTRL_EOF:{
- gint eof = !(priv->bio_buffer_len - priv->bio_buffer_offset);
+ gint eof = priv->is_alive == FALSE;
GST_LOG_OBJECT (self, "BIO: EOF query returned %d", eof);
return eof;
}