diff options
author | David Benjamin <davidben@chromium.org> | 2014-11-27 04:10:09 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-12-02 22:30:49 +0300 |
commit | 0b145c29a397d56ece7557c0b9b597e28fb34b99 (patch) | |
tree | 4f340142b756f929b476400262a2bf6674c607ce /ssl/d1_srvr.c | |
parent | 8c6a295c392fff2eac379a73e9b5018a3fd4791a (diff) |
Don't assign handshake_func in the handshake functions.
It should already be assigned, as of upstream's
b31b04d951e9b65bde29657e1ae057b76f0f0a73. I believe these assignments are part
of the reason it used to appear to work. Replace them with assertions. So the
assertions are actually valid, check in SSL_connect / SSL_accept that they are
never called if the socket had been placed in the opposite state. (Or we'd be
in another place where it would have appeared to work with the handshake
functions fixing things afterwards.)
Now the only places handshake_func is set are in SSL_set_{connect,accept}_state
and the method switches.
Change-Id: Ib249212bf4aa889b94c35965a62ca06bdbcf52e1
Reviewed-on: https://boringssl-review.googlesource.com/2432
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/d1_srvr.c')
-rw-r--r-- | ssl/d1_srvr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 6d6c46e2..43cfefa6 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -112,6 +112,7 @@ * [including the GNU Public Licence.] */ +#include <assert.h> #include <stdio.h> #include <openssl/bn.h> @@ -153,6 +154,7 @@ int dtls1_accept(SSL *s) int ret= -1; int new_state,state,skip=0; + assert(s->handshake_func == dtls1_accept); ERR_clear_error(); ERR_clear_system_error(); @@ -576,7 +578,6 @@ int dtls1_accept(SSL *s) s->ctx->stats.sess_accept_good++; /* s->server=1; */ - s->handshake_func=dtls1_accept; if (cb != NULL) cb(s,SSL_CB_HANDSHAKE_DONE,1); } |