diff options
author | beck <> | 2017-05-07 04:22:24 +0000 |
---|---|---|
committer | beck <> | 2017-05-07 04:22:24 +0000 |
commit | 3b455600d14ddcf2be0dcd2d4765d1b7854cd1c5 (patch) | |
tree | 9f980ffff8490ca0af628971a6d8ceb4a23d3b99 /src/lib/libssl/ssl_both.c | |
parent | 2145114fc4f04a6a75134ef92bc551a976292150 (diff) | |
download | openbsd-3b455600d14ddcf2be0dcd2d4765d1b7854cd1c5.tar.gz openbsd-3b455600d14ddcf2be0dcd2d4765d1b7854cd1c5.tar.bz2 openbsd-3b455600d14ddcf2be0dcd2d4765d1b7854cd1c5.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 'src/lib/libssl/ssl_both.c')
-rw-r--r-- | src/lib/libssl/ssl_both.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libssl/ssl_both.c b/src/lib/libssl/ssl_both.c index 13c39e85b2..4a724560f2 100644 --- a/src/lib/libssl/ssl_both.c +++ b/src/lib/libssl/ssl_both.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_both.c,v 1.8 2017/05/06 22:24:57 beck Exp $ */ | 1 | /* $OpenBSD: ssl_both.c,v 1.9 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 | * |
@@ -171,7 +171,7 @@ ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) | |||
171 | 171 | ||
172 | memset(&cbb, 0, sizeof(cbb)); | 172 | memset(&cbb, 0, sizeof(cbb)); |
173 | 173 | ||
174 | if (s->internal->state == a) { | 174 | if (S3I(s)->hs.state == a) { |
175 | md_len = TLS1_FINISH_MAC_LENGTH; | 175 | md_len = TLS1_FINISH_MAC_LENGTH; |
176 | OPENSSL_assert(md_len <= EVP_MAX_MD_SIZE); | 176 | OPENSSL_assert(md_len <= EVP_MAX_MD_SIZE); |
177 | 177 | ||
@@ -199,7 +199,7 @@ ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) | |||
199 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 199 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) |
200 | goto err; | 200 | goto err; |
201 | 201 | ||
202 | s->internal->state = b; | 202 | S3I(s)->hs.state = b; |
203 | } | 203 | } |
204 | 204 | ||
205 | return (ssl3_handshake_write(s)); | 205 | return (ssl3_handshake_write(s)); |
@@ -227,7 +227,7 @@ ssl3_take_mac(SSL *s) | |||
227 | if (S3I(s)->hs.new_cipher == NULL) | 227 | if (S3I(s)->hs.new_cipher == NULL) |
228 | return; | 228 | return; |
229 | 229 | ||
230 | if (s->internal->state & SSL_ST_CONNECT) { | 230 | if (S3I(s)->hs.state & SSL_ST_CONNECT) { |
231 | sender = TLS_MD_SERVER_FINISH_CONST; | 231 | sender = TLS_MD_SERVER_FINISH_CONST; |
232 | slen = TLS_MD_SERVER_FINISH_CONST_SIZE; | 232 | slen = TLS_MD_SERVER_FINISH_CONST_SIZE; |
233 | } else { | 233 | } else { |
@@ -313,13 +313,13 @@ ssl3_send_change_cipher_spec(SSL *s, int a, int b) | |||
313 | { | 313 | { |
314 | unsigned char *p; | 314 | unsigned char *p; |
315 | 315 | ||
316 | if (s->internal->state == a) { | 316 | if (S3I(s)->hs.state == a) { |
317 | p = (unsigned char *)s->internal->init_buf->data; | 317 | p = (unsigned char *)s->internal->init_buf->data; |
318 | *p = SSL3_MT_CCS; | 318 | *p = SSL3_MT_CCS; |
319 | s->internal->init_num = 1; | 319 | s->internal->init_num = 1; |
320 | s->internal->init_off = 0; | 320 | s->internal->init_off = 0; |
321 | 321 | ||
322 | s->internal->state = b; | 322 | S3I(s)->hs.state = b; |
323 | } | 323 | } |
324 | 324 | ||
325 | /* SSL3_ST_CW_CHANGE_B */ | 325 | /* SSL3_ST_CW_CHANGE_B */ |
@@ -442,7 +442,7 @@ ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) | |||
442 | p = (unsigned char *)s->internal->init_buf->data; | 442 | p = (unsigned char *)s->internal->init_buf->data; |
443 | 443 | ||
444 | /* s->internal->init_num < 4 */ | 444 | /* s->internal->init_num < 4 */ |
445 | if (s->internal->state == st1) { | 445 | if (S3I(s)->hs.state == st1) { |
446 | int skip_message; | 446 | int skip_message; |
447 | 447 | ||
448 | do { | 448 | do { |
@@ -504,7 +504,7 @@ ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) | |||
504 | goto err; | 504 | goto err; |
505 | } | 505 | } |
506 | S3I(s)->tmp.message_size = l; | 506 | S3I(s)->tmp.message_size = l; |
507 | s->internal->state = stn; | 507 | S3I(s)->hs.state = stn; |
508 | 508 | ||
509 | s->internal->init_msg = s->internal->init_buf->data + 4; | 509 | s->internal->init_msg = s->internal->init_buf->data + 4; |
510 | s->internal->init_num = 0; | 510 | s->internal->init_num = 0; |