summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2017-05-07 04:22:24 +0000
committerbeck <beck@openbsd.org>2017-05-07 04:22:24 +0000
commit440bed4fbf67c71055029b3e3067c272d9453bf5 (patch)
tree52b4b4cebc1418ac46724df5173a011a50033f2a /lib/libssl/ssl_lib.c
parentLimit -Werror to gcc4 as was done in libcrypto/libssl/libtls to avoid (diff)
downloadwireguard-openbsd-440bed4fbf67c71055029b3e3067c272d9453bf5.tar.xz
wireguard-openbsd-440bed4fbf67c71055029b3e3067c272d9453bf5.zip
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@
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r--lib/libssl/ssl_lib.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index 76b2f8a8c48..c593e7b42bc 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.160 2017/05/06 22:24:57 beck Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.161 2017/05/07 04:22:24 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -183,8 +183,6 @@ SSL_clear(SSL *s)
s->internal->type = 0;
- s->internal->state = SSL_ST_BEFORE|((s->server) ? SSL_ST_ACCEPT : SSL_ST_CONNECT);
-
s->version = s->method->internal->version;
s->client_version = s->version;
s->internal->rwstate = SSL_NOTHING;
@@ -212,6 +210,8 @@ SSL_clear(SSL *s)
} else
s->method->internal->ssl_clear(s);
+ S3I(s)->hs.state = SSL_ST_BEFORE|((s->server) ? SSL_ST_ACCEPT : SSL_ST_CONNECT);
+
return (1);
}
@@ -2397,7 +2397,7 @@ SSL_set_accept_state(SSL *s)
{
s->server = 1;
s->internal->shutdown = 0;
- s->internal->state = SSL_ST_ACCEPT|SSL_ST_BEFORE;
+ S3I(s)->hs.state = SSL_ST_ACCEPT|SSL_ST_BEFORE;
s->internal->handshake_func = s->method->internal->ssl_accept;
/* clear the current cipher */
ssl_clear_cipher_ctx(s);
@@ -2410,7 +2410,7 @@ SSL_set_connect_state(SSL *s)
{
s->server = 0;
s->internal->shutdown = 0;
- s->internal->state = SSL_ST_CONNECT|SSL_ST_BEFORE;
+ S3I(s)->hs.state = SSL_ST_CONNECT|SSL_ST_BEFORE;
s->internal->handshake_func = s->method->internal->ssl_connect;
/* clear the current cipher */
ssl_clear_cipher_ctx(s);
@@ -2544,7 +2544,7 @@ SSL_dup(SSL *s)
ret->internal->quiet_shutdown = s->internal->quiet_shutdown;
ret->internal->shutdown = s->internal->shutdown;
/* SSL_dup does not really work at any state, though */
- ret->internal->state = s->internal->state;
+ S3I(ret)->hs.state = S3I(s)->hs.state;
ret->internal->rstate = s->internal->rstate;
/*
@@ -2804,13 +2804,13 @@ void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, int val)
int
SSL_state(const SSL *ssl)
{
- return (ssl->internal->state);
+ return (S3I(ssl)->hs.state);
}
void
SSL_set_state(SSL *ssl, int state)
{
- ssl->internal->state = state;
+ S3I(ssl)->hs.state = state;
}
void