diff options
author | jsing <> | 2015-09-13 09:20:19 +0000 |
---|---|---|
committer | jsing <> | 2015-09-13 09:20:19 +0000 |
commit | 86b9c46552e3f57d558ae8570ed33059e9418153 (patch) | |
tree | ef6d6213f837387ff8e221e487c55b1502929308 /src/lib/libssl/d1_srvr.c | |
parent | 80f33b2a4b53b6e712873ba41c9f333f62edbb3b (diff) | |
download | openbsd-86b9c46552e3f57d558ae8570ed33059e9418153.tar.gz openbsd-86b9c46552e3f57d558ae8570ed33059e9418153.tar.bz2 openbsd-86b9c46552e3f57d558ae8570ed33059e9418153.zip |
The *_accept() functions increment in_handshake at the start of the function,
then decrement it and call a callback on exit from the function. As such,
these functions should not return in the middle, otherwise in_handshake is
never decremented and the callback never called.
ok beck@ "with many sighs" miod@
Diffstat (limited to 'src/lib/libssl/d1_srvr.c')
-rw-r--r-- | src/lib/libssl/d1_srvr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c index f5e0ec3e4b..f6664237ae 100644 --- a/src/lib/libssl/d1_srvr.c +++ b/src/lib/libssl/d1_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_srvr.c,v 1.66 2015/09/12 20:51:33 jsing Exp $ */ | 1 | /* $OpenBSD: d1_srvr.c,v 1.67 2015/09/13 09:20:19 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -202,7 +202,8 @@ dtls1_accept(SSL *s) | |||
202 | 202 | ||
203 | if (s->cert == NULL) { | 203 | if (s->cert == NULL) { |
204 | SSLerr(SSL_F_DTLS1_ACCEPT, SSL_R_NO_CERTIFICATE_SET); | 204 | SSLerr(SSL_F_DTLS1_ACCEPT, SSL_R_NO_CERTIFICATE_SET); |
205 | return (-1); | 205 | ret = -1; |
206 | goto end; | ||
206 | } | 207 | } |
207 | 208 | ||
208 | for (;;) { | 209 | for (;;) { |
@@ -224,7 +225,8 @@ dtls1_accept(SSL *s) | |||
224 | 225 | ||
225 | if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00)) { | 226 | if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00)) { |
226 | SSLerr(SSL_F_DTLS1_ACCEPT, ERR_R_INTERNAL_ERROR); | 227 | SSLerr(SSL_F_DTLS1_ACCEPT, ERR_R_INTERNAL_ERROR); |
227 | return -1; | 228 | ret = -1; |
229 | goto end; | ||
228 | } | 230 | } |
229 | s->type = SSL_ST_ACCEPT; | 231 | s->type = SSL_ST_ACCEPT; |
230 | 232 | ||