summaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-06-20 17:36:30 +0200
committerMatt Caswell <matt@openssl.org>2017-06-21 15:56:24 +0200
commit9924087573cfbc8d2bc97088f36d1a81ca00cda3 (patch)
tree8154afee40669f8394aeff3b784543f65a21c903 /crypto/bio
parentPSK related tweaks based on review feedback (diff)
downloadopenssl-9924087573cfbc8d2bc97088f36d1a81ca00cda3.tar.xz
openssl-9924087573cfbc8d2bc97088f36d1a81ca00cda3.zip
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)
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bss_dgram.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index 7ef4281597..4070f205bf 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -787,6 +787,15 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
case BIO_CTRL_DGRAM_GET_MTU_OVERHEAD:
ret = dgram_get_mtu_overhead(data);
break;
+
+ /*
+ * BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE is used here for compatibility
+ * reasons. When BIO_CTRL_DGRAM_SET_PEEK_MODE was first defined its value
+ * was incorrectly clashing with BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE. The
+ * value has been updated to a non-clashing value. However to preserve
+ * binary compatiblity we now respond to both the old value and the new one
+ */
+ case BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE:
case BIO_CTRL_DGRAM_SET_PEEK_MODE:
data->peekmode = (unsigned int)num;
break;