aboutsummaryrefslogtreecommitdiff
path: root/ssl/d1_lib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-11-23 23:03:13 +0000
committerMatt Caswell <matt@openssl.org>2016-11-29 10:01:49 +0000
commit5bdcd362d24cbbcf18c5eb9df655fe9f7bcf5850 (patch)
treec752ff968c48af40325cf20a724dee177b20b290 /ssl/d1_lib.c
parent8d1ebff41c75e4eebc7d5cc5a561a1bab6b50e70 (diff)
downloadopenssl-5bdcd362d24cbbcf18c5eb9df655fe9f7bcf5850.zip
openssl-5bdcd362d24cbbcf18c5eb9df655fe9f7bcf5850.tar.gz
openssl-5bdcd362d24cbbcf18c5eb9df655fe9f7bcf5850.tar.bz2
Ensure we are in accept state in DTLSv1_listen
Calling SSL_set_accept_state() after DTLSv1_listen() clears the state, so SSL_accept() no longer works. In 1.0.2 calling DTLSv1_listen() would set the accept state automatically. We should still do that. Fixes #1989 Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'ssl/d1_lib.c')
-rw-r--r--ssl/d1_lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c
index 20970c3..c1d160e 100644
--- a/ssl/d1_lib.c
+++ b/ssl/d1_lib.c
@@ -432,6 +432,11 @@ int DTLSv1_listen(SSL *s, BIO_ADDR *client)
BIO_ADDR *tmpclient = NULL;
PACKET pkt, msgpkt, msgpayload, session, cookiepkt;
+ if (s->handshake_func == NULL) {
+ /* Not properly initialized yet */
+ SSL_set_accept_state(s);
+ }
+
/* Ensure there is no state left over from a previous invocation */
if (!SSL_clear(s))
return -1;