summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_both.c
diff options
context:
space:
mode:
authorjsing <>2018-10-24 18:04:50 +0000
committerjsing <>2018-10-24 18:04:50 +0000
commitd7e0aa4b59fc46f038370bf8dc64821eb4a7d804 (patch)
treece8dad95e6021ab405b0ec175b26682e47bea424 /src/lib/libssl/ssl_both.c
parentc988048231bcb1d2abd6613e83760d63c461a080 (diff)
downloadopenbsd-d7e0aa4b59fc46f038370bf8dc64821eb4a7d804.tar.gz
openbsd-d7e0aa4b59fc46f038370bf8dc64821eb4a7d804.tar.bz2
openbsd-d7e0aa4b59fc46f038370bf8dc64821eb4a7d804.zip
Make more of libssl's record layer state internal.
In January 2017, we changed large amounts of libssl's data structures to be non-visible/internal, however intentionally left things that the software ecosystem was needing to use. The four or so applications that reached into libssl for record layer related state now implement alternative code. As such, make these data structures internal. ok tb@
Diffstat (limited to 'src/lib/libssl/ssl_both.c')
-rw-r--r--src/lib/libssl/ssl_both.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libssl/ssl_both.c b/src/lib/libssl/ssl_both.c
index 788505e602..81fd1f80c5 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.12 2018/08/24 17:30:32 jsing Exp $ */ 1/* $OpenBSD: ssl_both.c,v 1.13 2018/10/24 18:04:50 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 *
@@ -700,16 +700,16 @@ ssl3_setup_read_buffer(SSL *s)
700 700
701 align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1); 701 align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1);
702 702
703 if (s->s3->rbuf.buf == NULL) { 703 if (S3I(s)->rbuf.buf == NULL) {
704 len = SSL3_RT_MAX_PLAIN_LENGTH + 704 len = SSL3_RT_MAX_PLAIN_LENGTH +
705 SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + align; 705 SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + align;
706 if ((p = malloc(len)) == NULL) 706 if ((p = malloc(len)) == NULL)
707 goto err; 707 goto err;
708 s->s3->rbuf.buf = p; 708 S3I(s)->rbuf.buf = p;
709 s->s3->rbuf.len = len; 709 S3I(s)->rbuf.len = len;
710 } 710 }
711 711
712 s->internal->packet = &(s->s3->rbuf.buf[0]); 712 s->internal->packet = &(S3I(s)->rbuf.buf[0]);
713 return 1; 713 return 1;
714 714
715err: 715err:
@@ -730,7 +730,7 @@ ssl3_setup_write_buffer(SSL *s)
730 730
731 align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1); 731 align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1);
732 732
733 if (s->s3->wbuf.buf == NULL) { 733 if (S3I(s)->wbuf.buf == NULL) {
734 len = s->max_send_fragment + 734 len = s->max_send_fragment +
735 SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD + headerlen + align; 735 SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD + headerlen + align;
736 if (!(s->internal->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS)) 736 if (!(s->internal->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS))
@@ -739,8 +739,8 @@ ssl3_setup_write_buffer(SSL *s)
739 739
740 if ((p = malloc(len)) == NULL) 740 if ((p = malloc(len)) == NULL)
741 goto err; 741 goto err;
742 s->s3->wbuf.buf = p; 742 S3I(s)->wbuf.buf = p;
743 s->s3->wbuf.len = len; 743 S3I(s)->wbuf.len = len;
744 } 744 }
745 745
746 return 1; 746 return 1;
@@ -763,15 +763,15 @@ ssl3_setup_buffers(SSL *s)
763int 763int
764ssl3_release_write_buffer(SSL *s) 764ssl3_release_write_buffer(SSL *s)
765{ 765{
766 free(s->s3->wbuf.buf); 766 free(S3I(s)->wbuf.buf);
767 s->s3->wbuf.buf = NULL; 767 S3I(s)->wbuf.buf = NULL;
768 return 1; 768 return 1;
769} 769}
770 770
771int 771int
772ssl3_release_read_buffer(SSL *s) 772ssl3_release_read_buffer(SSL *s)
773{ 773{
774 free(s->s3->rbuf.buf); 774 free(S3I(s)->rbuf.buf);
775 s->s3->rbuf.buf = NULL; 775 S3I(s)->rbuf.buf = NULL;
776 return 1; 776 return 1;
777} 777}