diff options
| author | jsing <> | 2015-09-13 09:20:19 +0000 |
|---|---|---|
| committer | jsing <> | 2015-09-13 09:20:19 +0000 |
| commit | 6dfed4d8d462a506b9ea9e0e96092d0eda8373f1 (patch) | |
| tree | ef6d6213f837387ff8e221e487c55b1502929308 /src/lib/libssl/d1_srvr.c | |
| parent | c3ba6bff2113cb2fedd4ebfb0fa2fac9485a6e0b (diff) | |
| download | openbsd-6dfed4d8d462a506b9ea9e0e96092d0eda8373f1.tar.gz openbsd-6dfed4d8d462a506b9ea9e0e96092d0eda8373f1.tar.bz2 openbsd-6dfed4d8d462a506b9ea9e0e96092d0eda8373f1.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 '')
| -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 | ||
