summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s23_srvr.c
diff options
context:
space:
mode:
authorbeck <>2017-01-23 08:48:45 +0000
committerbeck <>2017-01-23 08:48:45 +0000
commit61af17199189570a4400f2757a9e8dab4bb76d2a (patch)
treee1f210556179334ded73129e6e0733758fe22365 /src/lib/libssl/s23_srvr.c
parentc85967e4f9c3e1f3b3217545939f1d44ddf9f103 (diff)
downloadopenbsd-61af17199189570a4400f2757a9e8dab4bb76d2a.tar.gz
openbsd-61af17199189570a4400f2757a9e8dab4bb76d2a.tar.bz2
openbsd-61af17199189570a4400f2757a9e8dab4bb76d2a.zip
send state and rstate from ssl_st into internal. There are accessors
so these should not be diddled with directly ok jsing@
Diffstat (limited to 'src/lib/libssl/s23_srvr.c')
-rw-r--r--src/lib/libssl/s23_srvr.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libssl/s23_srvr.c b/src/lib/libssl/s23_srvr.c
index 6b5ac0cc63..4dd94eb7b8 100644
--- a/src/lib/libssl/s23_srvr.c
+++ b/src/lib/libssl/s23_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s23_srvr.c,v 1.54 2017/01/23 06:45:30 beck Exp $ */ 1/* $OpenBSD: s23_srvr.c,v 1.55 2017/01/23 08:48:44 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -139,9 +139,9 @@ ssl23_accept(SSL *s)
139 SSL_clear(s); 139 SSL_clear(s);
140 140
141 for (;;) { 141 for (;;) {
142 state = s->state; 142 state = s->internal->state;
143 143
144 switch (s->state) { 144 switch (s->internal->state) {
145 case SSL_ST_BEFORE: 145 case SSL_ST_BEFORE:
146 case SSL_ST_ACCEPT: 146 case SSL_ST_ACCEPT:
147 case SSL_ST_BEFORE|SSL_ST_ACCEPT: 147 case SSL_ST_BEFORE|SSL_ST_ACCEPT:
@@ -163,7 +163,7 @@ ssl23_accept(SSL *s)
163 goto end; 163 goto end;
164 } 164 }
165 165
166 s->state = SSL23_ST_SR_CLNT_HELLO_A; 166 s->internal->state = SSL23_ST_SR_CLNT_HELLO_A;
167 s->ctx->internal->stats.sess_accept++; 167 s->ctx->internal->stats.sess_accept++;
168 s->internal->init_num = 0; 168 s->internal->init_num = 0;
169 break; 169 break;
@@ -185,11 +185,11 @@ ssl23_accept(SSL *s)
185 /* break; */ 185 /* break; */
186 } 186 }
187 187
188 if ((cb != NULL) && (s->state != state)) { 188 if ((cb != NULL) && (s->internal->state != state)) {
189 new_state = s->state; 189 new_state = s->internal->state;
190 s->state = state; 190 s->internal->state = state;
191 cb(s, SSL_CB_ACCEPT_LOOP, 1); 191 cb(s, SSL_CB_ACCEPT_LOOP, 1);
192 s->state = new_state; 192 s->internal->state = new_state;
193 } 193 }
194 } 194 }
195 195
@@ -228,7 +228,7 @@ ssl23_get_client_hello(SSL *s)
228 int n = 0, j; 228 int n = 0, j;
229 int type = 0; 229 int type = 0;
230 230
231 if (s->state == SSL23_ST_SR_CLNT_HELLO_A) { 231 if (s->internal->state == SSL23_ST_SR_CLNT_HELLO_A) {
232 /* read the initial header */ 232 /* read the initial header */
233 if (!ssl3_setup_buffers(s)) 233 if (!ssl3_setup_buffers(s))
234 return -1; 234 return -1;
@@ -252,7 +252,7 @@ ssl23_get_client_hello(SSL *s)
252 goto unsupported; 252 goto unsupported;
253 253
254 s->version = shared_version; 254 s->version = shared_version;
255 s->state = SSL23_ST_SR_CLNT_HELLO_B; 255 s->internal->state = SSL23_ST_SR_CLNT_HELLO_B;
256 } else if ((p[0] == SSL3_RT_HANDSHAKE) && 256 } else if ((p[0] == SSL3_RT_HANDSHAKE) &&
257 (p[1] == SSL3_VERSION_MAJOR) && 257 (p[1] == SSL3_VERSION_MAJOR) &&
258 (p[5] == SSL3_MT_CLIENT_HELLO) && 258 (p[5] == SSL3_MT_CLIENT_HELLO) &&
@@ -301,7 +301,7 @@ ssl23_get_client_hello(SSL *s)
301 } 301 }
302 } 302 }
303 303
304 if (s->state == SSL23_ST_SR_CLNT_HELLO_B) { 304 if (s->internal->state == SSL23_ST_SR_CLNT_HELLO_B) {
305 /* we have SSLv3/TLSv1 in an SSLv2 header 305 /* we have SSLv3/TLSv1 in an SSLv2 header
306 * (other cases skip this state) */ 306 * (other cases skip this state) */
307 307
@@ -413,7 +413,7 @@ ssl23_get_client_hello(SSL *s)
413 } 413 }
414 414
415 /* imaginary new state (for program structure): */ 415 /* imaginary new state (for program structure): */
416 /* s->state = SSL23_SR_CLNT_HELLO_C */ 416 /* s->internal->state = SSL23_SR_CLNT_HELLO_C */
417 417
418 if (type == 2 || type == 3) { 418 if (type == 2 || type == 3) {
419 /* we have SSLv3/TLSv1 (type 2: SSL2 style, type 3: SSL3/TLS style) */ 419 /* we have SSLv3/TLSv1 (type 2: SSL2 style, type 3: SSL3/TLS style) */
@@ -422,12 +422,12 @@ ssl23_get_client_hello(SSL *s)
422 return -1; 422 return -1;
423 423
424 /* we are in this state */ 424 /* we are in this state */
425 s->state = SSL3_ST_SR_CLNT_HELLO_A; 425 s->internal->state = SSL3_ST_SR_CLNT_HELLO_A;
426 426
427 if (type == 3) { 427 if (type == 3) {
428 /* put the 'n' bytes we have read into the input buffer 428 /* put the 'n' bytes we have read into the input buffer
429 * for SSLv3 */ 429 * for SSLv3 */
430 s->rstate = SSL_ST_READ_HEADER; 430 s->internal->rstate = SSL_ST_READ_HEADER;
431 s->internal->packet_length = n; 431 s->internal->packet_length = n;
432 if (s->s3->rbuf.buf == NULL) 432 if (s->s3->rbuf.buf == NULL)
433 if (!ssl3_setup_read_buffer(s)) 433 if (!ssl3_setup_read_buffer(s))