From 3b455600d14ddcf2be0dcd2d4765d1b7854cd1c5 Mon Sep 17 00:00:00 2001 From: beck <> Date: Sun, 7 May 2017 04:22:24 +0000 Subject: Move state from ssl->internal to the handshake structure. while we are at it, convert SSLerror to use a function internally, so that we may later allocate the handshake structure and check for it ok jsing@ --- src/lib/libssl/d1_pkt.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/lib/libssl/d1_pkt.c') diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index 5fdd176800..9f670fadfd 100644 --- a/src/lib/libssl/d1_pkt.c +++ b/src/lib/libssl/d1_pkt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_pkt.c,v 1.62 2017/02/07 02:08:38 beck Exp $ */ +/* $OpenBSD: d1_pkt.c,v 1.63 2017/05/07 04:22:24 beck Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -685,7 +685,7 @@ start: * so process data buffered during the last handshake * in advance, if any. */ - if (s->internal->state == SSL_ST_OK && rr->length == 0) { + if (S3I(s)->hs.state == SSL_ST_OK && rr->length == 0) { pitem *item; item = pqueue_pop(D1I(s)->buffered_app_data.q); if (item) { @@ -1028,9 +1028,9 @@ start: goto start; } - if (((s->internal->state&SSL_ST_MASK) == SSL_ST_OK) && + if (((S3I(s)->hs.state&SSL_ST_MASK) == SSL_ST_OK) && !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) { - s->internal->state = s->server ? SSL_ST_ACCEPT : SSL_ST_CONNECT; + S3I(s)->hs.state = s->server ? SSL_ST_ACCEPT : SSL_ST_CONNECT; s->internal->renegotiate = 1; s->internal->new_session = 1; } @@ -1089,12 +1089,12 @@ start: */ if (S3I(s)->in_read_app_data && (S3I(s)->total_renegotiations != 0) && - (((s->internal->state & SSL_ST_CONNECT) && - (s->internal->state >= SSL3_ST_CW_CLNT_HELLO_A) && - (s->internal->state <= SSL3_ST_CR_SRVR_HELLO_A)) || ( - (s->internal->state & SSL_ST_ACCEPT) && - (s->internal->state <= SSL3_ST_SW_HELLO_REQ_A) && - (s->internal->state >= SSL3_ST_SR_CLNT_HELLO_A)))) { + (((S3I(s)->hs.state & SSL_ST_CONNECT) && + (S3I(s)->hs.state >= SSL3_ST_CW_CLNT_HELLO_A) && + (S3I(s)->hs.state <= SSL3_ST_CR_SRVR_HELLO_A)) || ( + (S3I(s)->hs.state & SSL_ST_ACCEPT) && + (S3I(s)->hs.state <= SSL3_ST_SW_HELLO_REQ_A) && + (S3I(s)->hs.state >= SSL3_ST_SR_CLNT_HELLO_A)))) { S3I(s)->in_read_app_data = 2; return (-1); } else { -- cgit v1.2.3-55-g6feb