Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2014-11-27 04:10:09 +0300
committerAdam Langley <agl@google.com>2014-12-02 22:30:49 +0300
commit0b145c29a397d56ece7557c0b9b597e28fb34b99 (patch)
tree4f340142b756f929b476400262a2bf6674c607ce /ssl/d1_clnt.c
parent8c6a295c392fff2eac379a73e9b5018a3fd4791a (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_clnt.c')
-rw-r--r--ssl/d1_clnt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c
index 60bb12ad..9a8b3613 100644
--- a/ssl/d1_clnt.c
+++ b/ssl/d1_clnt.c
@@ -112,6 +112,7 @@
* [including the GNU Public Licence.]
*/
+#include <assert.h>
#include <stdio.h>
#include <openssl/bn.h>
@@ -152,6 +153,7 @@ int dtls1_connect(SSL *s)
int ret= -1;
int new_state,state,skip=0;
+ assert(s->handshake_func == dtls1_connect);
ERR_clear_error();
ERR_clear_system_error();
@@ -521,7 +523,6 @@ int dtls1_connect(SSL *s)
ret=1;
/* s->server=0; */
- s->handshake_func=dtls1_connect;
s->ctx->stats.sess_connect_good++;
if (cb != NULL) cb(s,SSL_CB_HANDSHAKE_DONE,1);