summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c
index 76b2f8a8c4..c593e7b42b 100644
--- a/src/lib/libssl/ssl_lib.c
+++ b/src/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_lib.c,v 1.160 2017/05/06 22:24:57 beck Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.161 2017/05/07 04:22:24 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 *
@@ -183,8 +183,6 @@ SSL_clear(SSL *s)
183 183
184 s->internal->type = 0; 184 s->internal->type = 0;
185 185
186 s->internal->state = SSL_ST_BEFORE|((s->server) ? SSL_ST_ACCEPT : SSL_ST_CONNECT);
187
188 s->version = s->method->internal->version; 186 s->version = s->method->internal->version;
189 s->client_version = s->version; 187 s->client_version = s->version;
190 s->internal->rwstate = SSL_NOTHING; 188 s->internal->rwstate = SSL_NOTHING;
@@ -212,6 +210,8 @@ SSL_clear(SSL *s)
212 } else 210 } else
213 s->method->internal->ssl_clear(s); 211 s->method->internal->ssl_clear(s);
214 212
213 S3I(s)->hs.state = SSL_ST_BEFORE|((s->server) ? SSL_ST_ACCEPT : SSL_ST_CONNECT);
214
215 return (1); 215 return (1);
216} 216}
217 217
@@ -2397,7 +2397,7 @@ SSL_set_accept_state(SSL *s)
2397{ 2397{
2398 s->server = 1; 2398 s->server = 1;
2399 s->internal->shutdown = 0; 2399 s->internal->shutdown = 0;
2400 s->internal->state = SSL_ST_ACCEPT|SSL_ST_BEFORE; 2400 S3I(s)->hs.state = SSL_ST_ACCEPT|SSL_ST_BEFORE;
2401 s->internal->handshake_func = s->method->internal->ssl_accept; 2401 s->internal->handshake_func = s->method->internal->ssl_accept;
2402 /* clear the current cipher */ 2402 /* clear the current cipher */
2403 ssl_clear_cipher_ctx(s); 2403 ssl_clear_cipher_ctx(s);
@@ -2410,7 +2410,7 @@ SSL_set_connect_state(SSL *s)
2410{ 2410{
2411 s->server = 0; 2411 s->server = 0;
2412 s->internal->shutdown = 0; 2412 s->internal->shutdown = 0;
2413 s->internal->state = SSL_ST_CONNECT|SSL_ST_BEFORE; 2413 S3I(s)->hs.state = SSL_ST_CONNECT|SSL_ST_BEFORE;
2414 s->internal->handshake_func = s->method->internal->ssl_connect; 2414 s->internal->handshake_func = s->method->internal->ssl_connect;
2415 /* clear the current cipher */ 2415 /* clear the current cipher */
2416 ssl_clear_cipher_ctx(s); 2416 ssl_clear_cipher_ctx(s);
@@ -2544,7 +2544,7 @@ SSL_dup(SSL *s)
2544 ret->internal->quiet_shutdown = s->internal->quiet_shutdown; 2544 ret->internal->quiet_shutdown = s->internal->quiet_shutdown;
2545 ret->internal->shutdown = s->internal->shutdown; 2545 ret->internal->shutdown = s->internal->shutdown;
2546 /* SSL_dup does not really work at any state, though */ 2546 /* SSL_dup does not really work at any state, though */
2547 ret->internal->state = s->internal->state; 2547 S3I(ret)->hs.state = S3I(s)->hs.state;
2548 ret->internal->rstate = s->internal->rstate; 2548 ret->internal->rstate = s->internal->rstate;
2549 2549
2550 /* 2550 /*
@@ -2804,13 +2804,13 @@ void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, int val)
2804int 2804int
2805SSL_state(const SSL *ssl) 2805SSL_state(const SSL *ssl)
2806{ 2806{
2807 return (ssl->internal->state); 2807 return (S3I(ssl)->hs.state);
2808} 2808}
2809 2809
2810void 2810void
2811SSL_set_state(SSL *ssl, int state) 2811SSL_set_state(SSL *ssl, int state)
2812{ 2812{
2813 ssl->internal->state = state; 2813 S3I(ssl)->hs.state = state;
2814} 2814}
2815 2815
2816void 2816void