diff options
author | jsing <> | 2018-04-07 16:55:13 +0000 |
---|---|---|
committer | jsing <> | 2018-04-07 16:55:13 +0000 |
commit | 0f219ed58669d704f7d68056ec8b402987e32858 (patch) | |
tree | cfbac1978ec7deef97b3d6117cc0b62d0009604c /src/lib/libssl/s3_lib.c | |
parent | abb1c0eeef1b9e24cbf255fafa8bbb730e86f46d (diff) | |
download | openbsd-0f219ed58669d704f7d68056ec8b402987e32858.tar.gz openbsd-0f219ed58669d704f7d68056ec8b402987e32858.tar.bz2 openbsd-0f219ed58669d704f7d68056ec8b402987e32858.zip |
Nuke SSL3_FLAGS_DELAY_CLIENT_FINISHED and SSL3_FLAGS_POP_BUFFER.
These flags enabled experimental behaviour in the write path, which nothing
uses. Removing this code greatly simplifies ssl3_write().
ok beck@ inoguchi@ sthen@ tb@
Diffstat (limited to 'src/lib/libssl/s3_lib.c')
-rw-r--r-- | src/lib/libssl/s3_lib.c | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c index 52e0c52410..aa430ee971 100644 --- a/src/lib/libssl/s3_lib.c +++ b/src/lib/libssl/s3_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s3_lib.c,v 1.165 2018/03/15 12:27:00 jca Exp $ */ | 1 | /* $OpenBSD: s3_lib.c,v 1.166 2018/04/07 16:55:13 jsing 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 | * |
@@ -2524,56 +2524,13 @@ ssl3_shutdown(SSL *s) | |||
2524 | int | 2524 | int |
2525 | ssl3_write(SSL *s, const void *buf, int len) | 2525 | ssl3_write(SSL *s, const void *buf, int len) |
2526 | { | 2526 | { |
2527 | int ret, n; | ||
2528 | |||
2529 | #if 0 | ||
2530 | if (s->internal->shutdown & SSL_SEND_SHUTDOWN) { | ||
2531 | s->internal->rwstate = SSL_NOTHING; | ||
2532 | return (0); | ||
2533 | } | ||
2534 | #endif | ||
2535 | errno = 0; | 2527 | errno = 0; |
2528 | |||
2536 | if (S3I(s)->renegotiate) | 2529 | if (S3I(s)->renegotiate) |
2537 | ssl3_renegotiate_check(s); | 2530 | ssl3_renegotiate_check(s); |
2538 | 2531 | ||
2539 | /* | 2532 | return s->method->internal->ssl_write_bytes(s, |
2540 | * This is an experimental flag that sends the | 2533 | SSL3_RT_APPLICATION_DATA, buf, len); |
2541 | * last handshake message in the same packet as the first | ||
2542 | * use data - used to see if it helps the TCP protocol during | ||
2543 | * session-id reuse | ||
2544 | */ | ||
2545 | /* The second test is because the buffer may have been removed */ | ||
2546 | if ((s->s3->flags & SSL3_FLAGS_POP_BUFFER) && (s->wbio == s->bbio)) { | ||
2547 | /* First time through, we write into the buffer */ | ||
2548 | if (S3I(s)->delay_buf_pop_ret == 0) { | ||
2549 | ret = ssl3_write_bytes(s, SSL3_RT_APPLICATION_DATA, | ||
2550 | buf, len); | ||
2551 | if (ret <= 0) | ||
2552 | return (ret); | ||
2553 | |||
2554 | S3I(s)->delay_buf_pop_ret = ret; | ||
2555 | } | ||
2556 | |||
2557 | s->internal->rwstate = SSL_WRITING; | ||
2558 | n = BIO_flush(s->wbio); | ||
2559 | if (n <= 0) | ||
2560 | return (n); | ||
2561 | s->internal->rwstate = SSL_NOTHING; | ||
2562 | |||
2563 | /* We have flushed the buffer, so remove it */ | ||
2564 | ssl_free_wbio_buffer(s); | ||
2565 | s->s3->flags&= ~SSL3_FLAGS_POP_BUFFER; | ||
2566 | |||
2567 | ret = S3I(s)->delay_buf_pop_ret; | ||
2568 | S3I(s)->delay_buf_pop_ret = 0; | ||
2569 | } else { | ||
2570 | ret = s->method->internal->ssl_write_bytes(s, | ||
2571 | SSL3_RT_APPLICATION_DATA, buf, len); | ||
2572 | if (ret <= 0) | ||
2573 | return (ret); | ||
2574 | } | ||
2575 | |||
2576 | return (ret); | ||
2577 | } | 2534 | } |
2578 | 2535 | ||
2579 | static int | 2536 | static int |