summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-06-20 16:36:30 +0100
committerMatt Caswell <matt@openssl.org>2017-06-21 15:02:46 +0100
commit21815512063d00325fd8e25f3f39ced047cb968b (patch)
tree5a5247a0d642354acae3ebcacd81e91be7773a1c /ssl
parentd717edf80ed3494a5a25c0b82ce61e5885de68ac (diff)
Fix DTLS failure when used in a build which has SCTP enabled
The value of BIO_CTRL_DGRAM_SET_PEEK_MODE was clashing with the value for BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE. In an SCTP enabled build BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE was used unconditionally with the reasoning that it would be ignored if SCTP wasn't in use. Unfortunately due to this clash, this wasn't the case. The BIO ended up going into peek mode and was continually reading the same data over and over - throwing it away as a replay. Fixes #3723 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3724) (cherry picked from commit 9924087573cfbc8d2bc97088f36d1a81ca00cda3)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/statem/statem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index 691bfbbb2a..e6dc3b1095 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -241,10 +241,10 @@ static int state_machine(SSL *s, int server)
return -1;
}
#ifndef OPENSSL_NO_SCTP
- if (SSL_IS_DTLS(s)) {
+ if (SSL_IS_DTLS(s) && BIO_dgram_is_sctp(SSL_get_wbio(s))) {
/*
* Notify SCTP BIO socket to enter handshake mode and prevent stream
- * identifier other than 0. Will be ignored if no SCTP is used.
+ * identifier other than 0.
*/
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE,
st->in_handshake, NULL);
@@ -417,10 +417,10 @@ static int state_machine(SSL *s, int server)
st->in_handshake--;
#ifndef OPENSSL_NO_SCTP
- if (SSL_IS_DTLS(s)) {
+ if (SSL_IS_DTLS(s) && BIO_dgram_is_sctp(SSL_get_wbio(s))) {
/*
* Notify SCTP BIO socket to leave handshake mode and allow stream
- * identifier other than 0. Will be ignored if no SCTP is used.
+ * identifier other than 0.
*/
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE,
st->in_handshake, NULL);