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>
This commit is contained in:
Matt Caswell
2015-10-22 13:57:18 +01:00
parent 20dbe58577
commit 024f543c15
11 changed files with 43 additions and 26 deletions

View File

@@ -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