summaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-10-22 13:57:18 +0100
committerMatt Caswell <matt@openssl.org>2015-10-30 08:39:47 +0000
commit024f543c15e70acb57a80067c3b32227f87bfe5f (patch)
tree72bc8530d31b4fae449df9270f516d9637be31e3 /ssl/statem/statem.c
parent20dbe585772a18952b730b71cd6722ce62dfe88b (diff)
Move in_handshake into STATEM
The SSL variable |in_handshake| seems misplaced. It would be better to have it in the STATEM structure. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/statem/statem.c')
-rw-r--r--ssl/statem/statem.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index f22801987a..76e902c993 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -187,6 +187,19 @@ void ossl_statem_set_in_init(SSL *s, int init)
s->statem.in_init = init;
}
+int ossl_statem_get_in_handshake(SSL *s)
+{
+ return s->statem.in_handshake;
+}
+
+void ossl_statem_set_in_handshake(SSL *s, int inhand)
+{
+ if (inhand)
+ s->statem.in_handshake++;
+ else
+ s->statem.in_handshake--;
+}
+
void ossl_statem_set_hello_verify_done(SSL *s)
{
s->statem.state = MSG_FLOW_UNINITED;
@@ -267,7 +280,7 @@ static int state_machine(SSL *s, int server) {
cb = get_callback(s);
- s->in_handshake++;
+ st->in_handshake++;
if (!SSL_in_init(s) || SSL_in_before(s)) {
if (!SSL_clear(s))
return -1;
@@ -280,7 +293,7 @@ static int state_machine(SSL *s, int server) {
* identifier other than 0. Will be ignored if no SCTP is used.
*/
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE,
- s->in_handshake, NULL);
+ st->in_handshake, NULL);
}
#endif
@@ -447,7 +460,7 @@ static int state_machine(SSL *s, int server) {
ret = 1;
end:
- s->in_handshake--;
+ st->in_handshake--;
#ifndef OPENSSL_NO_SCTP
if (SSL_IS_DTLS(s)) {
@@ -456,7 +469,7 @@ static int state_machine(SSL *s, int server) {
* identifier other than 0. Will be ignored if no SCTP is used.
*/
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE,
- s->in_handshake, NULL);
+ st->in_handshake, NULL);
}
#endif